Legacy GM How to make an alarm that starts & loops in the step event ?

I'm making an enemy object where the enemy will go on a specific path to patrol.Then he will stop at a certain point to look around for the player.

I planned to make him change his sprite direction every 2 seconds(Enemies vision's for another day)but i seems to stuck here.I want the alarm to start as soon as he stops in the middle of the path,but i don't know how to activate the alarm in the step event.

Any ideas ?
 

TheouAegis

Member
Set an alarm when you start the path. When the alarm triggers, set a different alarm and set path_speed to 0. While the other alarm is counting down, have the enemy look around. When the alarm finishes counting down, set the first alarm again.

Code:
alarm[0] = path_length(path_index)/2;
Code:
path_speed = 0;
alarm[1] = room_speed * 2;
Code:
alarm[0] = path_length(path_index)/2;
path_speed = walkspeed;
 
Top