User:Flozi: Difference between revisions
→Template:Tag: courier is too thin, try lucida |
→Scratchpad: do it with templates |
||
| Line 3: | Line 3: | ||
= Scratchpad = | = Scratchpad = | ||
== Template:API proposal == | == Template:API proposal == | ||
| Line 52: | Line 17: | ||
}}</pre> | }}</pre> | ||
{{prefix|Spring.}}{{name|UseTeamResource}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|"metal"}} {{pipe}} {{value|"energy"}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}} | |||
-> | {{var|-> {{type|nil}} {{pipe}} {{type|bool}} hadEnough}} | ||
:Deduct the specified amount from the team's metal or energy resource. | :Deduct the specified amount from the team's metal or energy resource. | ||
| Line 74: | Line 39: | ||
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, | |||
{{type|number}} newTeam, {{type|bool}} capture)}} | |||
return: | return: {{var|{{type|bool}} allow}} | ||
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted. | :Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted. | ||
Revision as of 21:26, 16 June 2016
My User Subpages
Scratchpad
Template:API proposal
Note that the number of 'arg1' etc is fixed (i.e. 10) but can be omitted without issue. the 'type' template is just a way to make inserting different styles within the param list easier, Template:Pipe already exists and is required as it is a special char within mediawiki syntax, could use {{!}} as a shorter alternative to pipe.
{{API <!-- Callout example -->
|prefix = Spring
|name = UseTeamResource
|arg1 = {{type|number}} teamID
|arg2 = {{type|string}} "metal" {{pipe}} "energy"
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough
|info = 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.
}}
Spring.UseTeamResource(number teamID, string "metal" | "energy", number amount | { metal = number amount, energy = number amount })
-> nil | bool hadEnough
- Deduct the specified amount from the team's metal or energy resource.
vs.
{{API <!-- Callin example -->
|prefix = addon <!-- May use gadget: instead? -->
|name = AllowUnitTransfer
|arg1 = {{type|number}} unitID
|arg2 = {{type|number}} unitDefID
|arg3 = {{type|number}} oldTeam
|arg4 = {{type|number}} newTeam
|arg5 = {{type|bool}} capture
|return = {{type|bool}} allow <!-- note that this is a different entry than output above -->
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
}}
addon.AllowUnitTransfer(number unitID, number unitDefID, number oldTeam,
number newTeam, bool capture)
return: bool allow
- Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.
TODO:
Major
- Category:ShowCase template, main page, S44 & MCL as examples
- Category:Tutorial
- Continue to improve Lua:Callins - Fill in blank explanations
- Clickable / right-click copy paste-able anchors in {{tag}} et al
- Assimp build upon, metadata doc, split tutorial again >_>
- Cleanup old Category:Map_making into new Category:Map Dev
Minor
- Page on spring wiki etiquette (SpringWiki) / style guide & template usage (Mapdev:WikiGuide) /namespace conventions (Spring:PageNamingConventions) - pages are good already; put these in revamped community portal?
- Move all pages in Animation- to Animation:
- Continue to improve Gamedev:Main up to the high standard of Mapdev:Main
Undocumented Features
- cmdcolors.txt (c.f. GUI modifications in SVN)
- ctrlpanel.txt (c.f. as above)
- isolated mode (isolated.txt 99+ c.f. portable/isolation mode, Spring manpages)
Template:LuaCallout Examples
{{{prefix}}}UseTeamResource
( {{{arg1}}},
{{{arg2}}},
{{{arg3}}},
{{{arg4}}},
{{{arg5}}},
{{{arg6}}},
{{{arg7}}},
{{{arg8}}},
{{{arg9}}} )
return: nil | bool hadEnough