|
Senior Member
Join Date: Feb 2013
Posts: 357
|
Ok, trying to create a thing that replaces an Initiator discipline with another. Got the thing that adds the new discipline but having trouble removing the selected discipline
Code:
var disc as string disc = hero.child[trBlkThrn].field[fChosen].chosen.tagids[AllowCust.?,"|"] disc = replace(disc, "AllowCust.", "thingid.x", 0) disc = disc & "Ft" field[ftCandExpr].text = "(" & disc & ")" var repl as string repl = field[fChosen].chosen.tagids[User.?] repl = replace(repl, "User", "AllowCust", 0) perform hero.child[trBlkThrn].field[fChosen].chosen.deletestr[disc] I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff. |
#1 |
Member
Join Date: May 2021
Posts: 84
|
Can there be multiple User.? tags on the pick you are working with (or none at all)?
The delete[] and deletestr[] target references expect a tag template with just one group.tag in it, potentially with a wildcard to allow matching similarly named tags. So if your tagids[User.?] ever returns a string with multiple tags or an empty string if there are no matching tags, using that string as the tag template for deletestr[] will result in the error you are seeing. If the tag has no wildcards and doesn't match an existing tag, you will get a different "Tag [...] not defined" error message. |
#2 |
Senior Member
Join Date: Jul 2010
Posts: 3,151
|
put in the line "debug disc" in your code. You can then see what it is by opening up floating debug window "Show Debug Output".
Also, I wonder if you intended to delete "repl" instead of "disc". I'm not sure you really need a second variable here, but from this code snippet you seem to be setting the variable repl but not using it. |
#3 |
Senior Member
Join Date: Feb 2013
Posts: 357
|
Quote:
Apparently, AllowCust also comes back with an invisible tag for its own thing. For example, a Warblade has AllowCust for each of its disciplines, but also for cWarblade naturally. It would pull that and get an invalid tag when processed. I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff. Last edited by Illyahr; February 22nd, 2022 at 09:18 AM. |
|
#4 |
Member
Join Date: Apr 2017
Posts: 73
|
Was this figured out? I was hoping to make the Vigilante variant for stalker that uses Int instead of Wis for Initiator discipline
|
#5 |
|
|