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
  • Modding Tools
  • Lucas' Simpsons Hit & Run Mod Launcher
  • Hacks
  • Mod Requirable Hacks
  • Custom Files

Path Handler Scripts

Path Handler scripts are defined in the CustomFiles.ini configuration file.

These scripts get executed when the file or files (when using wildcards) are requested to load by the game.

These scripts can either redirect the file to a different path altogether or create a new file on the fly using the Output or UseCallbacks. This has a number of applications including but not limited to dynamically creating mission scripts with random elements or elements based on mod settings.

Example

This is an example PathHandler definition and the script for it from Donut Mod 4.

[PathHandlers]
art\\frontend\\scrooby\\resource\\pure3d\\homer.p3d=Resources/scripts/handlers/mainmenuskins.lua

When homer.p3d is requested, the script redirects it to one of the files in the MainMenuSkins at random.

-- Table of main menu skin paths.
MainMenuSkins =
{
	GetModPath() .. "/Resources/art/mainmenuskins/h_work.p3d",
	GetModPath() .. "/Resources/art/mainmenuskins/h_pieman.p3d",
	GetModPath() .. "/Resources/art/mainmenuskins/h_sshield.p3d",
}

-- Redirect to one of them at random.
Redirect(MainMenuSkins[math.random(1, #MainMenuSkins)])