Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Editing movetogoal
From Quake Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | ====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 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:==== | ||
+ | :<code>dist</code> - 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'''). | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |