while(target in oview(7)) |
Can someone help me make monsters shoot a projectile, when they are facing the player, but not right in front of them. Thanks.
LaNuiit
ID:156101
Dec 27 2010, 2:49 am
|
||
This is what i have for the walking part of my monster Ai.
Can someone help me make monsters shoot a projectile, when they are facing the player, but not right in front of them. Thanks. LaNuiit | ||
#1 Dec 27 2010, 2:57 am
|
|
I'd recommend not using Zeta's artificial intelligence module. It's a terrible way of performing a simple method.
| |
Here's a simple way to keep your monster in movement.
If you want to go further into projectile shooting, you'll have to look up certain functions like get_dir(), and take a look at a projectile lib I personally like. Projectile Demo | ||
This is the code for random walking i have.My other code i post it before makes npc come to player while in oview 7 | ||
What did I just show you? You can do that in a much simpler form.
Instead of five lines of programming, you can fit it all into one line. | ||
Aside from the obvious mistake, recursively calling the proc is a non-stop train to crashville. You need to be using a while() loop.
Additionally, the AI is supposed to actually move towards players it seems. In that case, you'd want:
| ||
Ty, but i wuld realy like to know how to make a make monsters shoot a projectile, when they are facing the player, but not right in front of them...
| |
LaNuiit wrote:
Ty, but i wuld realy like to know how to make a make monsters shoot a projectile, when they are facing the player, get_dir() but not right in front of them... get_dist() | |