Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
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? |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
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. |
#2 |
Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
And this,
Quote:
|
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
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. |
#4 |
Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
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. |
#5 |
Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
Thank you very much my problem with Ice armor was solved with
Code:
tagcount[thingid.cDfKIceArm] Code:
perform forward[User.EvolveMind] |
#6 |
|
|