Odd scripting behaviour
by Keegan Gibson · in iTorque 2D · 09/28/2010 (12:29 am) · 1 replies
Hey all, I have a problem with my code.
When I call a function three times in a row, the first time works great, but
the other times %getsSetToNull is set to null(or ""). it ONLY happens with
%getsSetToNull, the other arguments are fine. Any reason why this is
happening?
Testing on WinXP.
function OtherFunction()
{
%e = GETSOMETHING()
SomeFunc(%e, 2, 4, true);
SomeFunc(%e, 3, 4, true);
SomeFunc(%e, 1, 2, false);
}
function SomeFunc(%e, %f, %getsSetToNull, %keepOn)
{
echo(%getsSetToNull);
//%getsSetToNull is null the second+ times
//Do stuff
}
Output:
%4
%
%
When I call a function three times in a row, the first time works great, but
the other times %getsSetToNull is set to null(or ""). it ONLY happens with
%getsSetToNull, the other arguments are fine. Any reason why this is
happening?
Testing on WinXP.
function OtherFunction()
{
%e = GETSOMETHING()
SomeFunc(%e, 2, 4, true);
SomeFunc(%e, 3, 4, true);
SomeFunc(%e, 1, 2, false);
}
function SomeFunc(%e, %f, %getsSetToNull, %keepOn)
{
echo(%getsSetToNull);
//%getsSetToNull is null the second+ times
//Do stuff
}
Output:
%4
%
%
About the author
Torque 3D Owner Brian Szatkowski
Right now, your code is setting %e to: