User:Flozi: Difference between revisions
now with proposed template call |
m example without shadow on function name |
||
| Line 15: | Line 15: | ||
'''Lua Callout example:'''<pre>{{luacallout|parent_table|name|param_list|return_list|description}}</pre> | '''Lua Callout example:'''<pre>{{luacallout|parent_table|name|param_list|return_list|description}}</pre> | ||
<span style="color:#cccccc | <span style="color:#cccccc;">Spring.'''UseTeamResource'''</span> | ||
<span style="color:#00ff88">( number teamID, | <span style="color:#00ff88">( number teamID, | ||
Revision as of 20:21, 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
Page on spring wiki etiquette / style guide / template usage /namespace conventions ( Spring:PageNamingConventions )