Game Development Community

How to use schedule?

by CodingChris · in Torque Game Engine · 10/06/2007 (3:26 am) · 3 replies

Hi,
sorry for the silly question: How to use schedule?
I made this:
function nextTrack()
{
   %NumberOfTracks = redbookGetTrackCount();
   %TrackNumber = CD_TrackList.getSelectedID();
   $trackNumber = CD_TrackList.getSelectedID();

   if (%TrackNumber >= %NumberOfTracks)
      %TrackNumber = 0;

   CD_TrackList.setSelectedRow(%TrackNumber);

   redbookPlay(CD_TrackList.getSelectedID() - 1);
}
function musicman() 
{
if (!$CDPlaying)
   {
      nextTrack();
   }
   schedule(1000, "musicman");
}
I want the schedule function to wait one second and then run the musicman function. How to do this?

#1
10/06/2007 (8:49 am)
schedule(1000, 0, "musicman");

If you're interested I've posted a basic CD player resource: CD Player
#2
10/06/2007 (8:51 am)
That's the resource I'm using. I couldn't get the VMplayer working.
#3
10/06/2007 (9:01 am)
Tim, just a question: How to get if there is a song playing now?