%this gets lost
by Kevin James · in Torque Game Builder · 05/06/2010 (6:09 am) · 3 replies
Sometimes in the onUpdate callback, %this loses its reference.
For example,
The work around is to use a global variable but its not ideal. Is this a known issue or is it just me?
For example,
function npcship::fireMissile(%this)
{
//snip
%this.schedule(%this.fireDelay(), "fireMissile");
}
function npcship::fireDelay()
{
//%this gets lost here for some reason - can't use ship.firerate
%rate =$player.fireRate * 1000;
}The work around is to use a global variable but its not ideal. Is this a known issue or is it just me?
About the author
Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/
Torque Owner Kevin James