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
  • Level Load
  • Gags

GagSetPosition

Sets the position of a gag in a level.

Scope

This command should be called between calls to GagBegin and GagEnd in a level's load script.

Syntax

Using a Locator (1 Argument)

MFK
Lua
GagSetPosition( locator_name );
Game.GagSetPosition( locator_name )
  • locator_name: The name of a locator.

Using a Position (3 Arguments)

MFK
Lua
GagSetPosition( x, y, z );
Game.GagSetPosition( x, y, z )
  • x: The X position.
  • y: The Y position.
  • z: The Z position.

Examples

Using a Locator (1 Argument)

MFK
Lua
GagBegin("gag_sqsh.p3d");
	// ...
	GagSetPosition("Squish");
	// ...
GagEnd();
Game.GagBegin("gag_sqsh.p3d")
	-- ...
	Game.GagSetPosition("Squish")
	-- ...
Game.GagEnd()

Using a Position (3 Arguments)

MFK
Lua
GagBegin("gag_bbq.p3d");
	// ...
	GagSetPosition(10, 10, 10);
	// ...
GagEnd();
Game.GagBegin("gag_bbq.p3d")
	-- ...
	Game.GagSetPosition(10, 10, 10)
	-- ...
Game.GagEnd()

Notes

If the gag is added to an interior via GagSetInterior, a locator must be used or the gag's position will be ignored and set to the position of the interior's InteriorOrigin locator.