• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Custom Abilties - Counting and manipulating

TobyFox2002

Well-known member
Well, I'm stymied.
I've tried to find a way to do two things and just cant seem to figure it out.

First, I want to count the number of times I've taken the same Custom Ability.
For instance, say I have the ability "Ice Armor," which can be taken more than once, each time you take it you gain an additional +1 natural armor.

I've tried hero.tagcount[xIceArmor], doesnt do anything.

Second, I have created a User tag and applied it to certain custom abilities.
I want to count how many seperate Custom Abilities with that tag the user has taken.

For example, they have taken "Accelerate Movement," and "Knight's Puissiance." Both have the tag EvovleMind.

So I've tried hero.tagcount[User.EvolveMind] and nothing happens it returns a zero or one. I can test if the user has or does not have a Custom Ability with that tag but I cant seem to count the number they have.

Is what I am looking for even possible?
 
In the Develop menu, make sure that "Enable Data File Debugging" is turned on. Then, again in the Develop menu, choose "Floating Info Windows", then "Show Hero Tags". Watch that list of tags for changes as you add and delete copies of your ability.

Remember, tags always have two elements - a group Id and the tag id, separated by a ".". So, it'll be GroupId.xIceArmor, not just xIceArmor by itself.
 
And this,

Second, I have created a User tag and applied it to certain custom abilities.
I want to count how many seperate Custom Abilities with that tag the user has taken.

For example, they have taken "Accelerate Movement," and "Knight's Puissiance." Both have the tag EvovleMind.

So I've tried hero.tagcount[User.EvolveMind] and nothing happens it returns a zero or one. I can test if the user has or does not have a Custom Ability with that tag but I cant seem to count the number they have.

Is what I am looking for even possible?
 
Option 1: add a script to these items so that they forward their tag to the hero. Then, your hero.tagcount will work.

Option 2: Use a foreach to search for all the items with that tag, and add to a count variable every time you find one.
 
I will continue my search on both of those solutions.

I haven't a clue how to do either of those things, perhaps the forums will reveal this to me.
 
Thank you very much my problem with Ice armor was solved with

Code:
tagcount[thingid.cDfKIceArm]

And the forward command worked for counting Custom Abilities

Code:
perform forward[User.EvolveMind]
 
Back
Top