Development < Lua Scripting < Lua SyncedInterface
There can be two flavors of Lua scripts, Synced and Unsynced. This corresponds to the network model Spring uses. Currently only Synced scripts are supported. This page documents the available functions and classes.
For more documentation, see LuaBinder.cpp :)
Contents |
Classes
Script
This class is meant to be subclassed in a lua script, and spring will call methods at various times.
| Name | Comment |
|---|---|
| constructor(string) | Pass the string that should be visible in the selection menu |
| string GetMapName() | Return the map that should be used to bypass the map selection menu, or return "" to show the menu |
| void Update() | Called once every simulated frame |
| void GotChatMsg(string, int) | Called when a chat message is received. The first parameter is the message, and the second the id of the sending player |
