Jump to content
Mosshadow

Making AI use sandbags.

Recommended Posts

How can I get my AI to use sandbags? MCC's Fortify command works decently for getting them into static weapons, buildings and occasionally bunkers but it does not work for sandbags and other placed walls because they are not considered buildings. Are there any scripting solutions or AI mods that will fix this?

Share this post


Link to post
Share on other sites

I'm not sure if any such script/mod exists. It's tricky for the following reason.

 

With buildings, a bunch of positions in the interior of the buidling (buildingPos) is defined in the config file, and MCC most likely makes use of that to spawn units inside buildings. The thing with sandbags is that there's no interior/exterior so defining fixed positions relative to the sandbag object can be a little tricky. It's easy to imagine AI units spawning on the wrong side of the sandbag.

 

1. You can still do some config editing and try to define buildingPos for sandbag objects (look at config entries for existing buildings for reference), but make sure you place sandbags in the correct orientation before spawning units with MCC.

 

2. A way to do this via script and without addons is to using modelToWorld to get relative positions from the sandbag object. Again you need to make sure sandbags are placed in the correct orientation.

 

3. You could also manually define a list of absolute positions for units to occupy/spawn at. And then randomly select from these positions when you spawn units.

 

4. You could also manually place everything, this should be a lot easier since Eden release.

  • Like 1

Share this post


Link to post
Share on other sites

I'm not sure if any such script/mod exists. It's tricky for the following reason.

 

With buildings, a bunch of positions in the interior of the buidling (buildingPos) is defined in the config file, and MCC most likely makes use of that to spawn units inside buildings. The thing with sandbags is that there's no interior/exterior so defining fixed positions relative to the sandbag object can be a little tricky. It's easy to imagine AI units spawning on the wrong side of the sandbag.

 

1. You can still do some config editing and try to define buildingPos for sandbag objects (look at config entries for existing buildings for reference), but make sure you place sandbags in the correct orientation before spawning units with MCC.

 

2. A way to do this via script and without addons is to using modelToWorld to get relative positions from the sandbag object. Again you need to make sure sandbags are placed in the correct orientation.

 

3. You could also manually define a list of absolute positions for units to occupy/spawn at. And then randomly select from these positions when you spawn units.

 

4. You could also manually place everything, this should be a lot easier since Eden release.

Thanks, I've ended up just sticking them manually and setting them to never take cover and never move.

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

×