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

talkto

This type of objective requires the player to interact with an NPC with an exclamation mark overhead to pass the stage.

Examples

MFK
Lua
// The player must talk to Marge to pass the objective.
AddObjective("talkto");
	AddNPC("marge", "m1_marge_sd"); // Places Marge at the Type 3 Locator named "m1_marge_sd".
	AddObjectiveNPCWaypoint( "marge", "marge_walk_1" ); // Sets a Type 3 Locator for the NPC to walk towards.
	SetTalkToTarget("marge", 0, 0.2);
	// The first argument is the drawable used:
	// - 0 is the standard exclamation mark
	// - 1 is a drawable named "gift"
	// - 2 is a drawable named "interior_icon"
	// The second argument is a height offset.
CloseObjective();
-- The player must talk to Marge to pass the objective.
Game.AddObjective("talkto")
	Game.AddNPC("marge", "m1_marge_sd") -- Places Marge at the Type 3 Locator named "m1_marge_sd".
	Game.AddObjectiveNPCWaypoint( "marge", "marge_walk_1" ) -- Sets a Type 3 Locator for the NPC to walk towards.
	Game.SetTalkToTarget("marge", 0, 0.2)
	-- The first argument is the drawable used:
	-- - 0 is the standard exclamation mark
	-- - 1 is a drawable named "gift"
	-- - 2 is a drawable named "interior_icon"
	-- The second argument is a height offset.
Game.CloseObjective()

Notes

  • Radical generally uses these stages before dialogue stages, but the dialogue stage isn't strictly necessary.
  • The NPC will walk back and forth between the Locators specified in AddObjectiveNPCWaypoint and AddNPC provided the player character is far enough away.
    • When the player character gets close, NPCs will stop and look in the player's direction.
    • If more than one call to AddObjectiveNPCWaypoint is present, the NPC will walk through the Locators in sequence before returning to the Locator specified in AddNPC.
  • The extra values in SetTalkToTarget default to zero, meaning they are not strictly required.
    • Radical offsets the icon with certain characters for aesthetic purposes.