User:Master-athmos: Difference between revisions

From Spring
Jump to navigationJump to search
No edit summary
No edit summary
Line 15: Line 15:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 32: Line 32:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 49: Line 49:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 67: Line 67:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 101: Line 101:
|arg9 =
|arg9 =
|return = {{type|bool}} is_synced
|return = {{type|bool}} is_synced
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 118: Line 118:
|arg9 =
|arg9 =
|return = {{type|bool}} has_fullctrl
|return = {{type|bool}} has_fullctrl
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 135: Line 135:
|arg9 =
|arg9 =
|return = {{type|bool}} has_fullread
|return = {{type|bool}} has_fullread
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 152: Line 152:
|arg9 =
|arg9 =
|return = {{type|number}} ctrl_teamID
|return = {{type|number}} ctrl_teamID
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 169: Line 169:
|arg9 =
|arg9 =
|return = {{type|number}} read_teamID
|return = {{type|number}} read_teamID
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 186: Line 186:
|arg9 =
|arg9 =
|return = {{type|number}} read_allyTeamID
|return = {{type|number}} read_allyTeamID
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 275: Line 275:
|arg9 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} isMinVersion
|return = {{type|nil}} {{pipe}} {{type|boolean}} isMinVersion
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 293: Line 293:
|arg9 =
|arg9 =
|return = {{type|number}} ???
|return = {{type|number}} ???
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 310: Line 310:
|arg9 =
|arg9 =
|return = {{type|number}} ???
|return = {{type|number}} ???
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 328: Line 328:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 345: Line 345:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 352: Line 352:


{{type|number}} COBSCALE
{{type|number}} COBSCALE
:<font color="red" style="font-weight:600">No description available</font>
: Number containing the cobscale factor, which is applied to transform the variables assigned via unit cob animation scripts for use inside the engine (default: 65536).




Line 385: Line 385:
|arg9 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} ???
|return = {{type|nil}} {{pipe}} {{type|boolean}} ???
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 402: Line 402:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 436: Line 436:
|arg9 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 470: Line 470:
|arg9 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 504: Line 504:
|arg9 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 521: Line 521:
|arg9 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|return = {{type|nil}} {{pipe}} {{type|boolean}} enabled
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 594: Line 594:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}


Line 652: Line 652:
|arg9 =
|arg9 =
|return = {{type|nil}}
|return = {{type|nil}}
|info = <font color="red" style="font-weight:600">No description available</font>
|info = <font color="maroon" style="font-weight:600">No description available</font>
}}
}}




[[category: Lua]]
[[category: Lua]]

Revision as of 13:11, 17 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

Number containing the cobscale factor, which is applied to transform the variables assigned via unit cob animation scripts for use inside the engine (default: 65536).


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