Jump to content
Sign in to follow this  
Aviox93

How to script ROADS

Recommended Posts

Hi !

 

I wanna make a mission on a modded map that I like. However, I need AI vehicles to move across the map but the roads are poorly scripted in certain areas. For example :

 

The road texture is perfectly fine :

 

19.png

 

but there is no orange line so the AI can't go through this road.

20.png

I just want a way to add these orange lines. Thx !

 

Share this post


Link to post
Share on other sites
18 hours ago, Aviox93 said:

I just want a way to add these orange lines. Thx !

Use Photoshop...

 

Jokes aside, if there is no road segment you can't add one. Period.

Only the terrain tools can do that, so for a proper fix you need to let the author know about the missing road.

 

However since the road surface is visible, could it be that the road is there and just not displayed on the map? My terrain-making-fu is too bad to know for sure.

You can check if the road segment exists by:

  1. Get in a vehicle 
  2. Execute this little script in the debug console
    [] spawn {
    	while { vehicle player != player } do {
    		hintSilent format ["isOnRoad: %1", isOnRoad vehicle player];
    	};
    	hintSilent "";
    };
  3. Drive around on the road in trouble area. If there is an actual road segment underneath the vehicle you should see "isOnRoad: true".
    If so it could instead be that nearby objects (buildings, canal walls etc.) are interfering with the driver's pathfinding.

 

Your best bet in either case is to contact the author of the map and detailing the issue.

While waiting for a fix, if you really need to get a vehicle through there, here are some possible workarounds:

  • Use waypoints closely spaced together (5-25 m) and limited speed. If you do it right and thread the needle it could possibly get them through but it likely won't look good if that's important.
  • You could also use setDriveOnPath to guide the vehicle through the troublesome sections.
  • If you are looking for something more cinematic you could use unit capture / play.

 

P.s. while you're at it tell 'em to fix the textures on them buildings. I'd go blind driving around in there. 😛

  • Like 3

Share this post


Link to post
Share on other sites
1 hour ago, mrcurry said:

Use Photoshop...

 

Jokes aside, if there is no road segment you can't add one. Period.

Only the terrain tools can do that, so for a proper fix you need to let the author know about the missing road.

 

However since the road surface is visible, could it be that the road is there and just not displayed on the map? My terrain-making-fu is too bad to know for sure.

You can check if the road segment exists by:

  1. Get in a vehicle 
  2. Execute this little script in the debug console
    
    [] spawn {
    	while { vehicle player != player } do {
    		hintSilent format ["isOnRoad: %1", isOnRoad vehicle player];
    	};
    	hintSilent "";
    };
  3. Drive around on the road in trouble area. If there is an actual road segment underneath the vehicle you should see "isOnRoad: true".
    If so it could instead be that nearby objects (buildings, canal walls etc.) are interfering with the driver's pathfinding.

 

Your best bet in either case is to contact the author of the map and detailing the issue.

While waiting for a fix, if you really need to get a vehicle through there, here are some possible workarounds:

  • Use waypoints closely spaced together (5-25 m) and limited speed. If you do it right and thread the needle it could possibly get them through but it likely won't look good if that's important.
  • You could also use setDriveOnPath to guide the vehicle through the troublesome sections.
  • If you are looking for something more cinematic you could use unit capture / play.

 

P.s. while you're at it tell 'em to fix the textures on them buildings. I'd go blind driving around in there. 😛

Alright thanks ! I'm choosing another map then and I'll let the author know about it !

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  

×