Games > The Simpsons Hit & Run > Console File Commands > MFK Commands > Stages > Timers > AddStageTime

AddStageTime

Context

This command should be called between calls to AddStage and CloseStage.

Syntax

AddStageTime( time_limit );

Game.AddStageTime( time_limit )

  • time_limit: The amount of time (in seconds) to add to the active stage timer.

Examples

SelectMission("m1");
	...
	AddStage();
	
		\\ Set the stage timer to 60 seconds here.
		SetStageTime(60);
		
		AddObjective("dummy");
		
		CloseObjective();
	
	CloseStage();
	
	AddStage();
	
		\\ Then add 30 seconds to the stage timer when reaching this stage.
		AddStageTime(30);
	
		AddObjective("dummy");
	
		CloseObjective();
	
	CloseStage();
	
CloseMission();

Game.SelectMission("m1")
	...
	Game.AddStage()
	
		-- Set the stage timer to 60 seconds here.
		Game.SetStageTime(60)
		
		Game.AddObjective("dummy")
		
		Game.CloseObjective()
	
	Game.CloseStage()
	
	Game.AddStage()
	
		-- Then add 30 seconds to the stage timer when reaching this stage.
		Game.AddStageTime(30)
	
		Game.AddObjective("dummy")
	
		Game.CloseObjective()
	
	Game.CloseStage()

Game.CloseMission()

Notes

  • It is recommended that you use a timeout condition with AddStageTime. However, this is not required; if the player runs out of time without a timeout condition, then the timer will simply disappear with no consequence.
  • If no active stage timer is present when reaching a stage that uses AddStageTime, then the game will treat the active stage timer as being 0 seconds.
  • If time_limit is set to 0, then the game will add 1 second to the active stage timer when reaching the next stage, provided that contains AddStageTime.
  • If time_limit is set to -1, then the game will not add any time to the active stage timer, and it will instead just carry over to the next stage, provided that contains AddStageTime.
Donut Team © 2024 · v4.0