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
  • Console Commands
  • MFK Commands
  • General
  • Dialogue

AddAmbientPcAnimation

Adds a conversation animation for the player character involved in the conversation.

Scope

This command should be called in a level's initialization script OR a mission's initialization script.

Syntax

MFK
Lua
AddAmbientPcAnimation( animation, [bonus_mission_name] );
Game.AddAmbientPcAnimation( animation, [bonus_mission_name] )
  • animation: The name of the animation to play as defined in the character's .cho file.
  • bonus_mission_name: The name of the bonus mission for which the animation is being registered.
    • This argument is only used for bonus missions and street races, valid arguments are bm1, sr1, sr2, and sr3.

Examples

Normal Mission

MFK
Lua
AddStage();
	AddObjective("dialogue");
		AddAmbientNpcAnimation("dialogue_shaking_fist");
		AddAmbientPcAnimation("dialogue_hands_in_air"); // Homer throws his hands in the air in defeat, not knowing why Marge is shaking her fist at him.
		SetDialogueInfo("homer", "marge", "shake", 0);
	CloseObjective();
CloseStage();
Game.AddStage()
	Game.AddObjective("dialogue")
		Game.AddAmbientNpcAnimation("dialogue_shaking_fist")
		Game.AddAmbientPcAnimation("dialogue_hands_in_air") -- Homer throws his hands in the air in defeat, not knowing why Marge is shaking her fist at him.
		Game.SetDialogueInfo("homer", "marge", "shake", 0)
	Game.CloseObjective()
Game.CloseStage()

Bonus Mission (leveli.mfk)

MFK
Lua
AddNPCCharacterBonusMission("milhouse", "npd", "sr1_mhouse_sd", "sr1", "checkered", "intro", 0, "checkeredfinish");
SetBonusMissionDialoguePos("sr1", "sr1_player", "sr1_mhouse_sd", "level1_carstart");

ClearAmbientAnimations(                        "sr1"); // Radical always include this.
AddAmbientNpcAnimation("dialogue_no",          "sr1");
AddAmbientPcAnimation("dialogue_shaking_fist", "sr1"); // Homer shakes his fist at Milhouse, continuing the cycle of aggression begun by Marge.
Game.AddNPCCharacterBonusMission("milhouse", "npd", "sr1_mhouse_sd", "sr1", "checkered", "intro", 0, "checkeredfinish")
Game.SetBonusMissionDialoguePos("sr1", "sr1_player", "sr1_mhouse_sd", "level1_carstart")

Game.ClearAmbientAnimations(                        "sr1") -- Radical always include this.
Game.AddAmbientNpcAnimation("dialogue_no",          "sr1")
Game.AddAmbientPcAnimation("dialogue_shaking_fist", "sr1") -- Homer shakes his fist at Milhouse, continuing the cycle of aggression begun by Marge.