Lua:Callins: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
→Synced - Unsynced Shared: template styling
Flozi (talk | contribs)
→Synced Only: templates
Line 600: Line 600:
|name = CommandFallback
|name = CommandFallback
|params = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag
|params = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag
|return = bool used, bool finished
|return = {{type|bool}} used, {{type|bool}} finished
|description = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns <code>used</code> as <code>true</code> the command is dropped, if an addon returns <code>true, true</code> the command is removed because it's done, with <code>true, false</code> it's kept in the queue and <code>CommandFallback</code> gets called again on the next slowupdate.
|description = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it's done, with {{value|true}}, {{value|false}} it's kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.
}}
}}


Line 607: Line 607:
|name = AllowCommand
|name = AllowCommand
|params = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced
|params = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced
|return = bool allow
|return = {{type|bool}} allow
|description = Called when the command is given, before the unit's queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.
|description = Called when the command is given, before the unit's queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.
}}
}}
Line 614: Line 614:
|name = AllowUnitCreation
|name = AllowUnitCreation
|params = unitDefID, builderID, builderTeam, x, y, z, facing
|params = unitDefID, builderID, builderTeam, x, y, z, facing
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.
|description = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.
}}
}}
Line 621: Line 621:
|name = AllowUnitTransfer
|name = AllowUnitTransfer
|params = unitID, unitDefID, oldTeam, newTeam, capture
|params = unitID, unitDefID, oldTeam, newTeam, capture
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
|description = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
}}
}}
Line 628: Line 628:
|name = AllowUnitBuildStep
|name = AllowUnitBuildStep
|params = builderID, builderTeam, unitID, unitDefID, part
|params = builderID, builderTeam, unitID, unitDefID, part
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.
|description = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.
}}
}}
Line 635: Line 635:
|name = AllowFeatureCreation
|name = AllowFeatureCreation
|params = featureDefID, teamID, x, y, z
|params = featureDefID, teamID, x, y, z
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.
|description = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.
}}
}}
Line 642: Line 642:
|name = AllowFeatureBuildStep
|name = AllowFeatureBuildStep
|params = builderID, builderTeam, featureID, featureDefID, part
|params = builderID, builderTeam, featureID, featureDefID, part
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted.
|description = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted.
}}
}}
Line 649: Line 649:
|name = AllowResourceLevel
|name = AllowResourceLevel
|params = teamID, res, level
|params = teamID, res, level
|return = bool allow
|return = {{type|bool}} allow
|description = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.
|description = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.
}}
}}
Line 656: Line 656:
|name = AllowResourceTransfer
|name = AllowResourceTransfer
|params = oldTeamID, newTeamID, res, amount
|params = oldTeamID, newTeamID, res, amount
|return = bool allow
|return = {{type|bool}} allow
|description = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.
|description = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.
}}
}}
Line 663: Line 663:
|name = AllowStartPosition
|name = AllowStartPosition
|params =  clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ
|params =  clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ
|return = bool allow
|return = {{type|bool}} allow
|description = <code>clamped</code> are the coordinates clamped into start-boxes, <code>raw</code> is where player tried to place their marker. The <code>readyState</code> can be any one of  
|description = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of  
* <code>0</code> - player picked a position,  
* {{value|0}} - player picked a position,  
* <code>1</code> - player clicked ready,  
* {{value|1}} - player clicked ready,  
* <code>2</code> - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or  
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or  
* <code>3</code> - the player failed to load.  
* {{value|3}} - the player failed to load.  
* {{new|95.0}} the default 'failed to choose' start-position is the north-west point of their startbox, or <code>(0,0,0)</code> if they do not have a startbox.  
* {{new|95.0}} the default 'failed to choose' start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox.  
}}
}}


Line 675: Line 675:
|name = AllowDirectUnitControl
|name = AllowDirectUnitControl
|params = unitID, unitDefID, unitTeam, playerID
|params = unitID, unitDefID, unitTeam, playerID
|return = bool allow
|return = {{type|bool}} allow
|description = Determines if this unit can be controlled directly in FPS view.
|description = Determines if this unit can be controlled directly in FPS view.
}}
}}
Line 682: Line 682:
|name = AllowWeaponTargetCheck
|name = AllowWeaponTargetCheck
|params = attackerID, attackerWeaponNum, attackerWeaponDefID
|params = attackerID, attackerWeaponNum, attackerWeaponDefID
|return = bool allowCheck, bool ignoreCheck
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck
|description = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The <code>ignoreCheck</code> return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.
|description = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.
}}
}}


Line 689: Line 689:
|name = AllowWeaponTarget
|name = AllowWeaponTarget
|params = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority
|params = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority
|return = bool allowed, number newPriority
|return = {{type|bool}} allowed, {{type|number}} newPriority
|description = Controls blocking of a specific target from being considered during a weapon's periodic auto-targeting sweep. The second return value is the new priority for this target (if you don't want to change it, return defPriority). Lower priority targets are targeted first.
|description = Controls blocking of a specific target from being considered during a weapon's periodic auto-targeting sweep. The second return value is the new priority for this target (if you don't want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.
}}
}}


Line 696: Line 696:
|name = AllowWeaponInterceptTarget
|name = AllowWeaponInterceptTarget
|params = interceptorUnitID, interceptorWeaponID, targetProjectileID
|params = interceptorUnitID, interceptorWeaponID, targetProjectileID
|return = bool allowed
|return = {{type|bool}} allowed
|description = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon's periodic auto-targeting sweep. Only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].
|description = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon's periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].
}}
}}


Line 703: Line 703:
|name = AllowBuilderHoldFire
|name = AllowBuilderHoldFire
|params = unitID, unitDefID, action
|params = unitID, unitDefID, action
|return = bool actionAllowed
|return = {{type|bool}} actionAllowed
|description = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}  Called when a construction unit wants to "use his nano beams".<br><code>action</code> is one of following:
|description = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}  Called when a construction unit wants to "use his nano beams".<br>{{var|action}} is one of following:
* <code>-1</code> Build
* {{value|-1}} Build
* <code>CMD.REPAIR</code> Repair
* {{value|CMD.REPAIR}} Repair
* <code>CMD.RECLAIM</code> Reclaim
* {{value|CMD.RECLAIM}} Reclaim
* <code>CMD.RESTORE</code> Restore
* {{value|CMD.RESTORE}} Restore
* <code>CMD.RESURRECT</code> Resurrect
* {{value|CMD.RESURRECT}} Resurrect
* <code>CMD.CAPTURE</code> Capture
* {{value|CMD.CAPTURE}} Capture
}}
}}


Line 716: Line 716:
|name = Explosion
|name = Explosion
|params = weaponDefID, px, py, pz, AttackerID
|params = weaponDefID, px, py, pz, AttackerID
|return = bool noGfx
|return = {{type|bool}} noGfx
|description = Called when an explosion occurs. If it returns <code>true</code> then no graphical effects are drawn by the engine for this explosion.
|description = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.
}}
}}


Line 723: Line 723:
|name = TerraformComplete
|name = TerraformComplete
|params = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam
|params = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam
|return = bool stop
|return = {{type|bool}} stop
|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.
|description = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.
}}
}}


Line 730: Line 730:
|name = MoveCtrlNotify
|name = MoveCtrlNotify
|params = unitID, unitDefID, unitTeam, data
|params = unitID, unitDefID, unitTeam, data
|return = bool moveCtrlComplete
|return = {{type|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"). 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>).
|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 {{value|1}} ("unit hit the ground"). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).
}}
}}


Line 737: Line 737:
|name = RecvLuaMsg
|name = RecvLuaMsg
|params = msg, playerID
|params = msg, playerID
|return = none
|description = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].
|description = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].
}}
}}
Line 744: Line 743:
|name = Load
|name = Load
|params = zip
|params = zip
|return = none
|description = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].
|description = Called after <code>GamePreload</code> and before <code>GameStart</code>. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].
}}
}}


=== Damage Controllers ===
=== Damage Controllers ===
For the following callins, in addition to being a regular weapon, <code>weaponDefID</code> may be one of the following:
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:
* <code>-1</code> - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]
* <code>-2</code> - ground collision
* {{value|-2}} - ground collision
* <code>-3</code> - object collision
* {{value|-3}} - object collision
* <code>-4</code> - fire damage
* {{value|-4}} - fire damage
* <code>-5</code> - water damage
* {{value|-5}} - water damage
* <code>-6</code> - kill damage
* {{value|-6}} - kill damage
* <code>-7</code> - crush damage
* {{value|-7}} - crush damage


{{LuaCallin
{{LuaCallin
|name = UnitPreDamaged
|name = UnitPreDamaged
|params = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam
|params = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam
|return = number newDamage, number impulseMult
|return = {{type|number}} newDamage, {{type|number}} impulseMult
|description = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.
|description = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.
}}
}}
Line 768: Line 766:
|name = ShieldPreDamaged
|name = ShieldPreDamaged
|params = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile
|params = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile
|return = bool handleCollision
|return = {{type|bool}} handleCollision
|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.
|description = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile.
}}
}}


Line 775: Line 773:
|name = FeaturePreDamaged
|name = FeaturePreDamaged
|params = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam
|params = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam
|return = number newDamage, number impulseMult
|return = {{type|number}} newDamage, {{type|number}} impulseMult
|description = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.
|description = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.
}}
}}


[[Category: Lua]]
[[Category: Lua]]

Revision as of 23:51, 17 June 2016

Lua Callins

This page is future looking to unified widget/gadget (aka "addon") handler, which may yet be some way off, c.f. the changelog.

For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,

    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)
        ...  
    end

Some functions may differ between (synced) gadget and widgets; those are in the #Synced_-_Unsynced_Shared section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.

Common

addon.Initialize()

{{{info}}}


addon.Shutdown()

{{{info}}}


Unsynced Only

addon.DefaultCommand()
return: number cmdID

{{{info}}}


addon.CommandNotify()
return: bool removeCmd

{{{info}}}


addon.CommandsChanged()
return: ?

{{{info}}}


addon.WorldTooltip()
return: string newTooltip

{{{info}}}


addon.UnsyncedHeightMapUpdate()

{{{info}}}


addon.GameProgress()

{{{info}}}


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

{{{info}}}


addon.SunChanged()

{{{info}}}


addon.AddConsoleLine()

{{{info}}}


addon.RecvSkirmishAIMessage()
return: ???

{{{info}}}


addon.RecvFromSynced()

{{{info}}}


addon.Save()

{{{info}}}


addon.LoadProgress()

{{{info}}}


addon.GroupChanged()

{{{info}}}


addon.ConfigureLayout()
return: ???

{{{info}}}


Input

addon.IsAbove()
return: bool isAbove

{{{info}}}


addon.GetTooltip()
return: string tooltip

{{{info}}}


addon.KeyPress()
return: bool becomeOwner

{{{info}}}


addon.KeyRelease()
return: bool

{{{info}}}


addon.TextInput()

{{{info}}}


addon.JoystickEvent()

{{{info}}}


addon.MousePress()
return: bool becomeMouseOwner

{{{info}}}


addon.MouseRelease()
return: bool becomeMouseOwner

{{{info}}}


addon.MouseWheel()

{{{info}}}


addon.MouseMove()

{{{info}}}


Players

addon.PlayerChanged()

{{{info}}}


addon.PlayerAdded()

{{{info}}}


addon.PlayerRemoved()

{{{info}}}


Drawing

addon.ViewResize()

{{{info}}}


addon.Update()

{{{info}}}


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

addon.DrawGenesis()

{{{info}}}


addon.DrawWorldPreUnit()

{{{info}}}


addon.DrawWorld()

{{{info}}}


addon.DrawWorldShadow()

{{{info}}}


addon.DrawWorldReflection()

{{{info}}}


addon.DrawWorldRefraction()

{{{info}}}


addon.DrawScreen()

{{{info}}}


addon.DrawScreenEffects()

{{{info}}}


addon.DrawLoadScreen()

{{{info}}}


addon.DrawInMinimap()

{{{info}}}


addon.DrawInMinimapBackground()

{{{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: bool suppressEngineDraw

{{{info}}}


addon.DrawFeature()
return: bool suppressEngineDraw

{{{info}}}


addon.DrawShield()
return: bool suppressEngineDraw

{{{info}}}


addon.DrawProjectile()
return: bool suppressEngineDraw

{{{info}}}


Synced - Unsynced Shared

addon.GotChatMsg()

{{{info}}}


Game

addon.GameID()

{{{info}}}


addon.GamePaused()

{{{info}}}


addon.GameOver()

{{{info}}}


addon.GameFrame()

{{{info}}}


addon.GamePreload()

{{{info}}}


addon.GameStart()

{{{info}}}


Teams

addon.TeamChanged()

{{{info}}}


addon.TeamDied()

{{{info}}}


Units

addon.UnitCreated()

{{{info}}}


addon.UnitFinished()

{{{info}}}


addon.UnitFromFactory()

{{{info}}}


addon.UnitGiven()

{{{info}}}


addon.UnitTaken()

{{{info}}}


addon.UnitDamaged()

{{{info}}}


addon.UnitDestroyed()

{{{info}}}


addon.RenderUnitDestroyed()

{{{info}}}


addon.UnitStunned()

{{{info}}}


addon.UnitUnitCollision()

{{{info}}}


addon.UnitFeatureCollision()

{{{info}}}


addon.UnitCommand()

{{{info}}}


addon.UnitCmdDone()

{{{info}}}


addon.UnitLoaded()

{{{info}}}


addon.UnitUnloaded()

{{{info}}}


addon.UnitExperience()

{{{info}}}


addon.UnitIdle()

{{{info}}}


addon.UnitCloaked()

{{{info}}}


addon.UnitDecloaked()

{{{info}}}


addon.UnitMoved()

{{{info}}}


addon.UnitMoveFailed()

{{{info}}}


addon.StockpileChanged()

{{{info}}}


addon.UnitEnteredLos()

{{{info}}}


addon.UnitLeftLos()

{{{info}}}


addon.UnitEnteredRadar()

{{{info}}}


addon.UnitLeftRadar()

{{{info}}}


addon.UnitEnteredAir()

{{{info}}}


addon.UnitLeftAir()

{{{info}}}


addon.UnitEnteredWater()

{{{info}}}


addon.UnitLeftWater()

{{{info}}}


addon.UnitSeismicPing()

{{{info}}}


Features

addon.FeatureCreated()

{{{info}}}


addon.FeatureDamaged()

{{{info}}}


addon.FeatureDestroyed()

{{{info}}}


addon.FeatureMoved()

{{{info}}}


Projectiles

The following Callins are only called for weaponDefIDs registered via Script.SetWatchWeapon.

addon.ProjectileCreated()

{{{info}}}


addon.ProjectileDestroyed()

{{{info}}}


Synced Only

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

{{{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 allowCheck, bool ignoreCheck

{{{info}}}


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

{{{info}}}


addon.AllowWeaponInterceptTarget()
return: bool allowed

{{{info}}}


addon.AllowBuilderHoldFire()
return: bool actionAllowed

{{{info}}}


addon.Explosion()
return: bool noGfx

{{{info}}}


addon.TerraformComplete()
return: bool stop

{{{info}}}


addon.MoveCtrlNotify()
return: bool moveCtrlComplete

{{{info}}}


addon.RecvLuaMsg()

{{{info}}}


addon.Load()

{{{info}}}


Damage Controllers

For the following callins, in addition to being a regular weapon, weaponDefID may be one of the following:

  • -1 - debris collision, also default of Spring.AddUnitDamage
  • -2 - ground collision
  • -3 - object collision
  • -4 - fire damage
  • -5 - water damage
  • -6 - kill damage
  • -7 - crush damage

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

{{{info}}}


addon.ShieldPreDamaged()
return: bool handleCollision

{{{info}}}


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

{{{info}}}