Thing_SetGoal — sends a monster on a patrol route.
Thing_SetGoal (tid, goal, delay);
Thing_SetGoal ( tid, // Thing ID of monster to send to a patrol point goal, // Thing ID to send the monster to delay // Tics before the monster starts moving toward the patrol point );
This special's function is the same whether you activate it on a line or use it in a script.
This special has a special activation mode that can be used by assigning it to a monster's special. If you give a monster the Thing_SetGoal special with tid set to 0, then this special will be activated for that monster immediately when the level is first loaded. This allows you to create monsters that automatically start on a patrol without using any scripting.
If the monster sees anything it considers an enemy, such as a player or another monster (thanks to Thing_Hate), it will leave its patrol to attack its new target. Once its enemy has been dispatched and it can see no more foes, the monster will resume its patrol where it left off.
Set the current monster moving toward the patrol point with TID 50 immediately:
Thing_SetGoal (0, 50, 0);
Set any monsters with TID 1 moving toward the patrol point with TID 40 after two seconds:
Thing_SetGoal (1, 40, 70);
ZDoom 1.16