Documentation - RighteousRyan1/TanksRebirth GitHub Wiki
Types
Classes, structs, etc.
TanksMod
IMPLEMENTS: ILoadable
string Name: The display name of this mod. Generally named the internal name, but split by PascalCase.
string InternalName: The internal name of this mod. This is the name of the project the mod was built in.
void OnLoad(): This method is called when your mod is loaded. Use this method to initialize hooking, add things to your mod, load content, etc.
void OnUnload(): This method is called when your mod is unloaded. BE SURE to remove hooking, unsubscribe events, unload assets, and everything else that may remain in memory otherwise when your mod unloads, unused memory may remain.
T ImportAsset<T>(): Used to import your own custom asset. Textures can be loaded as PNG, JPG, GIF (only first frame!), TIF, BMP, and DDS. Models (.fbx) and Shaders (.fx) are loaded as compiled MonoGame assets (.xnb) (until and only if I make a way for raw importation of models, such as glTF, FBX, OBJ, etc.). Audio can be imported from WAVE format (.wav) if using this method, and Ogg Vorbis (.ogg) if using the constructor of OggSound. Fonts can be loaded via the respective font library included in the game, FontStashSharp.
ModLoader
const string ModNETVersion: The .NET version being used via the game, and thus will be necessary to let the game compile your mod.
string ModsPath: The path to where the game expects mods to be in order to load them. Can be particularly useful for loading assets.
LoadStatus Status: The current status of the mod loader. This can be Inactive, Unloading, Loading, Compiling, Sandboxing, or Complete.
Events
Subscribe your methods to these for full effect!
ModLoader
OnFinishModLoading(): Invoked when all mods are finished loading.
OnModPostLoad(TanksMod mod): Invoked when a mod is loaded. Said mod is also passed into this event.
AITank
PostExecuteAI(Tank): Invoked after the AI of a given AITank is ran.
Block
OnPostUpdate(Block): Invoked after a given Block is updated.
OnPostRender(Block): Invoked after a given Block is rendered.
OnInitialize(Block): Invoked after a given Block is initialized/constructed.
Crate
OnPostUpdate(Crate): Invoked after a given Crate is updated.
OnPostRender(Crate): Invoked after a given Crate is rendered.
OnOpen(Crate): Invoked after a given Crate is opened, and after all of the opening logic is ran.
Explosion
OnPostUpdate(Explosion): Invoked after a given Explosion is updated.
OnPostRender(Explosion): Invoked after a given Explosion is rendered.
GameHandler
OnLoadTankScene(): Invoked after the game's scene is finished loading (music, ambience tracks, graphics).
OnPostUpdate(): Invoked after an entire update cycle.
OnPostRender(): Invoked after an entire render cycle.
OnMissionCleanup(): Invoked after the game scene is cleaned up (i.e: to prepare the next mission in a campaign).
MapRenderer
PostLoadBounds(): Invoked after the game's map's boundary graphics model (the (normally) wooden blocks enclosing the playing field) is loaded.
PostLoadFloor(): Invoked after the game's map's floor graphics model (the (normally) wooden plane inside the boundary) is loaded.
PostLoadTextures(): Invoked after the textures that are applied to the map's meshes are loaded, but not applied.
Mine
OnPostUpdate(Mine): Invoked after a given Explosion is updated.
OnPostRender(Mine): Invoked after a given Explosion is rendered.
OnExplode(Mine): Invoked after a mine is set to explode, and a new Explosion is created.
Powerup
To be documented...
Shell
OnPostUpdate(Shell): Invoked after a given Shell is updated.
OnPostRender(Shell): Invoked after a given Shell is rendered.
OnRicochetWithBlock(Block, Shell): Invoked when a given Shell ricochets with a Block obstacle.
OnRicochet(Shell): Invoked when this ricochets at all.
OnDestroy(Shell): Invoked when a given Shell is destroyed.
Tank
OnPostUpdate(Tank): Invoked after a given Tank is updated.
OnPostRender(Tank): Invoked after a given Tank is rendered.
OnDamage(Tank, bool, ITankHurtContext): Invoked when a given Tank is damaged by any means.
PostApplyDefaults(Tank, TankProperties): Invoked when a given Tank has defaults applied to it.
OnShoot(Tank, Shell): Invoked when a given Tank shoots from its turret.
OnLayMine(Tank, Mine): Invoked when a given Tank lays a mine.