LuaCallinReturn: Difference between revisions

From Spring
Jump to navigationJump to search
Argh (talk | contribs)
No edit summary
Argh (talk | contribs)
No edit summary
Line 1: Line 1:
=== Lua Call-Ins, with parameters ===
<font style="font-size:300%">Lua Call-Ins, with parameters</font><br><br>
<font style="font-size:90%">
''Here are the known reserved parameter values for all Lua Call-Ins.  If you add new Call-Ins to Spring, please document them here.''
''Here are the known reserved parameter values for all Lua Call-Ins.  If you add new Call-Ins to Spring, please document them here.''


<font style="font-size:90%">


Shutdown() --> none.
==Commands, general-purpose:==
 
<font color=#55ee99>Shutdown()</font> --> none.
 
<font color=#55ee99>LayoutButtons()</font> --> unknown, please document.
 
<font color=#55ee99>ConfigureLayout()</font> --> "command".
 
<font color=#55ee99>CommandNotify()</font> --> "id, params, options", where id = the CommandID
 
<font color=#55ee99>KeyPress()</font> --> "key, mods, isRepeat", where key = keymap, mods = SHIFT, etc.


LayoutButtons() --> unknown, please document.
<font color=#55ee99>KeyRelease()</font> --> "key"


ConfigureLayout() --> "command".
<font color=#55ee99>MouseMove()</font> --> "x, y, dx, dy, button"


CommandNotify() --> "id, params, options", where id = the CommandID
<font color=#55ee99>MousePress()</font> --> "x, y, button"


KeyPress() --> "key, mods, isRepeat", where key = keymap, mods = SHIFT, etc.
<font color=#55ee99>MouseRelease()</font> --> "x, y, button"


KeyRelease() --> "key"
<font color=#55ee99>IsAbove()</font> --> "x, y" where x,y = screen coordinates.


MouseMove() --> "x, y, dx, dy, button"
<font color=#55ee99>GetTooltip()</font> --> "x, y" where x,y = screen coordinates.  Returns WorldTooltip.


MousePress() --> "x, y, button"
<font color=#55ee99>AddConsoleLine()</font> --> "msg, priority"


MouseRelease() --> "x, y, button"
<font color=#55ee99>AllowCommand()</font> --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced"


IsAbove() --> "x, y" where x,y = screen coordinates.
<font color=#55ee99>CommandFallback()</font> --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag"


GetTooltip() --> "x, y" where x,y = screen coordinates.  Returns WorldTooltip.
<font color=#55ee99>AllowUnitCreation()</font> --> "unitDefID, builderID, builderTeam, x, y, z"


AddConsoleLine() --> "msg, priority"
<font color=#55ee99>AllowUnitTransfer()</font> --> "unitID, unitDefID, oldTeam, newTeam, capture"


GroupChanged() --> "groupID" where groupID is the value of Group whose table value changed.
<font color=#55ee99>AllowUnitBuildStep()</font> --> "builderID, builderTeam, unitID, unitDefID, part"


WorldTooltip() --> "ttType, data1, data2, data3" special, should be documented in detail.
<font color=#55ee99>AllowFeatureCreation()</font> --> "featureDefID, teamID, x, y, z"


GameStart() --> unknown, but probably nil.
<font color=#55ee99>AllowFeatureBuildStep()</font> --> unknown, please document.


GameOver() --> none.
<font color=#55ee99>AllowResourceLevel()</font> --> "teamID, res, level"


TeamDied() --> "TeamID" where TeamID = the team that has been eliminated.
<font color=#55ee99>AllowResourceTransfer()</font> --> "teamID, res, level"</font>


UnitCreated() --> "unitID, unitDefID, teamID" ... I hope that's self-explanatory
==Unit-Specific:==


UnitFinished() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitCreated()</font> --> "unitID, unitDefID, teamID" ... I hope that's self-explanatory


UnitFromFactory() --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders"
<font color=#55ee99>UnitFinished()</font> --> "unitID, unitDefID, teamID"


UnitDestroyed() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitFromFactory()</font> --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders"


UnitTaken() --> "unitID, unitDefID, unitTeam, newTeam"
<font color=#55ee99>UnitDestroyed()</font> --> "unitID, unitDefID, teamID"


UnitGiven() --> "unitID, unitDefID, unitTeam, oldTeam"
<font color=#55ee99>UnitTaken()</font> --> "unitID, unitDefID, unitTeam, newTeam"


UnitIdle() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitGiven()</font> --> "unitID, unitDefID, unitTeam, oldTeam"


UnitCommand() --> unknown, please document.
<font color=#55ee99>UnitIdle()</font> --> "unitID, unitDefID, teamID"


UnitSeismicPing() --> "x, y, z, strength"
<font color=#55ee99>UnitCommand()</font> --> unknown, please document.


UnitEnteredRadar() --> "unitID, unitTeam"
<font color=#55ee99>UnitSeismicPing()</font> --> "x, y, z, strength"


UnitEnteredLos() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitEnteredRadar()</font> --> "unitID, unitTeam"


UnitLeftRadar() --> "unitID, unitTeam"
<font color=#55ee99>UnitEnteredLos()</font> --> "unitID, unitDefID, teamID"


UnitLeftLos() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitLeftRadar()</font> --> "unitID, unitTeam"


UnitLoaded() --> "unitID, unitDefID, unitTeam, transportID, transportTeam"
<font color=#55ee99>UnitLeftLos()</font> --> "unitID, unitDefID, teamID"


UnitUnloaded() --> "unitID, unitDefID, teamID, transportID"
<font color=#55ee99>UnitLoaded()</font> --> "unitID, unitDefID, unitTeam, transportID, transportTeam"


UnitCloaked--> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitUnloaded()</font> --> "unitID, unitDefID, teamID, transportID"


UnitDecloaked--> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitCloaked()</font> --> "unitID, unitDefID, teamID"


UnitMoveFailed--> "unitID, unitDefID, unitTeam"
<font color=#55ee99>UnitDecloaked)</font>--> "unitID, unitDefID, teamID"


StockpileChanged--> "unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount"
<font color=#55ee99>UnitMoveFailed()</font> --> "unitID, unitDefID, unitTeam"


UnitEnteredWater() --> "unitID, unitDefID, teamID"
<font color=#55ee99>StockpileChanged()</font> --> "unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount"


UnitEnteredAir() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitEnteredWater()</font> --> "unitID, unitDefID, teamID"


UnitLeftWater() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitEnteredAir()</font> --> "unitID, unitDefID, teamID"


UnitLeftAir() --> "unitID, unitDefID, teamID"
<font color=#55ee99>UnitLeftWater()</font> --> "unitID, unitDefID, teamID"


FeatureCreated() --> "featureID, allyTeam"
<font color=#55ee99>UnitLeftAir()</font> --> "unitID, unitDefID, teamID"


FeatureDestroyed() --> "featureID, allyTeam"
==Feature-Specific:==


DrawGenesis() --> none.
<font color=#55ee99>FeatureCreated()</font> --> "featureID, allyTeam"


DrawWorld() --> none.
<font color=#55ee99>FeatureDestroyed()</font> --> "featureID, allyTeam"


DrawWorldPreUnit() --> none.
==Drawing:==


DrawWorldShadow() --> none.
<font color=#55ee99>DrawGenesis()</font> --> none.


DrawWorldReflection() --> none.
<font color=#55ee99>DrawWorld()</font> --> none.


DrawWorldRefraction() --> none.
<font color=#55ee99>DrawWorldPreUnit()</font> --> none.


DrawScreenEffects() --> "vsx, vsy" where vsx, vsy are screen coords.
<font color=#55ee99>DrawWorldShadow()</font> --> none.


DrawScreen() --> none.
<font color=#55ee99>DrawWorldReflection()</font> --> none.


DrawInMiniMap() --> "sx, sy" where sx,sy are values relative to the minimap's position and scale.
<font color=#55ee99>DrawWorldRefraction()</font> --> none.


Explosion() --> "weaponID, px, py, pz, ownerID"
<font color=#55ee99>DrawScreenEffects()</font> --> "vsx, vsy" where vsx, vsy are screen coords.


ShockFront() --> "power, dx, dy, dz"
<font color=#55ee99>DrawScreen()</font> --> none.


GameFrame() --> "frameNum"
<font color=#55ee99>DrawInMiniMap()</font> --> "sx, sy" where sx,sy are values relative to the minimap's position and scale.


CobCallback() --> unknown, marked FIXME.
==Game Events:==


AllowCommand() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced"
<font color=#55ee99>Explosion()</font> --> "weaponID, px, py, pz, ownerID"


CommandFallback() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag"
<font color=#55ee99>ShockFront()</font> --> "power, dx, dy, dz"


AllowUnitCreation() --> "unitDefID, builderID, builderTeam, x, y, z"
<font color=#55ee99>GameFrame()</font> --> "frameNum"


AllowUnitTransfer() --> "unitID, unitDefID, oldTeam, newTeam, capture"
<font color=#55ee99>CobCallback()</font> --> unknown, marked FIXME.


AllowUnitBuildStep() --> "builderID, builderTeam, unitID, unitDefID, part"
<font color=#55ee99>GroupChanged()</font> --> "groupID" where groupID is the value of Group whose table value changed.


AllowFeatureCreation() --> "featureDefID, teamID, x, y, z"
<font color=#55ee99>WorldTooltip()</font> --> "ttType, data1, data2, data3" special, should be documented in detail.


AllowFeatureBuildStep() --> unknown, please document.
<font color=#55ee99>GameStart()</font> --> unknown, but probably nil.


AllowResourceLevel() --> "teamID, res, level"
<font color=#55ee99>GameOver()</font> --> none.


AllowResourceTransfer() --> "teamID, res, level"</font>
<font color=#55ee99>TeamDied()</font> --> "TeamID" where TeamID = the team that has been eliminated.

Revision as of 03:21, 5 November 2008

Lua Call-Ins, with parameters

Here are the known reserved parameter values for all Lua Call-Ins. If you add new Call-Ins to Spring, please document them here.


Commands, general-purpose:

Shutdown() --> none.

LayoutButtons() --> unknown, please document.

ConfigureLayout() --> "command".

CommandNotify() --> "id, params, options", where id = the CommandID

KeyPress() --> "key, mods, isRepeat", where key = keymap, mods = SHIFT, etc.

KeyRelease() --> "key"

MouseMove() --> "x, y, dx, dy, button"

MousePress() --> "x, y, button"

MouseRelease() --> "x, y, button"

IsAbove() --> "x, y" where x,y = screen coordinates.

GetTooltip() --> "x, y" where x,y = screen coordinates. Returns WorldTooltip.

AddConsoleLine() --> "msg, priority"

AllowCommand() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced"

CommandFallback() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag"

AllowUnitCreation() --> "unitDefID, builderID, builderTeam, x, y, z"

AllowUnitTransfer() --> "unitID, unitDefID, oldTeam, newTeam, capture"

AllowUnitBuildStep() --> "builderID, builderTeam, unitID, unitDefID, part"

AllowFeatureCreation() --> "featureDefID, teamID, x, y, z"

AllowFeatureBuildStep() --> unknown, please document.

AllowResourceLevel() --> "teamID, res, level"

AllowResourceTransfer() --> "teamID, res, level"

Unit-Specific:

UnitCreated() --> "unitID, unitDefID, teamID" ... I hope that's self-explanatory

UnitFinished() --> "unitID, unitDefID, teamID"

UnitFromFactory() --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders"

UnitDestroyed() --> "unitID, unitDefID, teamID"

UnitTaken() --> "unitID, unitDefID, unitTeam, newTeam"

UnitGiven() --> "unitID, unitDefID, unitTeam, oldTeam"

UnitIdle() --> "unitID, unitDefID, teamID"

UnitCommand() --> unknown, please document.

UnitSeismicPing() --> "x, y, z, strength"

UnitEnteredRadar() --> "unitID, unitTeam"

UnitEnteredLos() --> "unitID, unitDefID, teamID"

UnitLeftRadar() --> "unitID, unitTeam"

UnitLeftLos() --> "unitID, unitDefID, teamID"

UnitLoaded() --> "unitID, unitDefID, unitTeam, transportID, transportTeam"

UnitUnloaded() --> "unitID, unitDefID, teamID, transportID"

UnitCloaked() --> "unitID, unitDefID, teamID"

UnitDecloaked)--> "unitID, unitDefID, teamID"

UnitMoveFailed() --> "unitID, unitDefID, unitTeam"

StockpileChanged() --> "unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount"

UnitEnteredWater() --> "unitID, unitDefID, teamID"

UnitEnteredAir() --> "unitID, unitDefID, teamID"

UnitLeftWater() --> "unitID, unitDefID, teamID"

UnitLeftAir() --> "unitID, unitDefID, teamID"

Feature-Specific:

FeatureCreated() --> "featureID, allyTeam"

FeatureDestroyed() --> "featureID, allyTeam"

Drawing:

DrawGenesis() --> none.

DrawWorld() --> none.

DrawWorldPreUnit() --> none.

DrawWorldShadow() --> none.

DrawWorldReflection() --> none.

DrawWorldRefraction() --> none.

DrawScreenEffects() --> "vsx, vsy" where vsx, vsy are screen coords.

DrawScreen() --> none.

DrawInMiniMap() --> "sx, sy" where sx,sy are values relative to the minimap's position and scale.

Game Events:

Explosion() --> "weaponID, px, py, pz, ownerID"

ShockFront() --> "power, dx, dy, dz"

GameFrame() --> "frameNum"

CobCallback() --> unknown, marked FIXME.

GroupChanged() --> "groupID" where groupID is the value of Group whose table value changed.

WorldTooltip() --> "ttType, data1, data2, data3" special, should be documented in detail.

GameStart() --> unknown, but probably nil.

GameOver() --> none.

TeamDied() --> "TeamID" where TeamID = the team that has been eliminated.