I have a button with an ability, for example, Toss Grenade. There are also several upgrades which improve damage, range, etc of the Toss Grenade skill. These upgrades can be acquired in any order and combination.
How can you show each upgrade's status in the tooltip of the Toss Grenade ability (similar to Heroes of the Storm)
Something like this:
Example is from Heroes of the Storm (Blizzard game) in which you see all your abilities' improvements in the tooltip.
Is it possible to replicate this behaviour without creating a button for each and every combination of upgrades (which would be the brute force variant, but not feasable with everything more than 2 upgrades)?
Are there some kind of conditions which one can use in the String Vals?
You can use the Catalog Field Value Set to change the button's text for a player. Create a function to add text to the button for a player depending on upgrade status, and run the action any time an upgrade is researched.
The UpdateAbilityText(string Ability, int Player) would look something like this in psuedocode:
stringOriginalAbilityText=CatalogFieldValueGet(Ability,ButtonText,0);//make sure to get original text from player 0 so it remains unchanged, assuming you dont ever upgrade player 0)stringUpdatedAbiltyText=OriginalAbilityText;foreachPotentialUpgrade{if(PotentialUpgrade==Researched){UpdatedAbilityText+=AbilityUpgradeTagLine;}}CatalogFieldValueSet(Ability,ButtonText,Player);
I strongly suggest User Types as a method of organizing ability upgrade data (tagline string values, etc).
You can use the Catalog Field Value Set to change the button's text for a player. Create a function to add text to the button for a player depending on upgrade status, and run the action any time an upgrade is researched.
The UpdateAbilityText(string Ability, int Player) would look something like this in psuedocode:
stringOriginalAbilityText=CatalogFieldValueGet(Ability,ButtonText,0);//make sure to get original text from player 0 so it remains unchanged, assuming you dont ever upgrade player 0)stringUpdatedAbiltyText=OriginalAbilityText;foreachPotentialUpgrade{if(PotentialUpgrade==Researched){UpdatedAbilityText+=AbilityUpgradeTagLine;}}CatalogFieldValueSet(Ability,ButtonText,Player);
I strongly suggest User Types as a method of organizing ability upgrade data (tagline string values, etc).
That's a nice idea! I will immediately create me a UserType and start experimenting.
update
Seems to work besides one minor problem: I am unable to retrieve the original tooltip text. If I do something like this:
there is a function that converts a string path to the string value
Thanks. I'll look into that for nicer code. My code is not perfectly generic right now, but it works already. Here is the result. Pretty sweet I'd say. Thanks again, greythepirate.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I have a button with an ability, for example, Toss Grenade. There are also several upgrades which improve damage, range, etc of the Toss Grenade skill. These upgrades can be acquired in any order and combination. How can you show each upgrade's status in the tooltip of the Toss Grenade ability (similar to Heroes of the Storm)
Something like this: Example is from Heroes of the Storm (Blizzard game) in which you see all your abilities' improvements in the tooltip.
Is it possible to replicate this behaviour without creating a button for each and every combination of upgrades (which would be the brute force variant, but not feasable with everything more than 2 upgrades)? Are there some kind of conditions which one can use in the String Vals?
@BlacKcuD: Go
You can use the Catalog Field Value Set to change the button's text for a player. Create a function to add text to the button for a player depending on upgrade status, and run the action any time an upgrade is researched.
The UpdateAbilityText(string Ability, int Player) would look something like this in psuedocode:
I strongly suggest User Types as a method of organizing ability upgrade data (tagline string values, etc).
@PirateArcade | I make games | Ask me things on Discord
That's a nice idea! I will immediately create me a UserType and start experimenting.
update
Seems to work besides one minor problem: I am unable to retrieve the original tooltip text. If I do something like this:
The string gets "base\abilts\tooltip\something", basically the path, but not the actual value at that position. Is this the wrong action?
there is a function that converts a string path to the string value
Thanks. I'll look into that for nicer code. My code is not perfectly generic right now, but it works already. Here is the result. Pretty sweet I'd say. Thanks again, greythepirate.