LuaCallinReturn: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
= | <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.'' | ||
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. | |||
<font color=#55ee99>KeyRelease()</font> --> "key" | |||
<font color=#55ee99>MouseMove()</font> --> "x, y, dx, dy, button" | |||
<font color=#55ee99>MousePress()</font> --> "x, y, button" | |||
<font color=#55ee99>MouseRelease()</font> --> "x, y, button" | |||
<font color=#55ee99>IsAbove()</font> --> "x, y" where x,y = screen coordinates. | |||
<font color=#55ee99>GetTooltip()</font> --> "x, y" where x,y = screen coordinates. Returns WorldTooltip. | |||
<font color=#55ee99>AddConsoleLine()</font> --> "msg, priority" | |||
<font color=#55ee99>AllowCommand()</font> --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced" | |||
<font color=#55ee99>CommandFallback()</font> --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag" | |||
<font color=#55ee99>AllowUnitCreation()</font> --> "unitDefID, builderID, builderTeam, x, y, z" | |||
<font color=#55ee99>AllowUnitTransfer()</font> --> "unitID, unitDefID, oldTeam, newTeam, capture" | |||
<font color=#55ee99>AllowUnitBuildStep()</font> --> "builderID, builderTeam, unitID, unitDefID, part" | |||
<font color=#55ee99>AllowFeatureCreation()</font> --> "featureDefID, teamID, x, y, z" | |||
<font color=#55ee99>AllowFeatureBuildStep()</font> --> unknown, please document. | |||
<font color=#55ee99>AllowResourceLevel()</font> --> "teamID, res, level" | |||
<font color=#55ee99>AllowResourceTransfer()</font> --> "teamID, res, level"</font> | |||
==Unit-Specific:== | |||
<font color=#55ee99>UnitCreated()</font> --> "unitID, unitDefID, teamID" ... I hope that's self-explanatory | |||
<font color=#55ee99>UnitFinished()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitFromFactory()</font> --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders" | |||
<font color=#55ee99>UnitDestroyed()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitTaken()</font> --> "unitID, unitDefID, unitTeam, newTeam" | |||
<font color=#55ee99>UnitGiven()</font> --> "unitID, unitDefID, unitTeam, oldTeam" | |||
<font color=#55ee99>UnitIdle()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitCommand()</font> --> unknown, please document. | |||
<font color=#55ee99>UnitSeismicPing()</font> --> "x, y, z, strength" | |||
<font color=#55ee99>UnitEnteredRadar()</font> --> "unitID, unitTeam" | |||
<font color=#55ee99>UnitEnteredLos()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitLeftRadar()</font> --> "unitID, unitTeam" | |||
<font color=#55ee99>UnitLeftLos()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitLoaded()</font> --> "unitID, unitDefID, unitTeam, transportID, transportTeam" | |||
<font color=#55ee99>UnitUnloaded()</font> --> "unitID, unitDefID, teamID, transportID" | |||
<font color=#55ee99>UnitCloaked()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitDecloaked)</font>--> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitMoveFailed()</font> --> "unitID, unitDefID, unitTeam" | |||
<font color=#55ee99>StockpileChanged()</font> --> "unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount" | |||
<font color=#55ee99>UnitEnteredWater()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitEnteredAir()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitLeftWater()</font> --> "unitID, unitDefID, teamID" | |||
<font color=#55ee99>UnitLeftAir()</font> --> "unitID, unitDefID, teamID" | |||
==Feature-Specific:== | |||
<font color=#55ee99>FeatureCreated()</font> --> "featureID, allyTeam" | |||
<font color=#55ee99>FeatureDestroyed()</font> --> "featureID, allyTeam" | |||
==Drawing:== | |||
<font color=#55ee99>DrawGenesis()</font> --> none. | |||
<font color=#55ee99>DrawWorld()</font> --> none. | |||
<font color=#55ee99>DrawWorldPreUnit()</font> --> none. | |||
<font color=#55ee99>DrawWorldShadow()</font> --> none. | |||
<font color=#55ee99>DrawWorldReflection()</font> --> none. | |||
<font color=#55ee99>DrawWorldRefraction()</font> --> none. | |||
<font color=#55ee99>DrawScreenEffects()</font> --> "vsx, vsy" where vsx, vsy are screen coords. | |||
<font color=#55ee99>DrawScreen()</font> --> none. | |||
<font color=#55ee99>DrawInMiniMap()</font> --> "sx, sy" where sx,sy are values relative to the minimap's position and scale. | |||
==Game Events:== | |||
<font color=#55ee99>Explosion()</font> --> "weaponID, px, py, pz, ownerID" | |||
<font color=#55ee99>ShockFront()</font> --> "power, dx, dy, dz" | |||
<font color=#55ee99>GameFrame()</font> --> "frameNum" | |||
<font color=#55ee99>CobCallback()</font> --> unknown, marked FIXME. | |||
<font color=#55ee99>GroupChanged()</font> --> "groupID" where groupID is the value of Group whose table value changed. | |||
<font color=#55ee99>WorldTooltip()</font> --> "ttType, data1, data2, data3" special, should be documented in detail. | |||
<font color=#55ee99>GameStart()</font> --> unknown, but probably nil. | |||
<font color=#55ee99>GameOver()</font> --> none. | |||
<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.