Skip to content

set_mode

Prototypeint set_mode(int mode)

set_mode() will set the game's state to mode. This will almost always be used in start-1.c or equivalent to change the game from mouse mode to normal mode.

c
// excerpt from start-1.c
set_mode(2);

set_mode() merely returns the mode that was set.

ModeNameDescription
0StartupWhen the game first starts. Will automatically change to Mode 1.
1Title-screenWhen the player interacts with the title screen. Must receive DinkC command to go onto Mode 2.
2IntermediaryLoads the current screen, gets rid of the mouse object if set_keep_mouse() was not set. Automatically changes to Mode 3.
3NormalNormal gameplay commences.

WARNING

Please note that set_mode(2) will trigger a draw_screen(), but it will not occur until the next wait() line. This can cause some issues when loading from the title screen in some circumstances. To make sure no issues occur you can edit the start2.c (the script attached to the "continue" buttton on the title screen), and add a wait(0) before the load_game() line. Or you can just download the start2.c script below with this fix already applied: Fixed start2.c