• 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

If then statement Eval error

Tekkmage

Well-known member
I am attempting to create an eval script that checks if a calculation is less than one. The calculation is correct without the if then else in it.
The compiler keeps giving me an error is missing a ( on line 7 or an error reserved field is used. Anyone know what I have wrong?

Code:
~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

var Evaluses as number

Evaluses = hero.child[aWIS].field[aModBonus].value + field[xAllLev].value
if 
(Evaluses<1)
then 
field[trkMax].value += 1
else
field[trkMax].value += Evaluses
end if
 
The scripting language is line-based, so you can't split up statements across multiple lines (as you can in C++ and other such languages). Also, the "endif" statement is all one symbol, without a space. Try the following instead:

Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] = 0)

var Evaluses as number
Evaluses = hero.child[aWIS].field[aModBonus].value + field[xAllLev].value
if (Evaluses<1) then 
    field[trkMax].value += 1
else
    field[trkMax].value += Evaluses
    endif
 
Back
Top