Game Development Community

Event scheduling: function to see which object event is associated with?

by Ricky Hopper · in Torque Game Builder · 03/21/2010 (9:47 am) · 2 replies

If you have saved an event ID, is there a way to see which object that event refers to in script? This would really help with my current project.

#1
03/21/2010 (2:38 pm)
I don't think so, the best thing to do would be to save the object and event id in an array.

%ThisEvent = Schedule(...);

$EventList[%ThisEvent] = %ThatObject;

It's not ideal but it means you can grab an object based on the schedule event id.
#2
03/22/2010 (3:34 am)
If you use:

%this.schedule(1000, "Function");

The event is scheduled for what ever %this is. Than you can save the schedule like this.

%this.event = %this.schedule(1000, "Function");

This will allow you to stop an event if you need too.

cancel(%this.event);

check this page: http://tdn.garagegames.com/wiki/TorqueScript_Console_Functions_10