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

AddStage

This command adds a stage to a mission.

Context

This command should be called between calls to SelectMission and CloseMission.

Additionally, this command should be followed by an objective and a call to CloseStage.

Syntax

Regular Stage

AddStage();

Game.AddStage();

Final Stage

AddStage("final");

Game.AddStage("final");

Giving this command "final" as its first argument marks a stage as being the final stage of the mission.

This indicates to the game that it should show "Mission Complete!" on the screen when the mission ends and, for most missions, marks it as complete in your save data.

There should be no subsequent stages after such a stage.

Locked Stage

AddStage("locked", type, name);

Game.AddStage("locked", type, name)

Giving this command "locked" as its first argument allows you to show a prompt the stage ends if the player's current car or skin does not match the one specified by the following parameters:

  • type: Set to "car" or "skin" depending on what you'd like to check for in the mission.
  • name: The name of a car or skin that the player must have to avoid the prompt.

These types of stages typically use dialogue objectives so the prompt is shown after an NPC explains why you need a specific car or skin but this is not a requirement.

The message shown in this prompt is determined by SetStageMessageIndex.

These types of stages are also typically coupled with a buycar objective or a buyskin objective that require the player to buy the given car or skin on the next stage but this is also not a requirement.

Regardless, you must have at least one subsequent stage of any type following a locked stage for its message to appear.

Examples

Regular Stage

SelectMission("m1sd");
	...

	// Simple timer stage as the final stage in a Sunday Drive mission
	// Do not use final in these missions!
	AddStage();
		AddObjective("timer");
			SetDurationTime(1);
		CloseObjective();
	CloseStage();
CloseMission();

Game.SelectMission("m1sd")
	...

	-- Simple timer stage as the final stage in a Sunday Drive mission
	-- Do not use final in these missions!
	Game.AddStage()
		Game.AddObjective("timer")
			Game.SetDurationTime(1)
		Game.CloseObjective()
	Game.CloseStage()
Game.CloseMission()

Final Stage

SelectMission("m1");
	...

	// Simple timer stage as the final stage in a story mission
	// Will show "Mission Complete!" when it ends
	AddStage();
		AddObjective("timer");
			SetDurationTime(1);
		CloseObjective();
	CloseStage();

	// Do not have stages after a final stage!

CloseMission();

Game.SelectMission("m1")
	...

	-- Simple timer stage as the final stage in a story mission
	-- Will show "Mission Complete!" when it ends
	Game.AddStage("final")
		Game.AddObjective("timer")
			Game.SetDurationTime(1)
		Game.CloseObjective()
	Game.CloseStage()

	-- Do not have stages after a final stage!

Game.CloseMission()

Locked Stage

SelectMission("m3sd");
	...

	AddStage("locked","car","plowk_v");
		// Show INGAME_MESSAGE_00 in GenericPrompt.pag in ingame.p3d
		// After the dialogue if the player does not have the Plow King (plowk_v).
		SetStageMessageIndex(0);

		AddObjective("dialogue");
			...
		CloseObjective();
	CloseStage();

	// As mentioned above, this specific type of objective (buycar) is NOT required
	// in the subsequent stage but a subsequent stage in general IS required.
	AddStage(0);
		SetHUDIcon("barne");
		SetStageMessageIndex(239);

		AddObjective("buycar", "plowk_v");
		CloseObjective();
	CloseStage();
CloseMission();

Game.SelectMission("m3sd")
	...

	Game.AddStage("locked","car","plowk_v")
		-- Show INGAME_MESSAGE_00 in GenericPrompt.pag in ingame.p3d
		-- After the dialogue if the player does not have the Plow King (plowk_v).
		Game.SetStageMessageIndex(0)

		Game.AddObjective("dialogue")
			...
		Game.CloseObjective()
	Game.CloseStage()

	-- As mentioned above, this specific type of objective (buycar) is NOT required
	-- in the subsequent stage but a subsequent stage in general IS required.
	Game.AddStage(0)
		Game.SetHUDIcon("barne")
		Game.SetStageMessageIndex(239)

		Game.AddObjective("buycar", "plowk_v")
		Game.CloseObjective()
	Game.CloseStage()
Game.CloseMission()

Notes

Radical often gives numbers as arguments to this command in many of their scripts. These are meaningless and do nothing.

Donut Team © 2024 · v4.0