Games > The Simpsons Hit & Run > Console File Commands > MFK Commands > Conditions > AddCondition

AddCondition

This command adds a condition for failing to a mission stage.

Context

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

Additionally, this should be followed by a call to CloseCondition.

Syntax

AddCondition( condition_type, [keepbarrel_fail_stage_count] );

AddCondition( condition_type, [keepbarrel_fail_stage_count] );

  • type: The type of condition to add.
  • keepbarrel_fail_stage_count: The number of stages to go back when failing a keepbarrel condition.

Examples

SelectMission("m1");
	...

	AddStage();
		SetStageTime(10);

		AddObjective("dummy");

		CloseObjective();

		// Fail the player if they take longer than 10 seconds on this stage
		AddCondition("timeout");

		CloseCondition();
	CloseStage();
CloseMission();

Game.SelectMission("m1")
	...

	Game.AddStage()
		Game.SetStageTime(10)

		Game.AddObjective("dummy")

		Game.CloseObjective()

		-- Fail the player if they take longer than 10 seconds on this stage
		Game.AddCondition("timeout")

		Game.CloseCondition()
	Game.CloseStage()
Game.CloseMission()

Notes

No additional notes.

Donut Team © 2024 · v4.0