Jump to content
Sign in to follow this  
RazorX

Is there a way to block the road from AI?

Recommended Posts

I want to prevent the AI from driving a certain road (close the road for traffic in other words), but I don't want to place any objects like barricades etc (cuz the AI will smash into it anyway). Can do it in an easy way or do I have to make some brainfrying scripting?

Share this post


Link to post
Share on other sites

Well, there are only 2 ways to do things with the editor:

1) You take and use objects available in the editor (manual approach).

or

2) You use/write scripts to use things that are not "off the shelf" within the editor (scripting).

Take your pick. :D

Best, Splicer.

Share this post


Link to post
Share on other sites

in GITS evolution we call in a fort to block road junctions and it works a treat - doesn't do whjat you want to exactly, but it does do the job

_pos = (position _base);

_tbox = "WarfareBDepot" createVehicle _pos;

_tbox setDir (direction player-180);

_tbox setDammage 0;

processInitCommands;

Share this post


Link to post
Share on other sites

For me it is vital not to create any objects on the road. I just want the AI to calculate route excluding the specified road segments. I don't know if I should mess with the AI or with the road segments' properties or creating detours using waypoints. I would like to avoid the last solution mentioned, but if it's the only one, well, I'll take it...

Edited by RazorX

Share this post


Link to post
Share on other sites

they're based on a position of a dead unit.

It is a script, where when a body is detected near the road or on it, the police closes the road for traffic, because it's a crime scene. I've already written a script that places road barriers on the road segments adjecent to the body. But the AI can still drive through that section. I want to temporarily close it for traffic.

Share this post


Link to post
Share on other sites

Well, I have an idea... but involves a bit of scripting.

Let me know if you're interested in hearing it.

Splicer.

Share this post


Link to post
Share on other sites

OK, I hope this idea holds water. :D

Create a marker of a size that you think, average, could cover the crime scene.

Then you could place that marker to where the dead body is.

Then adapt a script that has been mentioned in this forum on how to avoid zones.

Now you have a an area with coordinates that you could use for the AIs to NOT go through, but around.

Does this make sense?

Best, Splicer.

Share this post


Link to post
Share on other sites

A'ight, I have it, but the problem is, that vehicles drive randomly through the neighbouring fields, I want them to stay on the roads and find a detour by themselves. I'll try to implement that...

Edited by RazorX

Share this post


Link to post
Share on other sites

Yeah, that's what I tried to use, but I need to do some radical modifications

Share this post


Link to post
Share on other sites

I'll be using the avoid-zones script too for other purpose for my mission, but that'd be done after all the main components of my mission are in place.

Let me know if you get something to work. If you have questions I'll try my best to give you a hand. :D

Good luck!

Best, Splicer.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×