Jump to content

Parse error related to the "^" symbol when assigning script


Recommended Posts

I'm using A^ as my modder prefix but encounter a problem when trying to assign a creature a script prefixed A^ with Weidu. I tried giving a "general" script to an umber hulk:




This invariably fails, renaming the script to A_UMBER1 and altering the TP2 as follows fixed the problem.




The problem is specifically with the "^" character, and not for every purpose either. A script named A^XYZ.baf will still compile, and a creature copied to override with A^XYZ referenced as it's script will work fine in that case, this problem only appears when trying to patch a creature's scripts with Weidu.


Can anyone comment on this bug?

Link to comment

(i) ^ is one of the special characters used by WEIDU regexps.

(ii) ^ is the string concatenation operator, so a^umber means "the string obtained by concatenating the value of variable a and variable umber. (Since neither are defined, WEIDU chokes.)


It doesn't sound like these are bugs, just features of how ^ works. With care (and assiduous use of quotation marks) you could work around it, but honestly, don't bother. Pick another prefix.

Link to comment

Polytope, you are in the same boat as anyone who picked a prefix starting with something other than an alphanumerical. You can't use your prefix as a bareword, but have to enclose it in string delimiters because WeiDU can't automatically infer that it's a string.


Link to comment


This topic is now archived and is closed to further replies.

  • Create New...