Jump to content
Sign in to follow this  
nomadd

Force AI to Charge/Attack

Recommended Posts

I looked for an answer to this but so far have not found anything. Sorry, if this has been answered before. I am not even sure it is possible to do this with the AI.

I have a mission that is a base defense. Starts out with a mortar barrage on the base. Then waves of enemy charge the base. Everything works great except the charge part. Most of the time the enemy just lays down in the open field and are easy to pick off. I have set them to careless/full speed. I want to force them to charge into the base, shooting, right after the barrage stops.

I have AI groups in the woods shooting into the base to lay down suppression fire ,but I need groups to charge across the field and not stop until they are in the base or dead.

I know there is a setskill command for "courage" but I have had no luck with it and I think it deals more with fleeing.

Nomadd

Share this post


Link to post
Share on other sites

Unfortunately, what you want to do isn't really possible. The AI has no concept of proper assault technique, and it is impossible to override their default combat behavior. In general, mission editors make up for this by just adding more AI to a mission. Yes, this is lame.

Share this post


Link to post
Share on other sites

The following combination of commands seems to work fairly well.

_unit setUnitPos "UP"; // keeps them standing up
_unit setBehaviour "CARELESS"; // this is important, it's the only way to get the AI to ignore enemies
_unit setCombatMode "BLUE"; // just in case, this prevents them from firing/engaging targets
_unit disableAI "TARGET"; // not sure if these two really do anything useful but why not
_unit disableAI "AUTOTARGET"; 
_unit allowFleeing 0; // they won't run away when their buddies start dying

And of course you can always reverse all of these to get them to act normally again.

Share this post


Link to post
Share on other sites

@ST Dux

That is pretty much what I settled on doing

@fleepee

I didn't know about the charge waypoint. I will check that out and see how it works

EDIT: where is the "charge " waypoint? I looked in game, setting a waypoint in the editor, and looked on the wiki. I could not find anything about it.

@Big Dawg

I did some experiments with the disableAI target and autotarget, it just kills the feel of the mission to have guys charging and not shooting.

I actually thought about turning all the enemy to civilians, setcaptive true then as they hit the base, a trigger can set them back ,but again charging the base and not shooting. It kinda kills the atmosphere.

I was afraid I was stuck by the way the AI is scripted to work, but I will take a look at the charge waypoint. Didn't know anything about that. Otherwise looks like I will just keep adding waves of enemy until it feels balanced.

Edited by Nomadd

Share this post


Link to post
Share on other sites
there is now a "charge" waypoint...

I can find no such waypoint. What are you referring to, exactly?

Share this post


Link to post
Share on other sites
@fleepee

I didn't know about the charge waypoint. I will check that out and see how it works

EDIT: where is the "charge " waypoint? I looked in game, setting a waypoint in the editor, and looked on the wiki. I could not find anything about it.

There is no charge waypoint.

@Big Dawg

I did some experiments with the disableAI target and autotarget, it just kills the feel of the mission to have guys charging and not shooting.

I actually thought about turning all the enemy to civilians, setcaptive true then as they hit the base, a trigger can set them back ,but again charging the base and not shooting. It kinda kills the atmosphere.

I'm not sure I understand. You want them to charge and shoot at the same time? It's definately not possible for them to fire while moving, not while aiming at least. If you want a charge, the above is probably the best you'll get. If you want the AI to shoot, well, it's going to be pretty difficult, if not impossible to get them to move quickly while doing so.

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  

×