Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 345

Old February 21st, 2022, 10:44 AM
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?

I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff.
Illyahr is offline   #1 Reply With Quote
ploturo
Member
 
Join Date: May 2021
Posts: 48

Old February 21st, 2022, 08:23 PM
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.
ploturo is offline   #2 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,042

Old February 22nd, 2022, 07:38 AM
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.
Sendric is offline   #3 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 345

Old February 22nd, 2022, 09:15 AM
Quote:
Originally Posted by Sendric View Post
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.

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.
Illyahr is offline   #4 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:00 PM.


Powered by vBulletin® - Copyright ©2000 - 2022, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.