This communication path only works for unsynced data, but can be used to get data
from any of the following scripts (LuaCob, LuaGaia, LuaRules, LuaUI).
How to use it (example call from LuaUI):
Code: Select all
local a, b, c = Spring.LuaRules.MyCustomFunc(d, e, {f, g, h})
table to gather synced data (as well as any info that they get via the SendToUnsynced()
call).
P.P.S. The other way to provide inter-scripts comms is to use the Rules data that
can be attached to units, teams, and the game. This is a one way street though, and is
intended to be set by the synced code in LuaRules, and read by other scripts. Reading
Rules data is also faster then going through the Spring.LuaXXX.func() calls.