• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

(solved) What is happening here with event_user(0)?

J

jb skaggs

Guest
Struggling with getting my memories back after chemo- its like starting over. Anyways... In the code below from a example I installed to study I found this event_user(0).

GML:
with(objUnit) {
    target_x = get_snapped(mouse_x, CELL_SIZE) + CELL_SIZE / 2;
    target_y = get_snapped(mouse_y, CELL_SIZE) + CELL_SIZE / 2;
    target = instance_position(target_x, target_y, CLICKABLE_CELL);
    event_user(0);
}
Nowhere else in the game files or scripts is it called or referenced.

The game manual just said it was a user created event.


So what is it doing?

thanks
 
In addition to the usual events in objects (Create, Step, Destroy, etc...) you can also define your own events which are called with this function. objUnit should have a User Event 0 event with code to perform.
 
Top