Contents

Declaring freeslot names

Names for new resources are declared in Lua using the freeslot() function:

freeslot("MT_CUSTOMTYPE","S_CUSTOMSTATE","SPR_CUST","sfx_newsnd")

This is limited to new Object types (MT_), states (S_), sprites (SPR_) or sounds (sfx_).

Line breaks can be used after commas to separate out the names of new resources, if many are being declared at once:

freeslot("MT_CUSTOMTYPE","S_CUSTOMSTATE","SPR_CUST","sfx_newsnd")

Defining infotables

This section covers creating whole infotable entries from scratch (as opposed to changing a single property, which doesn't affect the rest of the table). This can only be done with mobjinfo[], states[] and S_sfx[] (or sfxinfo[]).

Not all of the parameters for the longhand version are necessarily needed (doomednum defaults to -1, spawnhealth defaults to 1, everything else defaults to 0). However, for the shorthand version none should be missed out. In general the longhand version is favoured of the two.

As with Object types, not all of the parameters for the longhand version of states are necessarily needed (tics defaults to -1, everything else defaults to 0). Shorthand version is generally favoured despite this (for no action to be used in the state, use "nil" in place of an action name).

Custom sounds

S_sfx[sfx_newsnd]={singular=false,priority=255,flags=0}

shorthand version:

S_sfx[sfx_newsnd]={false,255,0}

formatted in a single line:

S_sfx[sfx_newsnd]={false,255,0}

singular will default to false, and priority and flags will default to 0. sfxinfo works as an alternative name for S_sfx. Note that "name" and "skinsound" of sfxinfo_t are read-only, so cannot be set by this.