Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   "Invalid use of a reserved word" in a script (http://forums.wolflair.com/showthread.php?t=59090)

Duggan August 31st, 2017 08:56 PM

"Invalid use of a reserved word" in a script
 
This is the code I'm using:
Quote:

<eval index="1" phase="PreTraits" priority="4900">
<before name="Calc trtFinal"/><![CDATA[
~build the candidate expression out of our Skill and Skills tags
var skills as string
skills = tagids[Skill.?, " | "]
var skilltypes as string
skilltypes = tagids[Skills.?, " | "]

var combined as string
if (tagis[Skills.?] <> 0) then
if (tagis[Skill.?] <> 0) then
combined = skills & " | " & skilltypes
else
combined = skills
endif
else
combined = skilltypes
endif

if (empty(combined) <> 0)
field[usrCandid1].text &= " & (" & combined & ")"
endif

perform field[usrChosen1].chosen.field[trtBG].modify[+,2,"Background"]
]]></eval>
It's giving me an error of

Quote:

Syntax error in 'eval' script for Thing 'fRPlusSkMx' (Eval Script '#1') on line 19
-> Invalid use of a reserved word in script
I've tried replacing "empty" with a check for the length of the string, but to little avail. Are these not the correct keywords for that function? If I comment out the "if" statement and the "endif", it works. I suppose that, if all else fails, I can rig up if statements with invoking tagis again to only do that check if either tag is present, but I'd prefer to avoid that.

Farling September 1st, 2017 12:29 AM

Perhaps adding the word "then" to the end of line 19 might help?

Duggan September 1st, 2017 03:23 AM

Quote:

Originally Posted by Farling (Post 255217)
Perhaps adding the word "then" to the end of line 19 might help?

:o That did it. Thank you. My C roots are showing.

RavenX September 1st, 2017 07:24 AM

Quote:

Originally Posted by Duggan (Post 255219)
:o That did it. Thank you. My C roots are showing.

Keep this one in mind, Duggan. Its happened to me enough that its one of the first things I look for now.


All times are GMT -8. The time now is 01:55 PM.

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