User:Flozi: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
mNo edit summary
Flozi (talk | contribs)
now with proposed template call
Line 1: Line 1:
'''Lua Callin example:'''
'''Lua Callin example:''' <pre>{{luacallin|wudget|name|param_list|return_list|description}}</pre>


<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">gadget:AllowUnitCreation</span>  
<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">gadget:'''AllowUnitCreation'''</span>  


<span style="color:#00ff88">( number unitDefID, number builderID, number builderTeam,  
<span style="color:#00ff88">( number unitDefID, number builderID, number builderTeam,  
Line 13: Line 13:




'''Lua Callout example:'''
'''Lua Callout example:'''<pre>{{luacallout|parent_table|name|param_list|return_list|description}}</pre>


<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">Spring.UseTeamResource</span>  
<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">Spring.'''UseTeamResource'''</span>  


<span style="color:#00ff88">( number teamID,  
<span style="color:#00ff88">( number teamID,  

Revision as of 19:32, 1 November 2012

Lua Callin example:

{{luacallin|wudget|name|param_list|return_list|description}}

gadget:AllowUnitCreation

( number unitDefID, number builderID, number builderTeam,
number x, number y, number z,
number facing )

return: bool allow

Called just before unit is created, the boolean return value determines whether or not the creation is permitted.


Lua Callout example:

{{luacallout|parent_table|name|param_list|return_list|description}}

Spring.UseTeamResource

( number teamID,
string "metal" | "energy", number amount |
{ metal = number amount, energy = number amount} )

-> nil | bool hadEnough

Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.


TODO:

Revamp LuaCallinReturn

Complete Spring:SiteMapThoughts

OTAism

Page on spring wiki etiquette / style guide / template usage /namespace conventions ( Spring:PageNamingConventions )

Move all pages in Units- to Units: