AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
AERModDef Struct Reference

Definition of a mod. More...

#include <mod.h>

Public Attributes

void(* constructor )(void)
 Callback function which constructs a mod. More...
 
void(* destructor )(void)
 Callback function which destructs a mod. More...
 
void(* registerSprites )(void)
 Callback function which registers a mod's sprites. More...
 
void(* registerObjects )(void)
 Callback function which registers a mod's objects. More...
 
void(* registerObjectListeners )(void)
 Callback function which registers a mod's object event listeners. More...
 
void(* gameStepListener )(void)
 Mod's game step pseudo-event listener. More...
 
void(* gamePauseListener )(bool paused)
 Mod's game pause pseudo-event listener. More...
 
void(* roomChangeListener )(int32_t newRoomIdx, int32_t prevRoomIdx)
 This member is a deprecated alias for AERModDef::roomStartListener. More...
 
void(* registerFonts )(void)
 Callback function which registers a mod's fonts. More...
 
void(* gameSaveListener )(int32_t curSlotIdx)
 Mod's game save pseudo-event listener. More...
 
void(* gameLoadListener )(int32_t curSlotIdx)
 Mod's game load pseudo-event listener. More...
 
void(* roomStartListener )(int32_t newRoomIdx, int32_t prevRoomIdx)
 Mod's room-start pseudo-event listener. More...
 
void(* roomEndListener )(int32_t newRoomIdx, int32_t prevRoomIdx)
 Mod's room-end pseudo-event listener. More...
 

Detailed Description

Definition of a mod.

Warning
As new features get added to the framework, this struct may receive new fields corresponding to those features without resulting in a new major version number. However, field ordering is guaranteed to remain the same for all releases with the same major version number. To ensure forward API compatability, only work with pointers to this struct.
Since
1.0.0

Member Data Documentation

◆ constructor

constructor

Callback function which constructs a mod.

Note
Prefer using this over __attribute__((constructor)).
May be NULL if mod does not need construction.
Since
1.0.0

◆ destructor

destructor

Callback function which destructs a mod.

Note
Prefer using this over __attribute__((destructor)).
May be NULL if mod does not need destruction.
Since
1.0.0

◆ gameLoadListener

gameLoadListener

Mod's game load pseudo-event listener.

If provided and the game data gets loaded, the MRE will call this function immediately after the game reads and parses data from the savefile but immediately before that gets applied to any in-game state.

This means that any calls to the functions in save.h from within this listener will be saved at the next save point. However, this also means that any changes made to vanilla state (i.e. changing the number of gearbits that the player has) will be overwritten and will not be saved at the next save point.

Note
The functions in save.h can be called from anywhere within a mod, not just from within this listener.
May be NULL.
Parameters
[in]curSlotIdxIndex of save slot from which the game is loading data.
Since
1.2.0
See also
save.h

◆ gamePauseListener

gamePauseListener

Mod's game pause pseudo-event listener.

If provided and the game is paused or unpaused, the MRE will call this function at the very start of the first step of the new pause state (immediately before calling gameStepListener).

This event does not exist in the GameMaker engine; the MRE provides it as a convenience to mod developers.

Note
May be NULL.
Parameters
[in]pausedWhether game was paused (true) or unpaused (false).
Since
1.0.0
See also
AERGetPaused

◆ gameSaveListener

gameSaveListener

Mod's game save pseudo-event listener.

If provided and the game data gets saved, the MRE will call this function immediately after the game has finalized its vanilla save data but immediately before that data has been written to the savefile.

This means that any calls to the functions in save.h from within this listener will make it into the savefile. However, this also means that any changes made to vanilla state (i.e. changing the number of gearbits that the player has) will not make it into the savefile.

Note
The functions in save.h can be called from anywhere within a mod, not just from within this listener.
May be NULL.
Parameters
[in]curSlotIdxIndex of save slot to which the game is saving data.
Since
1.2.0
See also
save.h

◆ gameStepListener

gameStepListener

Mod's game step pseudo-event listener.

This is effectively the global "tick" function of a mod. If provided, the MRE will unconditionally call it at the very start of every in-game step (before any object event listeners are called, including pre-step listeners).

This event does not exist in the GameMaker engine; the MRE provides it as a convenience to mod developers.

Note
May be NULL.
Since
1.0.0

◆ registerFonts

registerFonts

Callback function which registers a mod's fonts.

Note
May be NULL if mod does not register any fonts.
Since
1.1.0
See also
AERFontRegister

◆ registerObjectListeners

◆ registerObjects

registerObjects

Callback function which registers a mod's objects.

Note
May be NULL if mod does not register any objects.
Since
1.0.0
See also
AERObjectRegister

◆ registerSprites

registerSprites

Callback function which registers a mod's sprites.

Note
May be NULL if mod does not register/replace any sprites.
Since
1.0.0
See also
AERSpriteRegister
AERSpriteReplace

◆ roomChangeListener

roomChangeListener

This member is a deprecated alias for AERModDef::roomStartListener.

Deprecated:
Since 1.5.0. Use AERModDef::roomStartListener instead.
Since
1.0.0
See also
AERModDef::roomStartListener
AERModDef::roomEndListener

◆ roomEndListener

roomEndListener

Mod's room-end pseudo-event listener.

If provided and the game switches to a new room, the MRE will call this function immediately before the new room is the current room but immediately after all object room-end listeners have been called.

Note
This function is also called when the current room is reset and when the game ends.
May be NULL.
Parameters
[in]newRoomIdxIndex of new room that is about to be switched to.
[in]prevRoomIdxIndex of current room that is about to be switched away from.
Since
1.5.0
See also
AERModDef::roomStartListener
AERObjectAttachRoomEndListener

◆ roomStartListener

roomStartListener

Mod's room-start pseudo-event listener.

If provided and the game switches to a new room, the MRE will call this function once the new room is the current room, immediately before all object room-start listeners have been called.

Note
This function is also called when the current room is reset.
May be NULL.
Parameters
[in]newRoomIdxIndex of current, new room that was just switched to.
[in]prevRoomIdxIndex of previous room that was switched away from.
Since
1.5.0
See also
AERModDef::roomEndListener
AERObjectAttachRoomStartListener

The documentation for this struct was generated from the following file: