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.
[06:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Roy