Wiki

Clone wiki

NuclearThroneTogether / Scripting / Mods / mod.gml

The "general" mod type in Nuclear Throne Together has .mod.gml extension.

Such mods are global (as opposed to executing on one or other occasion) and the following scripts will be called by the game if defined in them:

init

Executed when mutation mod is loaded. Load resources here.

game_start

Executed when game is starting. Reset any global variables here.

step

Executed at the start of the step event. This happens before any actual game code executes.

draw

Executed after most of the game is drawn but before UI is drawn. Use this to draw any overlays

draw_gui

Similarly executed just before built-in UI is to be drawn, but draws relative to view position. Use this for custom UI.

draw_gui_end

Executed after everything draws. This is a very "raw" hook and will even draw on top of sideart (if you specify negative/out-of-bounds) coordinates. Use this for any delightful hacks.

draw_dark_begin

On dark levels (TopCont.darkness equal to 1), this is executed before any lights are drawn. You can use this to override base darkness of the level.

draw_dark

On dark levels, this is executed after the wider (dimmer) ranges of lights are cut out, and before the narrower (brighter) ranges are to be cut out. You can draw custom lights here.

Ideally, you should draw dimmer ranges by simply changing drawing alpha to 0.5.

draw_dark_end

On dark levels, this is executed after everything is done drawing. Can be used to override brightness of the area on some condition.

draw_shadows

Executes after object shadows are done drawing. You can draw custom shadows here.

draw_bloom

Executes after default object' "bloom" effects are drawn. Drawing things here will make them "glow".

chat_command(command, parameter, player)

Can be used for custom chat commands. Should return true if the command was handled.

chat_message(message, player)

Executes for each non-command player message sent.

Additional events

See script binding.

Updated