EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > UI Developer Discussion

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Unread 07-24-2010, 09:04 PM
Draakthor's Avatar
Draakthor Draakthor is offline
A Crazed Gnoll
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 22
Default Scripting issue(s)

I've been beating my head against the desk with this for hours now, and could use another set or two of eyes/brains.

I'm trying to add class detection to Dragowulf's SpellTimer Window. Basically, I'm setting it up for use by up to five different classes. I added a text object to hold the subclass name for comparison, and five hidden buttons with the scripts to copy data into the working set.

The gist of each button's script is (OnPress):
Code:
Parent.SpellTimerData.1.SpellName=Parent.ClassSpellData.A.1.SpellName
Parent.SpellTimerData.2.SpellName=Parent.ClassSpellData.A.2.SpellName
Parent.SpellTimerData.3.SpellName=Parent.ClassSpellData.A.3.SpellName
...repeated through 15. SpellTimerData is the 'working set' from Dragowulf's original code, which I haven't modified in any way (as far as I know); and ClassSpellData is the new set I added. There's one button per class, A through E, to reduce the workload.

I seem to have figured out the class detection part, but apparently the data getting put into the working set is "Parent.ClassSpellData.A.1.SpellName" and so forth, rather than the contents of that property.

A slightly less frustrating problem is getting the buttons to activate. OnPress should be triggered by Buttonname.Activated=true, correct?

If looking at the actual files would help more, links to both are below (the data is in a separate file for easy modification).
main xml
data xml
Reply With Quote
  #2  
Unread 07-25-2010, 03:42 AM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Activate does not fire onPress.

Press is a Click event, meaning mouse down and up inside the Control. You can trigger it via script by setting Press = true (which fires the onPress event), but the "Press" property immediately resets itself back to False so that its ready for the next press.

De/Activate is similar to a check box's Un/Checked events. You can fire the OnActivate event by setting Activate = True, but unlike Press, the property retains the True value until you change it to False. When you do change it to False, the onDeactivate event fires. Note that for either of these events to be fired, a "Switch" must occur. For example, If the Activate is already True, attempting to set it to True again will not fire the associated event.

As for your data passing issue, getting the script passed rather than its value typically indicates one of two problems...

A) Your pathing is wrong, so the data you're trying to access isn't located where your path is pointing. Usually means you're missing a "Parent" tag. Remember that each level of object nesting in your xml introduces another level of "Parenting" if you're pathing through it.

B) You're attempting to assign the value of an expression without evaluating the expression. Typically solved by assigning the value of the expression to a variable, then assigning the variable to your original target. A good way to debug this sort of problem is to temporarily add a visible textbox to your target window at the same level as the control you're trying to target. Target the dummy text box and tweak code until you're sure the script is dumping out the expected result, then change the target to whatever control you really want it going to.
Reply With Quote
  #3  
Unread 07-25-2010, 11:59 AM
Draakthor's Avatar
Draakthor Draakthor is offline
A Crazed Gnoll
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 22
Default

Thanks for the reply, I went back and fiddled some and somehow fixed the data passing issue (not sure what was wrong).

Having a slightly different issue now with the class detection. Here's the OnShow script for the main window page:
Code:
CLASS=Subclass.Text
ISCLASSA=(CLASS == ClassDataA.Class.ClassName)
ISCLASSB=(CLASS == ClassDataB.Class.ClassName)
ISCLASSC=(CLASS == ClassDataC.Class.ClassName)
ISCLASSD=(CLASS == ClassDataD.Class.ClassName)
ISCLASSE=(CLASS == ClassDataE.Class.ClassName)
ClassA.Press=ISCLASSA
ClassB.Press=ISCLASSB
ClassC.Press=ISCLASSC
ClassD.Press=ISCLASSD
ClassE.Press=ISCLASSE
"Subclass" is receiving the dynamicdata for Self.Subclass properly, yet all five ClassX buttons are getting pressed when the window shows. I was under the impression that (A == B) returns a boolean value, is this not the case or is there something else wrong here?

EDIT: I should add, the data for each Class.ClassName is different. A is "Paladin", B is "Monk", etc.

EDIT2: I'm just confused as heck now. Debugging textboxes show that, while logged in as a paladin, ISCLASSA = "true" and ISCLASSB = "false". So why is ClassB getting pressed...?

Last edited by Draakthor : 07-25-2010 at 12:48 PM.
Reply With Quote
  #4  
Unread 07-25-2010, 01:06 PM
Landiin Landiin is offline
Slayer of clock cycles
This person is a EQ2Map developer.
Featured
 
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
Default

If the object is not the parent of the objects you are trying to call the data from then you need to fix your paths. Also just an FYI; Button.Press=False will aslo simulate a button press. That has eat my lunch many times, then I remember Button.Press=<any thing> will simulate a button press.
__________________
Landiin's EQ2MAP Updater Discussion Download

Last edited by Landiin : 07-25-2010 at 01:47 PM.
Reply With Quote
  #5  
Unread 07-25-2010, 01:32 PM
Draakthor's Avatar
Draakthor Draakthor is offline
A Crazed Gnoll
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 22
Default

Yup, that was the problem. Switched to using OnActivate since they only need to trigger once per login and it's working. Thanks a ton
Reply With Quote
  #6  
Unread 07-26-2010, 12:09 AM
Zonx's Avatar
Zonx Zonx is offline
A Green Troll
This person is a EQ2Map developer.
Featured
 
Join Date: Dec 2004
Server: Blackburrow
Posts: 2,221
Default

Strongly recommend you have your OnActivate scripts reset the button back to Activate = False at the end of the script. This way the script can be triggered again.

Zoning is known to sometimes reset scripted variables, so you should not count on your class detection only needing to be called once per session. If I'm not mistaken, this particular bug was the cause of several knock-off's of Fetish ClickAbilities sometimes failing and requiring a relog. Is one reason I tend to avoid automating class/level detection and instead give the user a mechanism for selecting what they want.
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:48 PM.


Our Network
EQInterface | EQ2Interface | WoWInterface | LoTROInterface | ESOUI | MMOUI