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 ===
''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:80%">
<font style="font-size:90%">


Shutdown() --> none.
Shutdown() --> none.
LayoutButtons() --> unknown, please document.
LayoutButtons() --> unknown, please document.
ConfigureLayout() --> "command".
ConfigureLayout() --> "command".
CommandNotify() --> "id, params, options", where id = the CommandID
CommandNotify() --> "id, params, options", where id = the CommandID
KeyPress() --> "key, mods, isRepeat", where key = keymap, mods = SHIFT, etc.
KeyPress() --> "key, mods, isRepeat", where key = keymap, mods = SHIFT, etc.
KeyRelease() --> "key"
KeyRelease() --> "key"
MouseMove() --> "x, y, dx, dy, button"
MouseMove() --> "x, y, dx, dy, button"
MousePress() --> "x, y, button"
MousePress() --> "x, y, button"
MouseRelease() --> "x, y, button"
MouseRelease() --> "x, y, button"
IsAbove() --> "x, y" where x,y = screen coordinates.
IsAbove() --> "x, y" where x,y = screen coordinates.
GetTooltip() --> "x, y" where x,y = screen coordinates.  Returns WorldTooltip.
GetTooltip() --> "x, y" where x,y = screen coordinates.  Returns WorldTooltip.
AddConsoleLine() --> "msg, priority"
AddConsoleLine() --> "msg, priority"
GroupChanged() --> "groupID" where groupID is the value of Group whose table value changed.
GroupChanged() --> "groupID" where groupID is the value of Group whose table value changed.
WorldTooltip() --> "ttType, data1, data2, data3" special, should be documented in detail.
WorldTooltip() --> "ttType, data1, data2, data3" special, should be documented in detail.


GameStart() --> unknown, but probably nil.
GameStart() --> unknown, but probably nil.
GameOver() --> none.
GameOver() --> none.
TeamDied() --> "TeamID" where TeamID = the team that has been eliminated.
TeamDied() --> "TeamID" where TeamID = the team that has been eliminated.


UnitCreated() --> "unitID, unitDefID, teamID" ... I hope that's self-explanatory
UnitCreated() --> "unitID, unitDefID, teamID" ... I hope that's self-explanatory
UnitFinished() --> "unitID, unitDefID, teamID"
UnitFinished() --> "unitID, unitDefID, teamID"
UnitFromFactory() --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders"
UnitFromFactory() --> "unitID, unitDefID, unitTeam, factID, factDefID, userOrders"
UnitDestroyed() --> "unitID, unitDefID, teamID"
UnitDestroyed() --> "unitID, unitDefID, teamID"
UnitTaken() --> "unitID, unitDefID, unitTeam, newTeam"
UnitTaken() --> "unitID, unitDefID, unitTeam, newTeam"
UnitGiven() --> "unitID, unitDefID, unitTeam, oldTeam"
UnitGiven() --> "unitID, unitDefID, unitTeam, oldTeam"
UnitIdle() --> "unitID, unitDefID, teamID"
UnitIdle() --> "unitID, unitDefID, teamID"
UnitCommand() -->  unknown, please document.
UnitCommand() -->  unknown, please document.
UnitSeismicPing() --> "x, y, z, strength"
UnitSeismicPing() --> "x, y, z, strength"
UnitEnteredRadar() --> "unitID, unitTeam"
UnitEnteredRadar() --> "unitID, unitTeam"
UnitEnteredLos() --> "unitID, unitDefID, teamID"
UnitEnteredLos() --> "unitID, unitDefID, teamID"
UnitLeftRadar() --> "unitID, unitTeam"
UnitLeftRadar() --> "unitID, unitTeam"
UnitLeftLos() --> "unitID, unitDefID, teamID"
UnitLeftLos() --> "unitID, unitDefID, teamID"
UnitLoaded() --> "unitID, unitDefID, unitTeam, transportID, transportTeam"
UnitLoaded() --> "unitID, unitDefID, unitTeam, transportID, transportTeam"
UnitUnloaded() --> "unitID, unitDefID, teamID, transportID"
UnitUnloaded() --> "unitID, unitDefID, teamID, transportID"
UnitCloaked--> "unitID, unitDefID, teamID"
UnitCloaked--> "unitID, unitDefID, teamID"
UnitDecloaked--> "unitID, unitDefID, teamID"
UnitDecloaked--> "unitID, unitDefID, teamID"
UnitMoveFailed--> "unitID, unitDefID, unitTeam"
UnitMoveFailed--> "unitID, unitDefID, unitTeam"
StockpileChanged--> "unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount"
StockpileChanged--> "unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount"


UnitEnteredWater() --> "unitID, unitDefID, teamID"
UnitEnteredWater() --> "unitID, unitDefID, teamID"
UnitEnteredAir() --> "unitID, unitDefID, teamID"
UnitEnteredAir() --> "unitID, unitDefID, teamID"
UnitLeftWater() --> "unitID, unitDefID, teamID"
UnitLeftWater() --> "unitID, unitDefID, teamID"
UnitLeftAir() --> "unitID, unitDefID, teamID"
UnitLeftAir() --> "unitID, unitDefID, teamID"


FeatureCreated() --> "featureID, allyTeam"
FeatureCreated() --> "featureID, allyTeam"
FeatureDestroyed() --> "featureID, allyTeam"
FeatureDestroyed() --> "featureID, allyTeam"


DrawGenesis() --> none.
DrawGenesis() --> none.
DrawWorld() --> none.
DrawWorld() --> none.
DrawWorldPreUnit() --> none.
DrawWorldPreUnit() --> none.
DrawWorldShadow() --> none.
DrawWorldShadow() --> none.
DrawWorldReflection() --> none.
DrawWorldReflection() --> none.
DrawWorldRefraction() --> none.
DrawWorldRefraction() --> none.
DrawScreenEffects() --> "vsx, vsy" where vsx, vsy are screen coords.
DrawScreenEffects() --> "vsx, vsy" where vsx, vsy are screen coords.
DrawScreen() --> none.
DrawScreen() --> none.
DrawInMiniMap() --> "sx, sy" where sx,sy are values relative to the minimap's position and scale.
DrawInMiniMap() --> "sx, sy" where sx,sy are values relative to the minimap's position and scale.


Explosion() --> "weaponID, px, py, pz, ownerID"
Explosion() --> "weaponID, px, py, pz, ownerID"
ShockFront() --> "power, dx, dy, dz"
ShockFront() --> "power, dx, dy, dz"


GameFrame() --> "frameNum"
GameFrame() --> "frameNum"
CobCallback() --> unknown, marked FIXME.
CobCallback() --> unknown, marked FIXME.
AllowCommand() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced"
AllowCommand() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced"
CommandFallback() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag"
CommandFallback() --> "unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag"
AllowUnitCreation() --> "unitDefID, builderID, builderTeam, x, y, z"
AllowUnitCreation() --> "unitDefID, builderID, builderTeam, x, y, z"
AllowUnitTransfer() --> "unitID, unitDefID, oldTeam, newTeam, capture"
AllowUnitTransfer() --> "unitID, unitDefID, oldTeam, newTeam, capture"
AllowUnitBuildStep() --> "builderID, builderTeam, unitID, unitDefID, part"
AllowUnitBuildStep() --> "builderID, builderTeam, unitID, unitDefID, part"
AllowFeatureCreation() --> "featureDefID, teamID, x, y, z"
AllowFeatureCreation() --> "featureDefID, teamID, x, y, z"
AllowFeatureBuildStep() --> unknown, please document.
AllowFeatureBuildStep() --> unknown, please document.
AllowResourceLevel() --> "teamID, res, level"
AllowResourceLevel() --> "teamID, res, level"
AllowResourceTransfer() --> "teamID, res, level"
 
AllowResourceTransfer() --> "teamID, res, level"</font>

Revision as of 03:00, 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.

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"

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.

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"

FeatureCreated() --> "featureID, allyTeam"

FeatureDestroyed() --> "featureID, allyTeam"

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.

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

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

GameFrame() --> "frameNum"

CobCallback() --> unknown, marked FIXME.

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"