Page 1 of 1

Old code running?

Posted: Mon May 01, 2006 8:44 pm
by Tesh
Ok, I'm a relative n00b to NWScript but this has got me stumped.

I've got some code that looks at a character and attempts to apply a hide based on the racial type of the PC.

Program Flow is something like this:

onEnterScript -> applyRacialHideScript

Now the code came with some helpful debug statements (w00t!) I just had to switch the debug variable to be TRUE. When I attempted to compile the script the compiler complained that there was no main(), did I want to compile as a conditional scripts, which it couldn't do due to missing a function, so I inserted an empty main() to fool the compiler. This done I started to see the info I needed :)

Now I was getting puzzled by some of the behaviour so I went back and inserted a few more DEBUG statements to see what was going on a bit better. The script compiled sweet as :) However the new DEBUG statements did not show up when I ran the module :|

Anybody got any ideas as to what is going on here? I even tried rebooting my machine to see if it had cached old compiled versions of the scripts :|

Re: Old code running?

Posted: Mon May 01, 2006 9:46 pm
by Bruno Knotslinger
Tesh wrote:Ok, I'm a relative n00b to NWScript but this has got me stumped.

I've got some code that looks at a character and attempts to apply a hide based on the racial type of the PC.

Program Flow is something like this:

onEnterScript -> applyRacialHideScript

Now the code came with some helpful debug statements (w00t!) I just had to switch the debug variable to be TRUE. When I attempted to compile the script the compiler complained that there was no main(), did I want to compile as a conditional scripts, which it couldn't do due to missing a function, so I inserted an empty main() to fool the compiler. This done I started to see the info I needed :)

Now I was getting puzzled by some of the behaviour so I went back and inserted a few more DEBUG statements to see what was going on a bit better. The script compiled sweet as :) However the new DEBUG statements did not show up when I ran the module :|

Anybody got any ideas as to what is going on here? I even tried rebooting my machine to see if it had cached old compiled versions of the scripts :|
Is this an include by some chance? Includes aren't compiled by themselves. They are compiled when the script that includes them is compiled. As such, changes to includes won't show up until the script that includes it is compiled. (The easiest way to be sure you got all of them is to do a build... just check to compile scripts otherwise you'll be waiting a while for a large mod.)

Posted: Mon May 01, 2006 9:53 pm
by Tesh
Ahhhh, yeah, it's an include script.

Thanks heaps, hopfully I'll have some shapechanging Lycanthropes tonight now :D