# Documentation for *Msg*
## AnomalyAnalyzed
function OnMsg.**AnomalyAnalyzed**(anomaly)
: fired when a new anomaly has been completely analized.
## AnomalyRevealed
function OnMsg.**AnomalyRevealed**(anomaly)
: fired when an anomaly has been releaved.
## ApplyModOptions
function OnMsg.**ApplyModOptions**(mod_id)
: fired when the user applies changes to their mod options.
## ChangeMap
function OnMsg.**ChangeMap**()
: message fired when a new map loading begins
## ClassesBuilt
function OnMsg.**ClassesBuilt**()
: use this message to perform post-built actions on the final classes
## ClassesGenerate
function OnMsg.**ClassesGenerate**()
: use this message to mess with the classdefs (before classes are built)
## ClassesPostprocess
function OnMsg.**ClassesPostprocess**()
: use this message to make modifications to the built classes (before they are declared final)
## ClassesPreprocess
function OnMsg.**ClassesPreprocess**()
: use this message to do some processing to the already final classdefs (still before classes are built)
## ColonistArrived
function OnMsg.**ColonistArrived**(colonist)
: fired when a colonist has arrived on Mars with a rocket.
## ColonistBorn
function OnMsg.**ColonistBorn**(colonist, event)
: fired when a colonist has been born/cloned/reborn/spawned/...
## ColonistChangeWorkplace
function OnMsg.**ColonistChangeWorkplace**(colonist, new_workplace, old_workplace )
: fired when any colonist changes its workplace and the new and old are different
## ColonistDie
function OnMsg.**ColonistDie**( colonist, reason )
: fired when any colonist dies
## ColonistDied
function OnMsg.**ColonistDied**(colonist, reason)
: fired when a colonist has died.
## ColonistLeavingMars
function OnMsg.**ColonistLeavingMars**( colonist, rocket )
: fired when any colonist is leaving Mars
## ColonyApprovalPassed
function OnMsg.**ColonyApprovalPassed**()
: fired when the _Founder Stage_ has been passed successfully.
## ConstructionComplete
function OnMsg.**ConstructionComplete**( building )
: fired when the construction of a building is complete
## GamepadGatherSelectedObjects
function OnMsg.**GamepadGatherSelectedObjects**(gamepad_terrain_objects, objects)
: use this message to queue custom big objects for gamepad selection.
## GamepadGatherSelectedUnits
function OnMsg.**GamepadGatherSelectedUnits**(gamepad_terrain_objects, objects)
: use this message to queue custom units for gamepad selection.
## GatherSelectedObjectsOnHexGrid
function OnMsg.**GatherSelectedObjectsOnHexGrid**(q, r, objects)
: use this message to queue custom objects for selection using a hex grid position.
## GatherUIBuildingPrerequisites
function OnMsg.**GatherUIBuildingPrerequisites**(template, reasons )
: Insert strings into the `reasons` table to indicate why a specific building is not buildable at the moment (if any).
## LoadGame
function OnMsg.**LoadGame**()
: fired after a game has been loaded.
## NewDay
function OnMsg.**NewDay**(day)
: fired every Sol.
## NewHour
function OnMsg.**NewHour**(hour)
: fired every _GameTime_ hour.
## NewMapLoaded
function OnMsg.**NewMapLoaded**()
: fired after a new map has been loaded
## NewSpecialist
function OnMsg.**NewSpecialist**(colonist )
: fired when a colonist gains a specialization
## OnSetWorking
function OnMsg.**OnSetWorking**(building, working)
: fired when a buildings working state has been changed.
## PreLoadGame
function OnMsg.**PreLoadGame**()
: fired before a game is loaded.
## RocketLanded
function OnMsg.**RocketLanded**(rocket)
: fired when a rocket has landed on Mars.
## RocketLaunchFromEarth
function OnMsg.**RocketLaunchFromEarth**(rocket )
: fired when a rocket is launched toward Mars
## RocketLaunched
function OnMsg.**RocketLaunched**(rocket )
: fired when a rocket takes off from Mars
## RocketLaunched
function OnMsg.**RocketLaunched**(rocket )
: fired when a rocket takes off from Mars
## RocketReachedEarth
function OnMsg.**RocketReachedEarth**(rocket )
: fired when a rocket finishes its travel from Mars to Earth
## RocketRefueled
function OnMsg.**RocketRefueled**(rocket )
: fired when a rocket is completely refueled for its trip back to Earth
## RocketStatusUpdate
function OnMsg.**RocketStatusUpdate**(rocket,status )
: fired when rocket's status is updated. 'status' can be one of "on earth", "arriving", "in orbit", "suspended in orbit", "landing", "landed", "refueling", "maintenance", "ready for launch", "launch suspended", "countdown", "takeoff" or "departing"
## SaveGame
function OnMsg.**SaveGame**()
: fired before the game is saved.
## SelectedObjChange
function OnMsg.**SelectedObjChange**(object, previous)
: fired when the user changes the selected object.
## TechResearched
function OnMsg.**TechResearched**(tech_id, city, first_time )
: fired when a tech has been researched.
(insert footer.md.html here)