[Torque 3D Bug]: Function Local Variables Holding Values before being used.
by JesseL · in Torque 3D Professional · 07/15/2009 (9:38 am) · 2 replies
Try it for yourself:
function editCollada()
{
%p = thisIsntReal();
echo(%p);
}
Whenever I run this function it produces the word Game the first time and nothing the second and every time after that. A leak?
When I just open up console in the FPS genere pack and put in
function editT(){ %p = thisIsntReal(); echo(%p); } then it produced the word Try.
function editCollada()
{
%p = thisIsntReal();
echo(%p);
}
Whenever I run this function it produces the word Game the first time and nothing the second and every time after that. A leak?
When I just open up console in the FPS genere pack and put in
function editT(){ %p = thisIsntReal(); echo(%p); } then it produced the word Try.
About the author
I just realized that if I wanted to create a cat that caught on fire and ran up a telephone pole and then burst into a blue waterfall. That wouldn't be to hard!
#2
07/24/2009 (3:00 am)
The reason I ran into this issue is because I created a function that was to return a value for processing. Well I misspelt the function by one letter. It returned a value allright or rather the system grabbed whatever happened to be on the top of the string stack as you stated it. It caused me quite a bit of grief because it was actually returning something that the value could be.
Associate James Ford
Sickhead Games
It's probably grabbing whatever happens to be on the top of the string stack. If you need to check if a function exists before calling it you can verify that with isFunction() but yeah it should probably return an empty string.