Lua:Callins: Difference between revisions
→Synced Only: CommandFallback (terribad grammar) & AllowCommand |
→Synced Only: damage controllers & AllowStartPosition |
||
| Line 191: | Line 191: | ||
|return = bool allow | |return = 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. | ||
}} | |||
{{LuaCallin | |||
|name = AllowStartPosition | |||
|params = clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ | |||
|return = 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 <code>0</code> - player picked a position, <code>1</code> - player clicked ready, <code>2</code> - game was force-started (player did not click ready) or <code>3</code> the player failed to load. {{new|95.0}} the default 'failed to choose' start-position is now just <code>(0,0,0)</code>, not <code>(0,-500,0)</code>. | |||
}} | }} | ||
| Line 212: | Line 219: | ||
|return = bool allowed, number priority | |return = bool allowed, number priority | ||
|description = Controls blocking of a specific target from being considered during a weapon's periodic auto-targeting sweep. The second return value controls the priority of the target (maximum of <code>1.0</code>). | |description = Controls blocking of a specific target from being considered during a weapon's periodic auto-targeting sweep. The second return value controls the priority of the target (maximum of <code>1.0</code>). | ||
}} | |||
=== Damage Controllers === | |||
{{LuaCallin | |||
|name = UnitPreDamaged | |||
|params = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam | |||
|return = number newDamage, 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. | |||
}} | |||
{{LuaCallin | |||
|name = ShieldPreDamaged | |||
|params = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile | |||
|return = ??? | |||
|description = Called before any engine shield-vs-projectile logic executes. | |||
}} | |||
{{LuaCallin | |||
|name = FeaturePreDamaged | |||
|params = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam | |||
|return = number newDamage, 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. | |||
}} | }} | ||
Revision as of 20: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}}}
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}}}
Damage Controllers
addon.UnitPreDamaged()
return: number newDamage, number impulseMult
- {{{info}}}
addon.ShieldPreDamaged()
return: ???
- {{{info}}}
addon.FeaturePreDamaged()
return: number newDamage, number impulseMult
- {{{info}}}