mzscript - evaluation bug? Thread last updated on 2003-11-16 11:08:46

Posted by member 12798 on 2003-11-15 18:25:06

i have problems evaluating vars with mzscript in some cases, could not figure what this depends on, mzscript simply evaluates wrong, giving false when it should be true and vice versa.

i have tested this various times and "logged" vars into a file, from which i can truly tell it's not up to the script itself (eg no logical error)

to be more specific, i have several skinboxes that should behave like being in a box. if the mouse leaves this box, all skinboxes should be hidden. therefore, each skinbox calles a script on mouseout to evaluate mouse coords against box coords. that's where the problem occurs.

here's an example:

that's the script line:
*Script gotoif ("%{my}" >= "%{qly2}") l_NotOnQL


and for my=8 and qly2=64, this was evaluated true, although it is obviously false.

sometimes it works, sometimes not. very strange and annoying... anybody knows something about that?

Posted by member 37809 on 2003-11-15 19:16:11 link

It used to be that mzscript would compare them as strings instead of as integers, but the latest version is supposed to do comparisons smartly.

Maybe that's what !varint is supposed to enforce.

Posted by member 71746 on 2003-11-15 20:09:29 link

That's precisely what !varint is all about. Just throw this in:

*Script start !execute [!varint my] [!varint qly2]

In theory that should straighten things out.

Posted by member 12798 on 2003-11-16 11:08:46 link

thanks, i've tried it, and in most cases (not all, but enough) it works.