EQ2Interface.com
Search Downloads


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

Reply
Thread Tools Search this Thread Display Modes
  #1  
Unread 03-12-2010, 12:40 PM
Lakih Lakih is offline
A Young Mystail Rat
 
Join Date: Jan 2008
Server: Permafrost
Posts: 5
Default fire two action on onshow

Hi.

I've spent a couple of hours searching but i cant wrap my head around a little issue i'm having.

Is it possible to fire two actions on an event?

When i open a window (onshow) i want the ui to automagicly press two buttons (for two different calculations).

Pseudo code:
OnShow=Button1.press=true Button2.press=true

or something like that... Is it possible?

What i'm trying to do:

I have in my inventory window some basic stats, like resists and defensive stats. I have one button that calculates average resists and want to add another button in the same window that calculates avoidance.

I managed to figure out how to do average resists by stealing drumstix awesome sollution (thanks man ) but i want to do the same thing with another value... in the same window...

It seems like such a simple problem but i cant figure it out
Reply With Quote
  #2  
Unread 03-12-2010, 02:42 PM
Drumstix42's Avatar
Drumstix42 Drumstix42 is offline
A Griffon
Featured
 
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
Default

You can indeed fire off several commands. It's usually easiest to just hit enter down to a new line, but technically you can separate by a space.

However, note that while the engine reads from top to bottom, it reads commands from right to left.

In the UIBuilder, OnShow=
Code:
Button1.press=true
Button2.press=true
__________________
"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
  #3  
Unread 03-12-2010, 04:48 PM
Lakih Lakih is offline
A Young Mystail Rat
 
Join Date: Jan 2008
Server: Permafrost
Posts: 5
Default

oh...

I almost wish it was horribly complicated then i wouldnt feel so stupid right now

Thank you Drumstix
Reply With Quote
  #4  
Unread 03-12-2010, 06:25 PM
Lakih Lakih is offline
A Young Mystail Rat
 
Join Date: Jan 2008
Server: Permafrost
Posts: 5
Default

Fireing off two actions worked just fine... but i ran headfirst into a massive brickwall with the next step of my master plan.

I am trying to calculate the avoidance of a character. If you hover over the Avoidance stat in the persona window you get a tooltip with your avoidance. It also shows your base, block and parry values.

You can get base avoidance, block and parry through gamedata, however it returns the data as a percent value that i havent found a way to do arithmetics on.

The math behind it is as follows (found the calculation on the official forums, took me a while to make a formula of it.

Code:
Avoidance = x
Parry = P
Block = B
Base avoidance = D


x= (P)+((B/100)*(100-P))+((D/100)*(100-P-((B/100)*(100-P))))
Is there a way around my brickwall of not beeing able to do math on the base/block/parry values?
Reply With Quote
  #5  
Unread 03-12-2010, 07:28 PM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

So you're getting something like 12.3% and want just the number?

int(P) will do *something* close to what you want. It'll either spit out 12 as an integer casting should, but I have a feeling it will give you 123. As in it just throws out all the non-digit characters. You can just divide that by 10 afterwards.

You're probably going to have fun splitting that formula apart as well. You can only do one simple calculation per line.
Reply With Quote
  #6  
Unread 03-12-2010, 08:10 PM
Lakih Lakih is offline
A Young Mystail Rat
 
Join Date: Jan 2008
Server: Permafrost
Posts: 5
Default

int(p) worked partly... it cut the % but it also cut .7 out of my 20.7% parry
float(p) gave me nothing...


Splitting the formula into different lines actually makes it alot easier when it comes to the math

The formula in plain english is;

say you have 20% parry, 40% block and 10% dodge.

Your actual avoidance is as follows:

20% of incoming blows are parried.

.4*80%= 32% of incoming blows are blocked

.1*48%= 4.8% of incoming blows are dodged

Total avoidance: 56.8%
Reply With Quote
  #7  
Unread 03-13-2010, 01:07 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

See what happens if you add another decimal to it...

So the end result is like 12.3%.45. It'll either search forwards or backwards... I'd hate to assume which.
Reply With Quote
  #8  
Unread 03-13-2010, 05:56 AM
Lakih Lakih is offline
A Young Mystail Rat
 
Join Date: Jan 2008
Server: Permafrost
Posts: 5
Default

Seems like i'm beating a dead horse

http://www.eq2interface.com/forums/s...ad.php?t=11356

Every time i do a type conversion to int it cuts the decimals and if i don't do a conversion to int i can't do any arithmetics

Thanks for all the help though, appreciate it.

DD for the avoidance is on the wishlist but nothing has happend in the past two years...
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 08:45 AM.


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