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.
[03:42 am]
RIVE -- Hellooooo, Nurse
[04:19 pm]
NudeRaider -- Hello World!
[2026-6-01. : 4:03 pm]
IskatuMesk -- no Hello World? No Hello . jpeg? Not even ddosing some government website? smh my head
[2026-5-31. : 10:02 pm]
Symmetry -- I was really just figuring out how to compile
[2026-5-31. : 10:02 pm]
Symmetry -- I didn't make it do anything
[2026-5-31. : 9:17 pm]
Ultraviolet -- hell yeah. did you have trouble making the button functional, or just haven't gotten there yet?
[2026-5-31. : 8:29 pm]
Symmetry -- I made the marine shoot lasers and gave the medic a nonfunctional button
[2026-5-31. : 8:07 pm]
Ultraviolet -- Symmetry
Symmetry shouted: I did my first EUD thing today. Feels like me finding arsenal at age 8 again
haha for sure. in some ways it's even more exciting because you can play EUD maps on regular battle.net, don't need to convince someone to download your mod to play with you. what did you do?
[2026-5-31. : 6:47 pm]
Symmetry -- I did my first EUD thing today. Feels like me finding arsenal at age 8 again
[2026-5-31. : 3:20 pm]
l)ark_ssj9kevin -- le reddit
Please log in to shout.


Members Online: jun3hong, NudeRaider