Lua System: Difference between revisions
From Spring
Jump to navigationJump to search
mNo edit summary |
|||
| Line 37: | Line 37: | ||
'''Script.GetCallInList''' | '''Script.GetCallInList''' | ||
( ) -> table <span class=note>known_callins</span> | ( ) -> table <span class=note>known_callins</span> | ||
<span class=note> | <span class=note> | ||
known_callins = { | known_callins = { | ||
["CallInName"] = { unsynced = boolean, controller = boolean }, (`controller` is true for all CallIns which's return values are used by the engine for synced code, e.g. "AllowUnitCreation" is a controller) | ["CallInName"] = { unsynced = boolean, controller = boolean }, (`controller` is true for all CallIns which's return values are used by the engine for synced code, e.g. "AllowUnitCreation" is a controller) | ||
| Line 48: | Line 48: | ||
number '''Script.ALL_ACCESS_TEAM''' | number '''Script.ALL_ACCESS_TEAM''' | ||
=LuaUI only= | =LuaUI only= | ||
Revision as of 17:18, 11 December 2010
Development < Lua Scripting < Lua System
All Lua Contexts
Script.Kill
( ) -> nil
Script.GetName
( ) -> string luaInstanceName (e.g. "LuaUI", "LuaRules", "LuaGaia", ...)
Script.GetSynced
( ) -> boolean is_synced
Script.GetFullCtrl
( ) -> boolean has_fullctrl
Script.GetFullRead
( ) -> boolean has_fullread
Script.GetCtrlTeam
( ) -> number ctrl_teamID
Script.GetReadTeam
( ) -> number read_teamID
Script.GetReadAllyTeam
( ) -> number read_allyTeamID
Script.GetSelectTeam
( ) -> number select_teamID (defines which teamunits can be selected via Spring.SelectUnitMap/Spring.SelectUnitArray)
Script.GetGlobal
( ) -> nil | table globalEnv (returns nil if not in dev-mode)
Script.GetRegistry
( ) -> nil | table registryEnv (returns nil if not in dev-mode)
Script.GetCallInList
( ) -> table known_callins known_callins = { ["CallInName"] = { unsynced = boolean, controller = boolean }, (`controller` is true for all CallIns which's return values are used by the engine for synced code, e.g. "AllowUnitCreation" is a controller) ... }
special team constants
number Script.NO_ACCESS_TEAM
number Script.ALL_ACCESS_TEAM
LuaUI only
Spring.SetShockFrontFactors
( [number minArea], [number minPower], [number distAdj] ) -> nil
Script.UpdateCallIn
( string callin_name ) -> nil
LuaGadgets only
Synced
number COBSCALE
Script.AddActionFallback
( string command, string help ) -> nil | boolean
Script.RemoveActionFallback
( string command ) -> nil | boolean
Script.UpdateCallIn
( string callin_name ) -> nil
Script.SetWatchWeapon Enables the `Explosion` callin for a specific WeaponDef.
( number weaponDefID, boolean enable ) -> nil
Script.GetWatchWeapon
( number weaponDefID ) -> nil | boolean enabled
SendToUnsynced
( arg1, arg2, ... ) -> nil
Just nil, number, string and boolean datatypes are allowed as arguments! NO tables, userdatas, ...
CallAsTeam
( ) -> nil
Unsynced
Script.UpdateCallIn
( string callin_name ) -> nil
CallAsTeam
( ) -> nil
LuaRules only
Synced
Script.PermitHelperAIs
( boolean permit ) -> nil
Spring.SetUnitRulesParam
( ) -> nil
Spring.SetTeamRulesParam
( ) -> nil
Spring.SetGameRulesParam
( ) -> nil