Editing MG/Lua
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 140: | Line 140: | ||
'''unitID''' - The ID of the unit to give the kills to.<br /> | '''unitID''' - The ID of the unit to give the kills to.<br /> | ||
'''amount''' - The number of kills given. | '''amount''' - The number of kills given. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===selectUnit(unitID)=== | ===selectUnit(unitID)=== | ||
Line 216: | Line 194: | ||
Parameters:<br /> | Parameters:<br /> | ||
'''pos''' - an array of two elements, specifying the co-ordinates {x,y}. | '''pos''' - an array of two elements, specifying the co-ordinates {x,y}. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===togglePauseGame(pauseStatus)=== | ===togglePauseGame(pauseStatus)=== | ||
Line 265: | Line 227: | ||
===getIsDayTime()=== | ===getIsDayTime()=== | ||
− | Returns if it is day | + | Returns if it is day. ( 1 is day and 0 is night ) |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== storeSaveGameDate(key, value) === | === storeSaveGameDate(key, value) === | ||
Line 424: | Line 380: | ||
</dayNightTriggerEvent> | </dayNightTriggerEvent> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
===triggeredEventAreaEntryUnitId()=== | ===triggeredEventAreaEntryUnitId()=== | ||
Line 433: | Line 386: | ||
===triggeredEventAreaExitUnitId()=== | ===triggeredEventAreaExitUnitId()=== | ||
Returns the unit ID of the unit who exited a registered cell area trigger event. | Returns the unit ID of the unit who exited a registered cell area trigger event. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===getCellTriggerEventCount(eventID)=== | ===getCellTriggerEventCount(eventID)=== | ||
Line 459: | Line 401: | ||
Parameters:<br /> | Parameters:<br /> | ||
'''eventID''' - the ID of a previously registered event. | '''eventID''' - the ID of a previously registered event. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===startTimerEvent()=== | ===startTimerEvent()=== | ||
Line 719: | Line 629: | ||
Code here will be executed whenever the scenario is started. | Code here will be executed whenever the scenario is started. | ||
--> | --> | ||
− | < | + | <global> |
<onSave> | <onSave> | ||
<!-- | <!-- | ||
Code here will be executed when the game is about to save. | Code here will be executed when the game is about to save. | ||
--> | --> | ||
− | < | + | <onSave> |
<onLoad> | <onLoad> | ||
<!-- | <!-- | ||
Code here will be executed when the savegame got loaded. | Code here will be executed when the savegame got loaded. | ||
--> | --> | ||
− | < | + | <onLoad> |
<startup> | <startup> | ||
<!-- | <!-- | ||
Code here will be executed once on startup. | Code here will be executed once on startup. | ||
--> | --> | ||
− | < | + | <startup> |
<unitCreatedOfType type="unitname"> | <unitCreatedOfType type="unitname"> | ||
<!-- | <!-- | ||
Line 790: | Line 700: | ||
[[Category:Scenarios]] | [[Category:Scenarios]] | ||
[[Category:Lua]] | [[Category:Lua]] | ||
− |