Jump to content
  • 0

Need help with algorithm


Kenix

Question

  • Other Languages Moderators

I started make script zombies, but i found a problem.

Example

Click for see

I need know when zombie need turn left/right without waypoints and reach to player.

Edited by Guest
Link to post

12 answers to this question

Recommended Posts

  • 0
  • Other Languages Moderators

Click for see

I need know when zombie need turn left/right without waypoints and reach to player.
Edited by Guest
Link to post
  • 0
  • Other Languages Moderators

Ah, the ped just rotates.

You shouldn't put the ped at that box, you should destroy one face to that, or at least make a bigger box.

Too, you can make if the ped is in a box then make the ped look at where the player is.

Link to post
  • 0
  • Other Languages Moderators
Ah, the ped just rotates.

No, he moving and if ped see wall he will turn right or left.

Link to post
  • 0

He means that, if the Player is on the Other Side of the Wall the Zombie just ignores the Wall and is just running in it.But Kenix wants to make the Zombie to go Around the wall and then attack the player..

( i don't know if it's even possible )

Link to post
  • 0

Track the zombie movement, if it doesn't get any closer to the player in certain amount of time like 5 seconds check if the line of sight is clear http://wiki.multitheftauto.com/wiki/IsLineOfSightClear

If it is not clear force the zombie to check which side is better to avoid the object from, see how much free space you got on each sides, left and right.

In you picture there is more space on left so zombie goes there and gets around the box. Just force the zombie to go left untill it can get closer to the player again.

Not the best method but should work :D I used the same method in my A.I. Snake to make it avoid itself.

http://tg-mta.net/snakeyT/snake.html

Link to post
  • 0
Path nodes might be a solution.

it's not a static movement, the zombies will follow the player. so doing this is impossible.

Ohh, who said that I was talking about the default zombies?

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...