This conditional command returns whether or not the current stage is being resumed from a checkpoint.
Scope
This command should be called between calls to AddStage and CloseStage in a mission's initialisation script.
Additionally, this must be called after CHECKPOINT_HERE in the stage.
Syntax
IfCurrentCheckpoint()
{
}Game.IfCurrentCheckpoint()
Game.EndIf()Examples
AddStage();
SetStageTime(40);
AddObjective("dummy");
CloseObjective();
CloseStage();
AddStage();
CHECKPOINT_HERE();
!IfCurrentCheckpoint()
{
// Don't add any time when reaching this stage from the previous one.
// Due to Radical programming AddStageTime() in an odd way, -1 adds no time and 0 adds one second.
AddStageTime(-1);
}
IfCurrentCheckpoint()
{
// Set the time to 20 seconds when resuming from a checkpoint.
SetStageTime(20);
}
AddObjective("dummy");
CloseObjective();
AddCondition("timeout")
CloseCondition();
CloseStage();Game.AddStage()
Game.SetStageTime(40)
Game.AddObjective("dummy")
Game.CloseObjective()
Game.CloseStage()
Game.AddStage()
Game.CHECKPOINT_HERE()
Game.Not()
Game.IfCurrentCheckpoint() -- Alternatively, you can omit the line with Game.Not() and use Game.Not_IfCurrentCheckpoint() here instead.
-- Don't add any time when reaching this stage from the previous one.
-- Due to Radical programming AddStageTime() in an odd way, -1 adds no time and 0 adds one second.
Game.AddStageTime(-1)
Game.EndIf()
Game.IfCurrentCheckpoint()
{
-- Set the time to 20 seconds when resuming from a checkpoint.
Game.SetStageTime(20)
}
Game.AddObjective("dummy")
Game.CloseObjective()
Game.AddCondition("timeout")
Game.CloseCondition()
Game.CloseStage()Notes
Due to the nature of how console scripts work in the game, all conditional commands are evaluated at the time the script is executed. This unfortunately limits the utility of many of these types of commands, but we believe they still have some use cases even with this limitation.