EQ2Interface.com
Search Downloads


Go Back   EQ2Interface > Developer Discussion > XML Modification Help & Info

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Unread 04-08-2005, 04:35 PM
Deathbane27's Avatar
Deathbane27 Deathbane27 is offline
aka Mook
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Jul 2004
Server: Nektulos
Posts: 1,451
Default Working IF statements!

I need to go to work in a few minutes. I leave it to you to do something cool while I'm away.

<Button A="10" B="20" OnPress="Parent.Bool.Visible=(A)<(B)" ...
<Page OnShow="(script)" OnHide="(script)"


Yup, that's how you do IF statements. You set an event-triggering Boolean (aka true/false) property to the true/false value of the statement, and put a script in the object's corresponding event.

Supported operators:

==
<
>



Not supported directly:

!= (Replace with Parent.Bool.Visible=(!(A)==(B))
<= (Replace with Parent.Bool.Visible=(!(A)>(B))
>= (Replace with Parent.Bool.Visible=(!(A)<(B))

(I may be using more parenthesis than I actually need.)

One step closer to world domination!


Attached demonstration Persona window that doesn't do anything useful. And you can see that I stumbled on this while attempting to combine text strings.
Attached Files
File Type: xml eq2ui_mainhud_persona.xml (32.1 KB, 461 views)
__________________
If it ain't broke, it needs more features!

Last edited by Deathbane27 : 04-08-2005 at 04:47 PM.
Reply With Quote
  #2  
Unread 04-08-2005, 04:59 PM
taco-man's Avatar
taco-man taco-man is offline
EQ2MAP Updater Author
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 1,349
Default

omg this is so awesome!!!! sorry i cant help myself
__________________
EQ2MAP Updater Download
EQ2MAP Website
How to Install a custom interface
Reply With Quote
  #3  
Unread 04-08-2005, 05:40 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

You'll have to explain a bit more with the example, since me finding it on my own would probably take a bit Good find nonetheless if it can be used.
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #4  
Unread 04-08-2005, 05:42 PM
hirebrand hirebrand is offline
Bellum Aeternus
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Dec 2004
Server: Unkown
Posts: 165
Default

So

<Button
A="/GameData.Self.Power"
B="50"
OnPress="Emoter.Bool.Visible=(A)>(B)" }

<Page
Name="Emoter"
OnShow="laugh"
OnHide="cry" }

is the equivalent of

IF GameData.Self.Power > 50
THEN laugh
ELSE cry

?
Reply With Quote
  #5  
Unread 04-08-2005, 06:09 PM
hirebrand hirebrand is offline
Bellum Aeternus
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Dec 2004
Server: Unkown
Posts: 165
Default

Guess not. Trying a different way
Reply With Quote
  #6  
Unread 04-08-2005, 06:19 PM
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

That should prove usefull

Hehe, personally I'd use a button with Activated as the switch.

Hierbrand, other than the flubbed bracket at the end, that should work unless gamedata.self.power returns a string it can't compair to a number.

Last edited by Zonx : 04-08-2005 at 06:24 PM.
Reply With Quote
  #7  
Unread 04-08-2005, 10:10 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

Hmmm... now to figure out && and || !
__________________
"I'm afraid you're guilty of thought-crime. Don't bother getting the door, we'll let ourselves in..."
<Donate to DrumsUI> < [DrumsUI] Updater > < [DrumsUI] Full Interface> < Drumstix42 on Twitch.tv
>
Reply With Quote
  #8  
Unread 04-09-2005, 01:17 AM
Deathbane27's Avatar
Deathbane27 Deathbane27 is offline
aka Mook
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Jul 2004
Server: Nektulos
Posts: 1,451
Default

Quote:
Originally Posted by hirebrand
So

<Button
A="/GameData.Self.Power"
B="50"
OnPress="Emoter.Bool.Visible=(A)>(B)" }

<Page
Name="Emoter"
OnShow="laugh"
OnHide="cry" }

is the equivalent of

IF GameData.Self.Power > 50
THEN laugh
ELSE cry

?

You can't set a property to DynamicData. Here's how you'd do that:

<Progressbar Name="Power" DynamicData="/Gamedata.Self.Power"...
<Button OnPress="Parent.Trigger.Activated=(Parent.Power.Progress)>0.500"...
<Button name="Trigger" OnActivate="laugh" OnDeActivate="cry"...


Of course you'd actually have to have TWO triggers, one for activate, one for deactivate, because the OnActivate doesn't trigger if it's already activated, etc. But that's relatively minor.




More brainstorming:

Had someone request for a on-screen visual or sound when you are under attack. Best I could do was make it so when anything near you was attacked it brought up a window.

Now we can have that window check to see if your health is less than 100%, and if it is, make trigger some flashing and noise.
__________________
If it ain't broke, it needs more features!
Reply With Quote
  #9  
Unread 04-09-2005, 01:23 AM
ger's Avatar
ger ger is offline
Steward of the Faithful
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 580
Default

Quote:
Originally Posted by Deathbane27
More brainstorming:

Had someone request for a on-screen visual or sound when you are under attack. Best I could do was make it so when anything near you was attacked it brought up a window.

Now we can have that window check to see if your health is less than 100%, and if it is, make trigger some flashing and noise.
Often times when I'm first attacked the attack misses or is resisted. In cases such as these a health<100% check would return false even though I really am under attack. But it's a good start.
__________________
Reply With Quote
  #10  
Unread 04-10-2005, 08:40 PM
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

Text comparisons work!
(fubar)==(fubar)
returns true

If parent.text='fubar'
(parent.text)==(fubar)
is true

Simpler notation
parent.text=='fubar'


AND
(test1)&(test2) returns true if both tests are true
parent.text=='fubar'&1==1
is true
parent.text=='fubar'&1==2
is false

Bitwise
&! and !& appear to do the same as &.

OR and XOR
| and || seam to result in the second test being ignored. Resturns value of the first test. Same for ^

Last edited by Zonx : 04-11-2005 at 07:12 AM.
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 03:15 PM.


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