Breaks

Is there a way I can make breaks? I have two subevemts, and sometimes one will activate the other. Is there a way I can tell the evemt to stop after the sub evemt is completed?

If you have something like this, and the problem is that the first sub-event makes the second to run, for example:

[code]Conditions: F11 key is pressed
Trigger once
Actions: No actions

    Conditions: Variable "fullscreen" = 0
    Actions: Activate fullscreen
             Do = 1 to variable "fullscreen"

    Conditions: Variable "fullscreen" = 1
    Actions: Deactivate fullscreen
             Do = 0 to variable "fullscreen"

[/code]
Here the first sub-event activates the fullscreen and set the variable = 1, so the next time F11 is pressed the second sub-event would deactivate the fullscreen and set the variable = 0 again, but as the second sub-event runs just after the first one, the fullscreen is activated and then deactivated in the same frame, and you never get the fullscreen activated :neutral_face:

To solve this I use an “else” extra variable, this way:

[code]Conditions: F11 key is pressed
Trigger once
Actions: Do = 1 to variable “else”

    Conditions: Variable "fullscreen" = 0
    Actions: Activate fullscreen
             Do = 1 to variable "fullscreen"
             Do = 0 to variable "else"

    Conditions: Variable "fullscreen" = 1
                Variable "else" = 1
    Actions: Deactivate fullscreen
             Do = 0 to variable "fullscreen"

[/code]
The parent event resets the “else” = 1. If the first sub-event is executed it set “else” = 0 and the second sub-event will not run, else the second event will run (because the first didn’t) :slight_smile:

As far as I know there’s none. You just have to put on top the subevent which less likely to cause the other subevent to happen. You can also follow what Lizard said