Game Development Community

Schedule 'ing commandToClients don't work..

by Lateral Punk · in Torque Game Engine · 10/29/2004 (10:50 am) · 1 replies

Well at least the object form doesn't work:
%this.client.schedule(1,"commandToClient",%this.client,'SetTaskName', "OUT OF FLY ZONE!");

but this works:
schedule(1,0,"commandToClient",%this.client,'SetTaskName', "OUT OF FLY ZONE!");

ideally i want to use the first approach because i like the object form better (cleanup and all). Can someone tell me what i'm doing wrong?

thanks

#1
10/29/2004 (11:18 am)
%this.client.schedule(1,"commandToClient",%this.client,'SetTaskName', "OUT OF FLY ZONE!");

is not working because the engine interprets the command as...

GameConnection::commandToClient(%client, %this.client, 'SetTaskName', "OUT OF FLY ZONE!")


to get what you want, you need a new function like....

GameConnection::processCommand(%client, %task, %text)
(
    commandToClient(%client, %task, %text);
}


Which you would call using...

%this.client.schedule(1, "processCommand", 'SetTaskName', "OUT OF FLY ZONE!")


EDIT:

If you are worried about object cleanup with the other, then use the other correctly...


schedule(1, %this, "commandToClient", %this.client, 'SetTaskName', "OUT OF FLY ZONE!");