Identity and logging
Who you are, which VM runs this copy of your script, and the game log.
mod.id
Section titled “mod.id”server + client string
Your manifest id.
mod.version
Section titled “mod.version”server + client string
Your manifest version.
mod.api_version
Section titled “mod.api_version”server + client number
The mod API this game implements.
mod.side
Section titled “mod.side”server + client string
"server" or "client": the VM running this copy of your script.
mod.is_server
Section titled “mod.is_server”server + client boolean
mod.side == "server".
mod.is_client
Section titled “mod.is_client”server + client boolean
mod.side == "client".
mod.log(...)
Section titled “mod.log(...)”server + client
Writes a line to the game log, tagged with your id. Arguments are joined with spaces. print does the same.
mod.log("loaded on the", mod.side)mod.warn(...)
Section titled “mod.warn(...)”server + client
Like mod.log, as a warning. warn does the same.
if not mod.data.has("ships", "sub") then mod.warn("no submarine in this build")end