Lua:Callins: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
jK fills in the blanks
Flozi (talk | contribs)
sub headings for Unsynced only, fill in Player* callins
Line 17: Line 17:


== Unsynced Only ==
== Unsynced Only ==
=== Input ===
=== Players ===
{{LuaCallin
|name = PlayerChanged
|params = playerID
|return = none
|description = Called whenever a player's status changes e.g. becoming a spectator.
}}
{{LuaCallin
|name = PlayerAdded
|params = playerID
|return = none
|description = Called whenever a new player joins the game.
}}
{{LuaCallin
|name = PlayerRemoved
|params = playerID, reason
|return = none
|description = Called whenever a player is removed from the game.
}}
=== Drawing ===
Inside these functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.
Inside these functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.


Line 121: Line 147:


== Synced - Unsynced Shared ==
== Synced - Unsynced Shared ==
{{LuaCallin
|name = PlayerChanged
|params = playerID
|return = none
|description = Called whenever a player's status changes e.g. becoming a spectator.
}}


=== Units ===
=== Units ===

Revision as of 22:41, 13 February 2014

Lua Callins

Common

addon.Initialize()
return: none

{{{info}}}


addon.Shutdown()
return: none

{{{info}}}


Unsynced Only

Input

Players

addon.PlayerChanged()
return: none

{{{info}}}


addon.PlayerAdded()
return: none

{{{info}}}


addon.PlayerRemoved()
return: none

{{{info}}}


Drawing

Inside these functions, you can use the Lua OpenGL Api to draw graphics.

addon.DrawGenesis()
return: none

{{{info}}}


addon.DrawWorldPreUnit()
return: none

{{{info}}}


addon.DrawWorld()
return: none

{{{info}}}


addon.DrawWorldShadow()
return: none

{{{info}}}


addon.DrawWorldReflection()
return: none

{{{info}}}


addon.DrawWorldRefraction()
return: none

{{{info}}}


addon.DrawScreen()
return: none

{{{info}}}


addon.DrawScreenEffects()
return: none

{{{info}}}


addon.DrawLoadScreen()
return: none

{{{info}}}


addon.DrawInMinimap()
return: none

{{{info}}}


Custom Object Rendering

For the following calls drawMode can be one of the following, notDrawing = 0, normalDraw = 1, shadowDraw = 2, reflectionDraw = 3, refractionDraw = 4.

addon.DrawUnit()
return: none

{{{info}}}


addon.DrawFeature()
return: none

{{{info}}}


addon.DrawShield()
return: none

{{{info}}}


addon.DrawProjectile()
return: none

{{{info}}}


Synced - Unsynced Shared

Units

Features

Projectiles

Synced Only

addon.CommandFallback()
return: bool used, bool removed

{{{info}}}


addon.AllowCommand()
return: bool allow

{{{info}}}


addon.AllowUnitCreation()
return: bool allow

{{{info}}}


addon.AllowUnitTransfer()
return: bool allow

{{{info}}}


addon.AllowUnitBuildStep()
return: bool allow

{{{info}}}


addon.AllowFeatureCreation()
return: bool allow

{{{info}}}


addon.AllowFeatureBuildStep()
return: bool allow

{{{info}}}


addon.AllowResourceLevel()
return: bool allow

{{{info}}}


addon.AllowResourceTransfer()
return: bool allow

{{{info}}}


addon.AllowStartPosition()
return: bool allow

{{{info}}}


addon.AllowDirectUnitControl()
return: bool allow

{{{info}}}


addon.AllowWeaponTargetCheck()
return: bool allow

{{{info}}}


addon.AllowWeaponTarget()
return: bool allowed, number priority

{{{info}}}


addon.AllowWeaponInterceptTarget()
return: bool allowed

{{{info}}}


addon.TerraformComplete()
return: bool stop

{{{info}}}


addon.MoveCtrlNotify()
return: bool moveCtrlComplete

{{{info}}}


Damage Controllers

addon.UnitPreDamaged()
return: number newDamage, number impulseMult

{{{info}}}


addon.ShieldPreDamaged()
return: bool handleCollision

{{{info}}}


addon.FeaturePreDamaged()
return: number newDamage, number impulseMult

{{{info}}}