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

LoadP3DFile

Loads a P3D file in a level or a mission.

Scope

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

Syntax

MFK
Lua
LoadP3DFile( file_path, heap_name, section_name );
Game.LoadP3DFile( file_path, heap_name, section_name )
  • file_path: The path to the P3D file to load.
    • The following 6 paths are ignored since the game preloads them at startup:
      • art\phonecamera.p3d
      • art\cards.p3d
      • art\wrench.p3d
      • art\missions\generic\missgen.p3d
      • art\cars\common.p3d
      • art\cars\huskA.p3d
  • heap_name: Set the memory allocator to use for this P3D file.
    • Supported heaps for this argument are:
      • GMA_DEFAULT
      • GMA_TEMP
      • GMA_GC_VMM
        • Only on GameCube.
      • GMA_PERSISTENT
      • GMA_LEVEL
      • GMA_LEVEL_MOVIE
      • GMA_LEVEL_FE
      • GMA_LEVEL_ZONE
      • GMA_LEVEL_OTHER
        • This is the only heap Radical explicitly uses with this command, for each level's FX file (art\l01_fx.p3d, etc.).
      • GMA_LEVEL_HUD
      • GMA_LEVEL_MISSION
        • GMA_LEVEL_AUDIO
      • GMA_DEBUG
      • GMA_SPECIAL
      • GMA_XBOX_SOUND_MEMORY
        • Only on Xbox.
    • Defaults to GMA_LEVEL_MISSION.
  • section_name: TODO.

Examples

MFK
Lua
// Load the level's locators.
LoadP3DFile("art\missions\level01\level.p3d");

// Load the Level's FX file into GMA_LEVEL_OTHER
LoadP3DFile("art\l01_fx.p3d", "GMA_LEVEL_OTHER");

// Will be ignored.
LoadP3DFile("art\cars\huskA.p3d");
-- Load the level's locators.
Game.LoadP3DFile("art\\missions\\level01\\level.p3d")

-- Load the Level's FX file into GMA_LEVEL_OTHER
Game.LoadP3DFile("art\\l01_fx.p3d", "GMA_LEVEL_OTHER")

-- Will be ignored.
Game.LoadP3DFile("art\\cars\\huskA.p3d")