• 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

Help with a code

Illyahr

Well-known member
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]

Top half is working but I get a tag syntax error with the bottom half. Any ideas?
 
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.
 
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.
 
Also, I wonder if you intended to delete "repl" instead of "disc". I'by opening up floating debug window "Show Debug Output".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.

Oops lol

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.
 
Last edited:
Was this figured out? I was hoping to make the Vigilante variant for stalker that uses Int instead of Wis for Initiator discipline
 
Back
Top