Author Topic: Making a Bot Avoid Land  (Read 1048 times)

Yes, this is for the Shark Mod v2. I figured, why not solve the problems all at once?
I sent Space Guy a message and he responded with this:
Try pre-calculating where the bot needs to go before you set its move path/destination
Now how would I/a scripter go about doing that?

If the bot is going to chase a player, do some raycasts and check they don't hit bricks or terrain first.

If the bot is moving randomly, keep firing raycasts (random rotation) until the direction it is going does not touch bricks or terrain.

That's more helpful, thanks. Although, now I know this is a job for someone else, as I have no clue how to even fire a raycast.

And when it's far away (unless Always Find Player is enabled) it will move around randomly until a player is nearby.

Maybe a more talented scripter should take this project from your hands before you run it into the ground?

Yes, definitely. Who are you suggesting? You?

No. I've never worked with bots.

Then who are you suggesting? Can you find someone to do it?

Raycasting isn't that hard actually, I used it in my landmine to check if a vehicle was above the landmine. You use it like this:

ContainerRayCast (\"x y z\", \"x y z\", mask, [exempt object])
   -Used to find objects of type “mask” between the two cords supplied
   -Returns a string

What that means is that you have point 1, the first \"x y z"\ part and then point 2 \"x y z"\. Try visualizing it like this (I'll use the landmine as an example): First I got the position of the landmine, and that is my 1st point, then I got that position again, but added a little to the x (or was it z?) axis only to get a point that was a little above my landmine, that is my second point. Now the type part is the $Typemask of the object you are looking for. And the exempt object is obviously an object that is exempt from the search, in this case you would probably want to put your zombie thing. Like for my landmine, it's a vehicle, and I was searching for a vehicle Typemask, but if I didn't make the landmine an exempt object, it would blow itself up. So imagine an invisible beam is shooting out of your zombie, imagine where you would want it to shoot, and then check for the things you want to check for in that range. Hope that helps.

Then who are you suggesting? Can you find someone to do it?
I suggest you ask Slicksilver555, His bots are always awesome.


I suggest you ask Slicksilver555, His bots are always awesome.
<3



Will you do it?
Sure, but in my spare time. This wouldn't become my major project, but I should work on it if you just remind me.
Edit: script and stuffs please. I'll work on it now.