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:35 pm]
Symmetry -- though mine's probably worse
[03:35 pm]
Symmetry -- That certainly sounds similar to what I've made
[06:28 am]
Ultraviolet -- sounds like Bound & Defend
[07:43 pm]
Symmetry -- If you take the reins you damn well be ready to ride
[2026-5-23. : 2:46 pm]
NudeRaider -- you wish
[2026-5-23. : 12:43 am]
IskatuMesk -- Ah, so Reindeer Breeding 3: BDSM edition.
[2026-5-22. : 12:45 am]
Moose -- tbh
[2026-5-20. : 8:27 pm]
Symmetry -- It's a bound map where you cross obstacles to earn units to defend your base
[2026-5-20. : 8:16 pm]
Symmetry -- No, the world isn't ready for that
[2026-5-20. : 5:11 pm]
Zoan -- Reindeer Breeding 3?
Please log in to shout.


Members Online: Symmetry, Moose