User:Flozi: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
possible Lua Callin "look'n'feel"
Flozi (talk | contribs)
example of callin vs. callout
Line 1: Line 1:
<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">AllowUnitCreation</span>  
'''Lua Callin example:'''
 
<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 10: Line 12:




TODO:
 
'''Lua Callout example:'''
 
<span style="color:#cccccc;text-shadow: #111 2px 2px 2px;">Spring.UseTeamResource</span>
 
<span style="color:#00ff88">( number teamID,
<br/>  string "metal" | "energy", number amount |
<br/>  { metal = number amount, energy = number amount})
 
<span style="color:#ffff88">-> nil | bool hadEnough</span>
 
Imposes a one-off usage of resources on the given team. The return value indicates [i don't have a clue].
 
 
'''TODO:'''


Revamp [[LuaCallinReturn]]
Revamp [[LuaCallinReturn]]

Revision as of 18:51, 1 November 2012

Lua Callin example:

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:

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 [i don't have a clue].


TODO:

Revamp LuaCallinReturn

Complete Spring:SiteMapThoughts

OTAism

Page on spring wiki etiquette / style guide / namespace conventions

Change all instances of 'depreciated' to 'deprecated'.

Move all pages in Units- to Units: