Lua:Callins: Difference between revisions
m →Custom Object Rendering: enabling DrawFeature |
→Synced Only: add other Allow* callins |
||
| Line 135: | Line 135: | ||
|return = bool allow | |return = 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. | ||
}} | |||
{{LuaCallin | |||
|name = AllowUnitTransfer | |||
|params = unitID, unitDefID, oldTeam, newTeam, capture | |||
|return = 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. | |||
}} | |||
{{LuaCallin | |||
|name = AllowUnitBuildStep | |||
|params = builderID, builderTeam, unitID, unitDefID, part | |||
|return = bool allow | |||
|description = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress. | |||
}} | |||
{{LuaCallin | |||
|name = AllowFeatureCreation | |||
|params = featureDefID, teamID, x, y, z | |||
|return = bool allow | |||
|description = Called just before feature is created, the boolean return value determines whether or not the creation is permitted. | |||
}} | |||
{{LuaCallin | |||
|name = AllowFeatureBuildStep | |||
|params = builderID, builderTeam, featureID, featureDefID, part | |||
|return = 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. | |||
}} | |||
{{LuaCallin | |||
|name = AllowResourceLevel | |||
|params = teamID, res, level | |||
|return = bool allow | |||
|description = ??? | |||
}} | |||
{{LuaCallin | |||
|name = AllowResourceTransfer | |||
|params = oldTeamID, newTeamID, res, amount | |||
|return = bool allow | |||
|description = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted. | |||
}} | |||
{{LuaCallin | |||
|name = AllowDirectUnitControl | |||
|params = unitID, unitDefID, unitTeam, playerID | |||
|return = bool allow | |||
|description = Determines if this unit can be controlled directly in FPS view. | |||
}} | |||
{{LuaCallin | |||
|name = AllowWeaponTargetCheck | |||
|params = attackerID, attackerWeaponNum, attackerWeaponDefID | |||
|return = bool allow | |||
|description = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. | |||
}} | |||
{{LuaCallin | |||
|name = AllowWeaponTarget | |||
|params = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority | |||
|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>). | |||
}} | }} | ||
Revision as of 21:01, 12 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.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.AllowDirectUnitControl()
return: bool allow
- {{{info}}}
addon.AllowWeaponTargetCheck()
return: bool allow
- {{{info}}}
addon.AllowWeaponTarget()
return: bool allowed, number priority
- {{{info}}}