Can I pause a schedule?
by Nicolai Dutka · in Torque Game Engine · 12/24/2007 (12:30 pm) · 3 replies
So basically, I need to be able to push a button that will open a menu and at the same time, completely pause everything that is going on around me. I have a real-time battle system going on with a $battleClock and multiple various people casting spells and different times and speeds (each one has their own $scheduleName).
So, I was thinking something along these pseudo-code lines:
//start the clock
$battleClock = schedule(1000,0,battleClock);
//player opens a menu
$battleClock.pause(true);
//player closes the menu
$battleClock.pause(false);
Does anyone know the ACTUAl code I would have to write for this?
So, I was thinking something along these pseudo-code lines:
//start the clock
$battleClock = schedule(1000,0,battleClock);
//player opens a menu
$battleClock.pause(true);
//player closes the menu
$battleClock.pause(false);
Does anyone know the ACTUAl code I would have to write for this?
#2
Player 1 wants to attack, player 2 casts cure, and player 3 casts fire.
When they click to cast, they really just "start counting" by 100's, 10 times per second, until they reach a number predetermined by me, THEN they can do their action. So if I want it to take 3 seconds to cast fire, Then when player 3 clicks to cast it, they start counting until they reach 3000, then they cast.
The kicker:
You can only count while my battle timer is running. The tick period on the battle timer is 100, so it updates 10 times per second (not a coincidence!) :P So when you push pause or open a menu, the battle timer stops, and thus, everyone stops counting. When the battle timer is turned back on, counting resumes.
The battle timer runs ALWAYS unless you are in designated areas, or you have a menu open or game is paused.
12/24/2007 (1:26 pm)
I just thought of something that will work. It doesn't require that I pause the schedules at all! I am going with a "real-time counter system".Player 1 wants to attack, player 2 casts cure, and player 3 casts fire.
When they click to cast, they really just "start counting" by 100's, 10 times per second, until they reach a number predetermined by me, THEN they can do their action. So if I want it to take 3 seconds to cast fire, Then when player 3 clicks to cast it, they start counting until they reach 3000, then they cast.
The kicker:
You can only count while my battle timer is running. The tick period on the battle timer is 100, so it updates 10 times per second (not a coincidence!) :P So when you push pause or open a menu, the battle timer stops, and thus, everyone stops counting. When the battle timer is turned back on, counting resumes.
The battle timer runs ALWAYS unless you are in designated areas, or you have a menu open or game is paused.
#3
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12409
12/25/2007 (11:34 pm)
Could check into thiswww.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12409
Torque Owner Dracola
I used this page
http://tdn.garagegames.com/wiki/TorqueScript_Console_Functions_10