• 0

# Need help with algorithm

## 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

## Recommended Posts

• 0
• Other Languages Moderators

• 0
• Other Languages Moderators

Yes i did make this via processLineOfSight.

• 0
• Other Languages Moderators

Then I didn't get what was your problem.

• 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
• 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.

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

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

• 0

I tinhk he means zombie follow player and attack.

• 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 )

• 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 I used the same method in my A.I. Snake to make it avoid itself.

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

• 0

Path nodes might be a solution.

• 0
Path nodes might be a solution.

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

• 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?

## Create an account

Register a new account