Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Difference between revisions of "movetogoal"

From Quake Wiki

(Created page with "====Syntax:==== <code>void movetogoal(float dist)</code> This is the primary means of navigation available to monsters. It is a very basic form of navigation consisting of o...")
(No difference)

Revision as of 04:14, 27 March 2013

Syntax:

void movetogoal(float dist)

This is the primary means of navigation available to monsters. It is a very basic form of navigation consisting of only 2 behaviours: 1. Move straight toward the current .goalentity 2. If blocked, move in a random direction for a random period of time. If the monster has the FL_FLY flag set, it will try to stay slightly above the height of the entity in the .enemy field.

Parameters:

dist - How far to 'step'.

Returns:

void

Other Details:

Please note that the movement target and the height target are set via different fields. Setting .goalentity but not .enemy will result in a monster not adjusting it's height. However, merely setting .enemy to an entity is not enough for movetogoal to match heights with it. The entity in the .enemy field must have a bounding box (it cannot be a point entity) and it must also have a .movetype other than MOVETYPE_NONE).