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.
[2026-4-18. : 3:57 am]
NudeRaider -- https://staredit.net/381600/ You have 5 minutes, then you can only edit your posts.
[2026-4-17. : 4:05 pm]
NudeRaider -- DarkenedFantasies
DarkenedFantasies shouted: you eat lots of beans
:lol:
[2026-4-17. : 11:30 am]
NudeRaider -- I would like 3000 minerals, please
[2026-4-16. : 7:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
Please log in to shout.


Members Online: Nekron