equal
deleted
inserted
replaced
237 Because this function is called *before* victories are checked, this is useful to set up your victory conditions here. |
237 Because this function is called *before* victories are checked, this is useful to set up your victory conditions here. |
238 |
238 |
239 === <tt>onSkipTurn()</tt> (0.9.24) === |
239 === <tt>onSkipTurn()</tt> (0.9.24) === |
240 This function calls when a hog skips its turn. |
240 This function calls when a hog skips its turn. |
241 |
241 |
|
242 === <tt>onGameResult(winningClan)</tt> (0.9.25) === |
|
243 This function calls when the game ends with a winner or in a draw. If a clan wins, `winningClan` is the clan ID of the winning clan. If the game ends in a draw, `winningClan` is set to -1f. |
|
244 |
242 === <tt>onSuddenDeath()</tt> === |
245 === <tt>onSuddenDeath()</tt> === |
243 This function is called on the start of Sudden Death. |
246 This function is called on the start of Sudden Death. |
244 |
247 |
245 === <tt>onGearAdd(gearUid)</tt> === |
248 === <tt>onGearAdd(gearUid)</tt> === |
246 This function is called when a new gear is added. Useful in combination with `GetGearType(gearUid)`. |
249 This function is called when a new gear is added. Useful in combination with `GetGearType(gearUid)`. |
1043 ==== <tt>!SetTurnTimeLeft(newTurnTimeLeft)</tt> (0.9.25) ==== |
1046 ==== <tt>!SetTurnTimeLeft(newTurnTimeLeft)</tt> (0.9.25) ==== |
1044 Set the remaining turn time in milliseconds. The current remaining turn time can be read from the variable `TurnTimeLeft`. |
1047 Set the remaining turn time in milliseconds. The current remaining turn time can be read from the variable `TurnTimeLeft`. |
1045 |
1048 |
1046 ==== <tt>!SetReadyTimeLeft(newReadyTimeLeft)</tt> (0.9.25) ==== |
1049 ==== <tt>!SetReadyTimeLeft(newReadyTimeLeft)</tt> (0.9.25) ==== |
1047 Set the remaining ready time in milliseconds. This function should only be called in onNewTurn. The current remaining ready time can be read from the variable `ReadyTimeLeft`. |
1050 Set the remaining ready time in milliseconds. This function should only be called in onNewTurn. The current remaining ready time can be read from the variable `ReadyTimeLeft`. |
|
1051 |
|
1052 ==== <tt>!SetTurnTimePaused(isPaused)</tt> (0.9.25) ==== |
|
1053 Pauses the turn time indefinitely if `isPaused` is set to `true`, disabled the turn time pause if `isPaused` is set to `false`. |
|
1054 |
|
1055 ==== <tt>!GetTurnTimePaused()</tt> (0.9.25) ==== |
|
1056 Returns `true` if the turn time is currently paused by `SetTurnTimePaused`, otherwise returns `false`. |
1048 |
1057 |
1049 ==== <tt>!EndGame()</tt> ==== |
1058 ==== <tt>!EndGame()</tt> ==== |
1050 Makes the game end. |
1059 Makes the game end. |
1051 |
1060 |
1052 === Environment === |
1061 === Environment === |
1415 There are some special campaign variables which are used by Hedgewars to determine which missions to display in the campaign menu. This is described [ConfigurationFiles#%5BCampaign%20%3CCAMPAIGN_NAME%3E%5D here]. |
1424 There are some special campaign variables which are used by Hedgewars to determine which missions to display in the campaign menu. This is described [ConfigurationFiles#%5BCampaign%20%3CCAMPAIGN_NAME%3E%5D here]. |
1416 |
1425 |
1417 ==== <tt>!GetCampaignVar(varname)</tt> ==== |
1426 ==== <tt>!GetCampaignVar(varname)</tt> ==== |
1418 Returns the value of the campaign variable `varname` as a string. See also `SaveCampaignVar`. |
1427 Returns the value of the campaign variable `varname` as a string. See also `SaveCampaignVar`. |
1419 |
1428 |
|
1429 ==== <tt>!SaveMissionVar(varname, value)</tt> (0.9.25) ==== |
|
1430 Stores the value `value` (a string) into the mission variable `varname` (also a string). A mission variable is like a campaign variable, but it applies for singleplayer missions only (Training/Challenge/Scenario), excluding campaign missions. |
|
1431 |
|
1432 ==== <tt>!GetMissionVar(varname)</tt> (0.9.25) ==== |
|
1433 Returns the value of the mission variable `varname` as a string. See also `SaveMissionVar`. |
|
1434 |
1420 == Functions affecting the GUI == |
1435 == Functions affecting the GUI == |
1421 |
1436 |
1422 === <tt>!AddCaption(text)</tt> === |
1437 === <tt>!AddCaption(text)</tt> === |
1423 Display an event text in the upper part of the screen. The text will be white and the caption group will be `capgrpMessage`. |
1438 Display an event text in the upper part of the screen. The text will be white and the caption group will be `capgrpMessage`. |
1424 |
1439 |