This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:failmission [2019/03/22 19:59] – add warning about bug Grabz | crpl:docs:failmission [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| <note important> | <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 | ||
| </ | </ | ||
| + | |||