View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old October 13th, 2011, 06:07 PM
A helpful thing when you have a lot of tests is to use indentations to make everything clearer.

if
else
elseif

are not indented, but the things within them are indented some amount (we use 2 spaces for each indent for our own code in Hero Lab).

So:

Code:
if (hero.tagis[Helper.Quadruped] <> 0) then
 
  if (herofield[tSize].value >= 4) then
    newmaxwt *= 24
 
  elseif (herofield[tSize].value >= 3) then
    newmaxwt *= 12
When there's lots of if statements, that's useful to me in tracking where one ends and the next begins.
Mathias is offline   #17 Reply With Quote