This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:failmission [2015/03/19 08:08] – discussion kill warren | crpl:docs:failmission [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| === Description === | === Description === | ||
| + | <note important> | ||
| Fails the current mission and displays the Failed Mission dialog to the player. | Fails the current mission and displays the Failed Mission dialog to the player. | ||
| + | |||
| + | To prevent the issue with the use of FailMission in the editor explained above, make sure to never use it in the editor. You can use a custom function like this to ensure it'll only be called outside of the editor: | ||
| + | < | ||
| + | : | ||
| + | IsEditMode if | ||
| + | ShowTraceLog | ||
| + | " | ||
| + | else | ||
| + | FailMission | ||
| + | endif | ||
| + | </ | ||
| === Examples === | === Examples === | ||
| + | Fail the mission when the game clock reaches exactly one minute (30 frames times 60 seconds). Custom function used from the example above. | ||
| < | < | ||
| - | FailMission | + | GetGameTimeFrames 30 60 mul eq if | 
| - | PauseGame | + |  | 
| + |  | ||
| + | endif | ||
| </ | </ | ||
| + | |||