Lua:Callins: Difference between revisions
m →Synced - Unsynced Shared: subheadings |
jK fills in the blanks |
||
| Line 237: | Line 237: | ||
|params = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam | |params = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam | ||
|return = bool stop | |return = bool stop | ||
|description = | |description = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is <code>true</code> the current build order is terminated. | ||
}} | }} | ||
| Line 243: | Line 243: | ||
|name = MoveCtrlNotify | |name = MoveCtrlNotify | ||
|params = unitID, unitDefID, unitTeam, data | |params = unitID, unitDefID, unitTeam, data | ||
|return = bool | |return = bool moveCtrlComplete | ||
|description = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than <code>1</code> ("unit hit the ground"). | |description = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than <code>1</code> ("unit hit the ground"). The return value determines whether or not the unit should remain script-controlled (<code>false</code>) or return to engine controlled movement (<code>true</code>). | ||
}} | }} | ||
| Line 259: | Line 259: | ||
|name = ShieldPreDamaged | |name = ShieldPreDamaged | ||
|params = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile | |params = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile | ||
|return = | |return = bool handleCollision | ||
|description = Called before any engine shield-vs-projectile logic executes. | |description = Called before any engine shield-vs-projectile logic executes. If the return value is <code>true</code> the gadget handles the collision event and the engine does not remove the projectile. | ||
}} | }} | ||
Revision as of 22:29, 13 February 2014
Lua Callins
Common
addon.Initialize()
return: none
- {{{info}}}
addon.Shutdown()
return: none
- {{{info}}}
Unsynced Only
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}}}
addon.PlayerChanged()
return: none
- {{{info}}}
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}}}