Jump to content
Sign in to follow this  
fabrizio_t

Ai defending a fixed position

Recommended Posts

It's something like 2 months i fiddle around with mission editing and i still can't find a good solution for a very basic problem:

having a AI group defend a fixed position without running back and forth like chickens and (often) being shot in their back.

Here's a better explanation.

THE FACTS:

1) I set a waypoint as target (move or defend type) for the AI group that should defend the place

2) i set a formation mode for that group

3) i set "setcombatmode" to "yellow": they should open fire keeping position, right ?

4) I set "setbehaviour" to "aware". Tried the "combat" setting, but the result is that the AI members immediately break the formation and move to different positions. With the "aware" setting they just wait in place till they see the enemy, then just start happily moving, standing, crouching, running and charging the enemy.

THE SUSPECT:

I suspect the prob is the default range for rifles for the AI: simply too short!

When a member of a AI group is automatically ordered by leader to target an enemy unit he has to move to reduce the distance to an acceptable firing range (and there's no way to stop him!wink.gif: so also units that have been ordered to open fire while staying in place will move randomly.

That does not apply to snipers, and this fact appears to confirm the suspect.

Any solutions or workarounds ?

Share this post


Link to post
Share on other sites

This has always been a prob. Try this

Set a trigger at EAST GUARD

And then put a WAYPOINT on GUARD!

Share this post


Link to post
Share on other sites

This is a problem. Whcih means u have get around event problems. Such as:

If the leader moves then the whole groups moves...making it no longer a 'fixed' position.

I find examples always handy so heres mine:

WEst guys are holding a position. East is attacking.

-First off remove group lines so that each AI is now an individual{west}

-Put in the init box of each unit: This setunitpos "UP" or "DOWN".

-" ": This setbehaviour "X"(x=variable; SAFE, COMBAT,etc)

-No waypoints!!

West guys wont move at all. Each one will now have his fixed position. East is free to do what they want.

Does this help?

Grizzly

Share this post


Link to post
Share on other sites

I suggest you put the units where you want them, set them to "None" instead of the default "In formation", and add the following to their init line:</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">this disableai "move"<span id='postcolor'>The group leader will still call out targets and coordinate the squad (that is, share targeting information) but they won't run around. Not being able to move could present a problem when they're wounded or low on ammo as they won't be able to do much about it, but by then they're all dead, no?

Share this post


Link to post
Share on other sites

This could come in very handy. I've downloaded some slick little pillboxes and bunkers, but obviously getting the AI to stay in them correctly seemed next to impossible. That disableai "move" think seems like a good idea. Any idea on how to make them crouch and stay crouched?

Fed up with AI soldiers falling off towers etc because they keep fecking moving!!  tounge.gif

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (thelatinman @ Oct. 15 2002,18:06)</td></tr><tr><td id="QUOTE">having a AI group defend a fixed position without running back and forth like chickens and (often) being shot in their back.<span id='postcolor'>

Did you try Hold Position wp ?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Any idea on how to make them crouch and stay crouched?

<span id='postcolor'>

Use this in the init field of the units:

this setunitpos "UP";

unit will stay standing all the time

this setunitpos "DOWN";

unit will stay crouched all the time.

Share this post


Link to post
Share on other sites

Actually setunitpos "down" makes them lie down/crawl. I really need it so they'll stay crouched/on one knee. Any ideas?

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  

×