Lua:Callins: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m →Drawing: param for Update
Flozi (talk | contribs)
→Input: rest of unsynced only - lots of ???
Line 17: Line 17:


== Unsynced Only ==
== Unsynced Only ==
{{LuaCallin
|name = DefaultCommand
|params = type, id
|return = number cmdID
|description = Used to set the default command when a unit is selected.
}}
{{LuaCallin
|name = CommandNotify
|params = id, params, options
|description = ???
}}
{{LuaCallin
|name = WorldTooltip
|params = ???
|return = nones
|description = ???
}}
{{LuaCallin
|name = UnsyncedHeightMapUpdate
|params = ???
|return = none
|description = Called when the unsynced copy of the height-map is altered.
}}
{{LuaCallin
|name = GameProgress
|params = serverFrameNum
|return = none
|description = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.
}}
{{LuaCallin
|name = GameSetup
|params =  state, ready, playerStates
|return = bool success, ??? newReady
|description = ???
}}
{{LuaCallin
|name = SunChanged
|params = ???
|return = none
|description = ???
}}
{{LuaCallin
|name = AddConsoleLine
|params = ???
|return = none
|description = ???
}}
{{LuaCallin
|name = RecvSkirmishAIMessage
|params = aiTeam, dataStr
|return = ???
|description = ???
}}
{{LuaCallin
|name = RecvFromSynced
|params = ...
|return = none
|description = Receives data sent via <code>SendToUnsynced</code> callout.
}}
{{LuaCallin
|name = Save
|params = ???
|return = ???
|description = ???
}}
{{LuaCallin
|name = LoadProgress
|params = ???
|return = ???
|description = ???
}}
{{LuaCallin
|name = GroupChanged
|params = ???
|return = ???
|description = ???
}}
{{LuaCallin
|name = ConfigureLayout
|params = ???
|return = ???
|description = ???
}}


=== Input ===
=== Input ===

Revision as of 21:12, 14 February 2014

Lua Callins

Common

addon.Initialize()
return: none

{{{info}}}


addon.Shutdown()
return: none

{{{info}}}


Unsynced Only

addon.DefaultCommand()
return: number cmdID

{{{info}}}


addon.CommandNotify()

{{{info}}}


addon.WorldTooltip()
return: nones

{{{info}}}


addon.UnsyncedHeightMapUpdate()
return: none

{{{info}}}


addon.GameProgress()
return: none

{{{info}}}


addon.GameSetup()
return: bool success, ??? newReady

{{{info}}}


addon.SunChanged()
return: none

{{{info}}}


addon.AddConsoleLine()
return: none

{{{info}}}


addon.RecvSkirmishAIMessage()
return: ???

{{{info}}}


addon.RecvFromSynced()
return: none

{{{info}}}


addon.Save()
return: ???

{{{info}}}


addon.LoadProgress()
return: ???

{{{info}}}


addon.GroupChanged()
return: ???

{{{info}}}


addon.ConfigureLayout()
return: ???

{{{info}}}


Input

addon.KeyPress()
return: none

{{{info}}}


addon.KeyRelease()
return: none

{{{info}}}


addon.JoystickEvent()
return: none

{{{info}}}


addon.MousePress()
return: none

{{{info}}}


addon.MouseRelease()
return: none

{{{info}}}


addon.MouseWheel()
return: none

{{{info}}}


addon.MouseMove()
return: none

{{{info}}}


addon.IsAbove()
return: none

{{{info}}}


addon.GetTooltip()
return: none

{{{info}}}


Players

addon.PlayerChanged()
return: none

{{{info}}}


addon.PlayerAdded()
return: none

{{{info}}}


addon.PlayerRemoved()
return: none

{{{info}}}


Drawing

addon.ViewResize()
return: none

{{{info}}}


addon.Update()
return: none

{{{info}}}


Inside the Draw* 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

Game

Teams

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}}}