User:Master-athmos: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Engine_Development|Development]] < [[Lua_Scripting|Lua Scripting]] < {{FULLPAGENAME}}
[[Engine_Development|Development]] < [[Lua_Scripting|Lua Scripting]] < {{FULLPAGENAME}}
{{LuaCallout
|prefix = Spring.
|name = SetUnitBlocking
|arg1 = {{type|number}} unitID
|arg2 = {{type|boolean}} isBlocking
|arg3 = {{type|boolean}} isSolidObjectCollidable
|arg4 = {{type|boolean}} isProjectileCollidable
|arg5 = {{type|boolean}} isRaySegmentCollidable
|arg6 = {{type|boolean}} crushable
|arg7 = {{type|boolean}} blockEnemyPushing
|arg8 = {{type|boolean}} blockHeightChanges
|arg9 =
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
}}
{{LuaCallout
|prefix = Spring.
|name = SetUnitBuildSpeed
|arg1 = {{type|number}} builderID
|arg2 = [{{type|number}} buildSpeed
|arg3 = [{{type|number}} repairSpeed
|arg4 = [{{type|number}} reclaimSpeed
|arg5 = [{{type|number}} resurrectSpeed
|arg6 = [{{type|number}} captureSpeed
|arg7 = [{{type|number}} terraformSpeed ]]]]]
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
}}
{{LuaCallout
|prefix = Spring.
|name = SetUnitBuildSpeed
|arg1 = {{type|number}} builderID
|arg2 = [{{type|number}} buildSpeed]
|arg3 = [{{type|number}} repairSpeed]
|arg4 = [{{type|number}} reclaimSpeed]
|arg5 = [{{type|number}} resurrectSpeed]
|arg6 = [{{type|number}} captureSpeed]
|arg7 = [{{type|number}} terraformSpeed]
|arg8 =
|arg9 =
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
}}


=All Lua Contexts=
=All Lua Contexts=

Revision as of 00:16, 7 February 2021

Development < Lua Scripting < User:Master-athmos


Spring.SetUnitBlocking ( number unitID, boolean isBlocking, boolean isSolidObjectCollidable, boolean isProjectileCollidable, boolean isRaySegmentCollidable, boolean crushable, boolean blockEnemyPushing, boolean blockHeightChanges )
return: nil

No description available


Spring.SetUnitBuildSpeed ( number builderID, [number buildSpeed, [number repairSpeed, [number reclaimSpeed, [number resurrectSpeed, [number captureSpeed, [number terraformSpeed ]]]]] )
return: nil

No description available


Spring.SetUnitBuildSpeed ( number builderID, [number buildSpeed], [number repairSpeed], [number reclaimSpeed], [number resurrectSpeed], [number captureSpeed], [number terraformSpeed] )
return: nil

No description available


All Lua Contexts

Script.Kill ( )
return: nil

No description available


Script.GetName ( )
return: string luaInstanceName

Returns the luaInstanceName (e.g. "LuaUI", "LuaRules", "LuaGaia", ...).


Script.GetSynced ( )
return: bool is_synced

No description available


Script.GetFullRead ( )
return: bool has_fullctrl

No description available


Script.GetFullRead ( )
return: bool has_fullread

No description available


Script.GetCtrlTeam ( )
return: number ctrl_teamID

No description available


Script.GetReadTeam ( )
return: number read_teamID

No description available


Script.GetReadAllyTeam ( )
return: number read_allyTeamID

No description available


Script.GetSelectTeam ( )
return: number select_teamID

Defines which teamunits can be selected via Spring.SelectUnitMap/Spring.SelectUnitArray.


Script.GetGlobal ( )
return: nil | table globalEnv

Returns nil if not in dev-mode.


Script.GetRegistry ( )
return: nil | table registryEnv

Returns nil if not in dev-mode.


Script.GetCallInList ( )
return: table known_callins

Known CallIns are:
 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) ... }


Script.IsEngineMinVersion ( major [, minor [, commits ]] )
return: nil | boolean isMinVersion

No description available

Special team constants

Script.NO_ACCESS_TEAM ( )
return: number ???

No description available


Script.ALL_ACCESS_TEAM ( )
return: number ???

No description available

LuaUI only

Spring.SetShockFrontFactors ( number minArea, number minPower, number distAdj )
return: nil

No description available


Spring.UpdateCallIn ( string callin_name )
return: nil

No description available

LuaGadgets only

Synced

number COBSCALE

No description available


Script.AddActionFallback ( string command, string help )
return: nil | boolean ???

No description available


Script.RemoveActionFallback ( string command )
return: nil | boolean ???

No description available


Script.UpdateCallIn ( string callin_name )
return: nil

No description available


Script.SetWatchFeature ( number featureDefID, boolean enable )
return: nil

Enables the `UnitFeatureCollision` callin for a specific FeatureDef.


Script.GetWatchFeature ( number featureDefID )
return: nil | boolean enabled

No description available


Script.SetWatchUnit ( number unitDefID, boolean enable )
return: nil

Enables the `UnitUnitCollision`, `UnitFeatureCollision` and `UnitMoveFailed` callins for a specific UnitDef.


Script.GetWatchUnit ( number unitDefID )
return: nil | boolean enabled

No description available


Script.SetWatchWeapon ( number weaponDefID, boolean enable )
return: nil

Enables the `Explosion` and (as of 0.83+) `ProjectileCreated` and `ProjectileDestroyed` callins for a specific WeaponDef.


Script.GetWatchWeapon ( number weaponDefID )
return: nil | boolean enabled

No description available


Script.GetWatchWeapon ( number weaponDefID )
return: nil | boolean enabled

No description available


SendToUnsynced ( arg1, arg2, ... )
return: nil

Just nil, number, string and boolean datatypes are allowed as arguments! NO tables, userdatas, ...


CallAsTeam ( number teamID, lua_function f, arg1, arg2, ... )
return: nil

or
CallAsTeam ( table access, lua_function f, arg1, arg2, ... )
return: nil

LOS checking depends on the `selected` team, this functions allows to select another one.
 access = {
   [ctrl = number teamID,]
   [read = number teamID,]
   [select = number teamID,]
 }

Unsynced

Script.UpdateCallIn ( string callin_name )
return: nil

No description available


CallAsTeam ( number teamID, lua_function f, arg1, arg2, ... )
return: nil

or
CallAsTeam ( table access, lua_function f, arg1, arg2, ... )
return: nil

LOS checking depends on the `selected` team, this functions allows to select another one.
 access = {
   [ctrl = number teamID,]    (limits Spring.GiveOrderXYZ)
   [read = number teamID,]    (limits reading of unit params, e.g. Spring.GetUnitLosState)
   [select = number teamID,]    (limits Spring.SelectUnitXYZ)
 }

LuaRules only

Synced

Script.PermitHelperAIs ( boolean permit )
return: nil

No description available