Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Games
  • Radical Entertainment
  • The Simpsons: Hit & Run
  • Scripting
  • Mission Objectives

buycar

This type of objective requires the player to purchase, summon, or enter a specific vehicle to pass the stage.

Examples

MFK
Lua

This example demonstrates the way Radical uses these stages, preceded by a locked stage with the required vehicle specified.

AddStage("locked", "car", "plowk_v");
	// Locked stages use INGAME_MESSAGE strings instead of MISSION_OBJECTIVE strings.
	// This would show INGAME_MESSAGE_00 after the objective is passed.
	SetStageMessageIndex(0);
	AddObjective("dialogue");
		// ...
	CloseObjective();
CloseStage();

AddStage();
	// The second argument to AddObjective() specifies the vehicle the player must have to pass the stage.
	// If the player starts the stage with this as their active vehicle, it will automatically pass.
	// Otherwise, they will have to purchase it or summon it from a phone booth.
	AddObjective("buycar", "plowk_v");
	CloseObjective();
CloseStage();

This example demonstrates a buycar objective being used without a locked stage before it. Despite Radical never using them in this manner, the objective still works as intended.

AddStage();
	// The second argument to AddObjective() specifies the vehicle the player must have to pass the stage.
	// If the player starts the stage with this as their active vehicle, it will automatically pass.
	// Otherwise, they will have to purchase it or summon it from a phone booth.
	AddObjective("buycar", "plowk_v");
	CloseObjective();
CloseStage();

This example demonstrates the way Radical uses these stages, preceded by a locked stage with the required vehicle specified.

Game.AddStage("locked", "car", "plowk_v")
	-- Locked stages use INGAME_MESSAGE strings instead of MISSION_OBJECTIVE strings.
	-- This would show INGAME_MESSAGE_00 after the objective is passed.
	Game.SetStageMessageIndex(0)
	Game.AddObjective("dialogue")
		-- ...
	Game.CloseObjective()
Game.CloseStage()

Game.AddStage()
	-- The second argument to AddObjective() specifies the vehicle the player must have to pass the stage.
	-- If the player starts the stage with this as their active vehicle, it will automatically pass.
	-- Otherwise, they will have to purchase it or summon it from a phone booth.
	Game.AddObjective("buycar", "plowk_v")
	Game.CloseObjective()
Game.CloseStage()

This example demonstrates a buycar objective being used without a locked stage before it. Despite Radical never using them in this manner, the objective still works as intended.

Game.AddStage()
	-- The second argument to AddObjective() specifies the vehicle the player must have to pass the stage.
	-- If the player starts the stage with this as their active vehicle, it will automatically pass.
	-- Otherwise, they will have to purchase it or summon it from a phone booth.
	Game.AddObjective("buycar", "plowk_v")
	Game.CloseObjective()
Game.CloseStage()