Staredit Network > Forums > SC2 Assistance > Topic: [Solved] Dynamic Tooltips
[Solved] Dynamic Tooltips
May 30 2011, 6:17 pm
By: NicholasBeige  

May 30 2011, 6:17 pm NicholasBeige Post #1



Okay:

You can display a value from any field in the data editor in the tooltip using this format:
<d ref="Behavior,LethalFury,Duration[0]"/>
<d ref="Behavior,Lethalfury,Modification[0].DeathResponse[0].Cost[0].Cooldown[0].TimeUse[0]"/>
<d ref="Behavior,LethalFury,Modification[0].AttackSpeedMultiplier[0]" precision="3"/>

It works for effects also, as such:
<d ref="Effect,TimeOrbSearch,AreaArray[0].Radius[0]"/>
<d ref="Effect,RepeatedBlows,Chance[0]" precision="3"/>

From what I understand, it's simply a data editor reference, pointing at a field value? Am i rite?

The first problem I'm encountering is how to display a derived value - ie. two field values multiplied together.
For example this:
Effect,TimeOrbPersistent,PeriodicPeriodArray[0] * Effect,TimeOrbPersistent,PeriodCount[0]
will translate to
0.0012 * 6000
Resulting in 7.2

But I tested that calculation out in the 'Formula Editor', and as such it removes the <d ref= "" /> tags. Therefore, simply pasting that into the tooltip field will show "Effect,TimeOrbPersistent,PeriodicPeriodArray[0] * Effect,TimeOrbPersistent,PeriodCount[0]" as plain text.

Question 1: What is the xml / starcraft 2 convention for converting the 'math' back into 'text'? Ie. How can I display the outcome of a mathematical function in a tooltip?

Question 2: What is the 'array' value at the end of every example posted above? eg: "ObjectType,ObjectName,FieldValue[array value]" ? What specifically does that point to? Are abilities/effects/etc able to be given 'levels'? Or does this refer to 'upgrades'? Or are all effects/abilities duplicated per player (to allow for upgrades etc?)



None.

May 30 2011, 8:02 pm NicholasBeige Post #2



Solved. Can be closed / deleted / go where-ever threads go when they die.

Edit for 'reference purposes':.

To display the result of a calculation you simply do the calculation within the calculations as so:
<d ref="Effect,GravitonBeam,PeriodCount[0] * Effect,GravitonBeam,PeriodicPeriodArray[0]"/>
This will return the period count multiplied by the period duration.

For the second problem: Starcraft 2 creates duplicated ability references for each player and these are what are modified when upgrades are edited. The <d ref "" /> tags will always point to a 'hard' location in the xml file (data editor objects) for the map. But these hard locations are extended as arrays for each player.

So - it works.

Post has been edited 1 time(s), last time on May 30 2011, 11:07 pm by Cardinal.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2020-10-19. : 7:29 am]
C(a)HeK -- sraw531
sraw531 shouted: GGmano just fyi, might be a good idea in the future to link to the thread in the shoutbox when you reference a new thread
here it is - http://www.staredit.net/topic/18132/unread/#special
[2020-10-19. : 7:19 am]
sraw531 -- GGmano
GGmano shouted: i made a topic about it if anyone knows something about this please check the topic
just fyi, might be a good idea in the future to link to the thread in the shoutbox when you reference a new thread
[2020-10-19. : 4:46 am]
C(a)HeK -- SiberianTiger
SiberianTiger shouted: C(a)HeK yes correct it is a multiplayer map
Unfortunately, I don't have free time for multiplayer
[2020-10-18. : 10:06 pm]
SiberianTiger -- C(a)HeK
C(a)HeK shouted: GGmano I answered you as best I could
yes correct it is a multiplayer map
[2020-10-18. : 9:12 pm]
GGmano -- thanks c(a)hek
[2020-10-18. : 9:05 pm]
lil-Inferno -- mad AF
[2020-10-18. : 8:57 pm]
*KrayZee angrily uses a pen and fills in the circle for Joe Biden*
[2020-10-18. : 4:59 pm]
C(a)HeK -- GGmano
GGmano shouted: i made a topic about it if anyone knows something about this please check the topic
I answered you as best I could
[2020-10-18. : 2:01 pm]
GGmano -- i made a topic about it if anyone knows something about this please check the topic
[2020-10-18. : 2:00 pm]
GGmano -- hi all does anyone knows what difference save files does??
Please log in to shout.


Members Online: Roy, MTiger156, galicjan184884, UndeadStar, Dem0n