Mission variable Lua bindings.
Mission variables are similar to Lua variables, but are conserved for each player across all the missions. They are good for storing campaign or other global values.
Typical usage would be:
v = var.peek( "es_misn" ) -- Get the value if v == nil then -- Doesn't exist, so create var.push( "es_misn", 1 ) else var.push( "es_misn", v+1 ) -- Increment value end
|peek (name)||Gets the mission variable value of a certain name.|
|pop (name)||Pops a mission variable off the stack, destroying it.|
|push (name, value)||Creates a new mission variable.|
- peek (name)
Gets the mission variable value of a certain name.
it is.( name )
- name string Name of the mission variable to get.
The value of the mission variable which will depend on what type
- pop (name)
Pops a mission variable off the stack, destroying it.
This does not give you any value and destroys it permanently (or until recreated). ( name )
- name string Name of the mission variable to pop.
- push (name, value)
Creates a new mission variable.
This will overwrite existing vars, so it's a good way to update the values of different mission variables.
nil, bool, string or number.( name, value )
- name string Name to use for the new mission variable.
- value Value of the new mission variable. Accepted types are: