I want to create a dynamic button tooltip for a damage type spell what deals
xxx+(BehaviorStackPoints*xx) damage.
The behavior itself doesn't do a thing, I only use it for it's stacks, also the behaviors stack count changes if the player gains a level, or equips a weapon.
Now, how can I set the spells button tooltip to a dynamic teyt, what changes when the behavior changes.
I managed to refer to the behaviors minimum point, but I want to refer to the current point.
So I want to make it like when you buy a weapon in LoL and your spells button tooltip changes.
I've seen something similar in the "Boss Testing" arcade game too.
If someone could help me, I would really appreciate it.
It's about ui editing. I believe you will need a custom command button tooltip which you can define by adding changes to UI xml command button template, for example change the tooltip frame, and then hookup it with triggers and set tooltip for dialog item. Anyway i'm not expert in UI so you better ask how to do it in that forum.
one easier way would be to create a dummy damage effect. each time the stack count changes you set the amount of the dummy effect to the new damage with catalogs and just link the dummy effect amount in your tooltip.
this brings us to the question, how to check if a behaviour stack has changed? add another dummy effect to the refresh effect of your stack behaviour and register this effect as event in triggers. now you can set with catalogs the amount.
I've just started to experiment with XML UI files so i know how to do it roughly and there are lot of things i dont understand clearly. Every button has "Tooltip Frame" parameter defined (In it's template). You need to change this frame to "Standard Tooltip" so you will be able to use it with trigger action (set dialog item tooltip). Then you use "Hookup Standard Dialog Item" action to get a control of this button, After that you will be able to set it's custom tooltip via triggers (Set DIalog Item Tooltip action).
Create thread like this in UI Development forum. I'm not super good in this, and i don't know how to properly change XML so it wont cause issues.
you can always set catalogs for this player so tooltips about mana cost / cd will update automatically. you can track picking up an certain item (without registering the general event of unit picks up item) with a buff on the item itself that runs an effect on picking it up. on pickup set the catalogs and you are done. (if it is a map with one hero unit)
Okay so after hours of trying and searching all the forums I managed to get it done.
It uses a behavior inherited by a unit, let's call it AttackDamage.
Furthermore you will need to duplicate the damage effect used by your ability to set its value back if you drop your weapon, let's call them CutDamage and CutDamage2.
And of course you need a a Button too for the tooltip, where we will use an expression with four different text:
A: Your hero cuts the enemy, dealing <d ref="Effect,CutDamage,Amount-
B: (String(AttackDamageScaled) with 0 decimal places)
C: "/><c val="FF8000">(+
B: (String(AttackDamageScaled) with 0 decimal places)
D: ) </c>physical damage.
So why did we took it apart, instead of using one string?
The answer is simple, because of the equation.
At the end of A you can see a - mark which is followed by a linked Local Variable what we converted to String from Real.
The trigger looks like this:
- Events:
Unit - Any Unit attribute points changed
- Local Variables:
AttackDamageStackCount = (Stack Count of AttackDamage on (Triggering Unit)) <Real>
AttackDamageScaled = 0.0<Real>
- Conditions:
(Triggering behavior) == AttackDamage
- Actions:
If: (Unit type of (Triggering Unit)) == (your unit type of unit)
Then:
If: AttackDamageStackCount > 0.0
Then:
Catalog - Set value of Effect,CutDamage,Amount for player (Triggering player) to (Value of Effects CutDamage2 (Damage CEffectDamage) Amount for player (Triggering player))
Variable - Modify AttackDamageStackCount: * 1.5 (can be changed to whatever value you want it to be)
Variable - Set AttackDamageScaled = AttackDamageStackCount
Variable - Modify AttackDamageStackCount: + (Value of Effects CutDamage Amount for player (Triggering player) as an integer)
Catalog - Set value of Effect,CutDamage,Amount for player (Triggering player) to (String(AttackDamageStackCount) with 0 decimal places)
Catalog - Set value of Button,(your ability button here),Tooltip for player (Triggering player) to {~A~~B~~C~~B~~D~}
Else:
Catalog - Set value of Effect,CutDamage,Amount for player (Triggering player) to (Value of Effects CutDamage2 Amount for player (Triggering player))
Catalog - Set value of Button,(your ability button here),Tooltip for player (Triggering player) to "Your hero cuts the enemy, dealing <d ref="Effect,CutDamage,Amount"/><c val="FF8000">(+)</c> damage."
It will look something like this if you dont have any weapon equipped:
And this if you have a weapon:
You can copy&paste this code in your editor for other abilities or heroes, you just need to change the Unit, Effects,Button, it's tooltip and the multiplier of course.
Please note that if anything changes your behavior stack count besides your weapons, it will change the damage of your ability too.
Hello!
I want to create a dynamic button tooltip for a damage type spell what deals xxx+(BehaviorStackPoints*xx) damage. The behavior itself doesn't do a thing, I only use it for it's stacks, also the behaviors stack count changes if the player gains a level, or equips a weapon. Now, how can I set the spells button tooltip to a dynamic teyt, what changes when the behavior changes.
I managed to refer to the behaviors minimum point, but I want to refer to the current point.
Here is the current tooltip:
"Deals <d ref="Effect,TestEffectDamage,Amount"/><c val="FF8000">(+<d ref="Behavior,TestBehavior,MinPoints*0.1"/>) </c>damage."
So I want to make it like when you buy a weapon in LoL and your spells button tooltip changes. I've seen something similar in the "Boss Testing" arcade game too.
If someone could help me, I would really appreciate it.
It's about ui editing. I believe you will need a custom command button tooltip which you can define by adding changes to UI xml command button template, for example change the tooltip frame, and then hookup it with triggers and set tooltip for dialog item. Anyway i'm not expert in UI so you better ask how to do it in that forum.
Hmmm..... Could you link me a tutorial for this, or could you make an example?
I'm just not good at U.I. editing as it seems.
@Kristof4364368565: Go
one easier way would be to create a dummy damage effect. each time the stack count changes you set the amount of the dummy effect to the new damage with catalogs and just link the dummy effect amount in your tooltip.
this brings us to the question, how to check if a behaviour stack has changed? add another dummy effect to the refresh effect of your stack behaviour and register this effect as event in triggers. now you can set with catalogs the amount.
@Kristof4364368565: Go
I've just started to experiment with XML UI files so i know how to do it roughly and there are lot of things i dont understand clearly. Every button has "Tooltip Frame" parameter defined (In it's template). You need to change this frame to "Standard Tooltip" so you will be able to use it with trigger action (set dialog item tooltip). Then you use "Hookup Standard Dialog Item" action to get a control of this button, After that you will be able to set it's custom tooltip via triggers (Set DIalog Item Tooltip action).
Create thread like this in UI Development forum. I'm not super good in this, and i don't know how to properly change XML so it wont cause issues.
@FunkyUserName: Go
y, this solution is valid too if you want just simple modification, like if you haven't items with Reduce Manacost or Reduce Cooldown enchantments.
@abvdzh: Go
you can always set catalogs for this player so tooltips about mana cost / cd will update automatically. you can track picking up an certain item (without registering the general event of unit picks up item) with a buff on the item itself that runs an effect on picking it up. on pickup set the catalogs and you are done. (if it is a map with one hero unit)
y this option is better for him i think, and easier. I'm just figuring out and testing some random loot spawn )) so i was just all in it
Could someone send me a map with the trigger? I just can't get it to work. :D I've no idea what I'm doing wrong.
Okay so after hours of trying and searching all the forums I managed to get it done.
It uses a behavior inherited by a unit, let's call it AttackDamage.
Furthermore you will need to duplicate the damage effect used by your ability to set its value back if you drop your weapon, let's call them CutDamage and CutDamage2.
And of course you need a a Button too for the tooltip, where we will use an expression with four different text:
So why did we took it apart, instead of using one string?
The answer is simple, because of the equation.
At the end of A you can see a - mark which is followed by a linked Local Variable what we converted to String from Real.
The trigger looks like this:
- Events: Unit - Any Unit attribute points changed
- Local Variables:
AttackDamageStackCount = (Stack Count of AttackDamage on (Triggering Unit)) <Real>
AttackDamageScaled = 0.0<Real>
- Conditions: (Triggering behavior) == AttackDamage
- Actions:
If: (Unit type of (Triggering Unit)) == (your unit type of unit)
Then:
If: AttackDamageStackCount > 0.0
Then:
Catalog - Set value of Effect,CutDamage,Amount for player (Triggering player) to (Value of Effects CutDamage2 (Damage CEffectDamage) Amount for player (Triggering player))
Variable - Modify AttackDamageStackCount: * 1.5 (can be changed to whatever value you want it to be)
Variable - Set AttackDamageScaled = AttackDamageStackCount
Variable - Modify AttackDamageStackCount: + (Value of Effects CutDamage Amount for player (Triggering player) as an integer)
Catalog - Set value of Effect,CutDamage,Amount for player (Triggering player) to (String(AttackDamageStackCount) with 0 decimal places)
Catalog - Set value of Button,(your ability button here),Tooltip for player (Triggering player) to {~A~~B~~C~~B~~D~}
Else:
Catalog - Set value of Effect,CutDamage,Amount for player (Triggering player) to (Value of Effects CutDamage2 Amount for player (Triggering player))
Catalog - Set value of Button,(your ability button here),Tooltip for player (Triggering player) to "Your hero cuts the enemy, dealing <d ref="Effect,CutDamage,Amount"/><c val="FF8000">(+)</c> damage."
It will look something like this if you dont have any weapon equipped:
And this if you have a weapon:
You can copy&paste this code in your editor for other abilities or heroes, you just need to change the Unit, Effects,Button, it's tooltip and the multiplier of course.
Please note that if anything changes your behavior stack count besides your weapons, it will change the damage of your ability too.
PS: Sorry for my English.