Schedule
by Temasek Polytechnic · in Torque Game Engine · 05/31/2006 (7:44 pm) · 2 replies
I want to add shedule to the do the following for an AIPlayer, but i dont know how.
In the AIPlayer::create function, i created the AIPlayer. This AIPlayer will then either run(controlled by a doRun function) or look around(control by a doLook function) after 5 seconds.
There is a chooseAction function that generates a random number between 0 and 1. If the number is 0, then it will execute the doRun function, else it will execute the doLook function.
Once the doRun or doLook function has completed executing, it will call the chooseAction function again after 5 seconds.
This means that every 5 seconds, the AIPlayer will either run to a location or look around.
How do i use the schedule for the above?
In the AIPlayer::create function, i created the AIPlayer. This AIPlayer will then either run(controlled by a doRun function) or look around(control by a doLook function) after 5 seconds.
There is a chooseAction function that generates a random number between 0 and 1. If the number is 0, then it will execute the doRun function, else it will execute the doLook function.
Once the doRun or doLook function has completed executing, it will call the chooseAction function again after 5 seconds.
This means that every 5 seconds, the AIPlayer will either run to a location or look around.
How do i use the schedule for the above?
About the author
Torque Owner Paul /*Wedge*/ DElia