Home   Help Search Login Register  

Author Topic: AI stay and hold?  (Read 1644 times)

0 Members and 1 Guest are viewing this topic.

Offline Crowey

  • Members
  • *
AI stay and hold?
« on: 27 Feb 2009, 18:30:48 »
Hi guys is there a simple way to make AI stay in or near a position and hold that area rather than running toward and engaging the enemy once a gun batlle commences? My situation is I want my player controlled team to enter a town where a battle is already taking place and the north side will hold the blufr who will just take cover a the opfor to do the same from the south... ie so basiacally there will still be AI left alive by the time the player arives

Offline twisted

  • Members
  • *
  • I'm a llama!
Re: AI stay and hold?
« Reply #1 on: 27 Feb 2009, 20:35:39 »
i think the guard waypoint does this.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: AI stay and hold?
« Reply #2 on: 27 Feb 2009, 23:16:51 »
Um, actually the guard waypoint would do the opposite - send the AI off after any perceived threats anywhere on the island ;)

The Hold waypoint however should do it, if we're talking a whole group. The problem comes when people use AI mods like GroupLink or ECS that "take over" the native AI and send them off on wild goose chases everywhere.

So, to absolutely, positively make an AI stand still, you need to use disableAI->

Code: [Select]
unitName disableAI "MOVE"; unitName disableAI "TARGET";
These two together (unitname = name of unit, or if you're putting them in the init line, this will do)

"MOVE" disables regular moving, and "TARGET" disables the "2, engage that, man, at 3 o'clock!"-styled moving. Both are needed AFAIK to make sure the AI doesn't move.

The problem is of course that, I think, the old bug since OFP-times still persists in which a loaded SP game will re-enable all disableAIs (and do other strange things), but if you don't think this is a problem then you'll be fine. Otherwise there're ways to get around that too.

But...maybe a simple Hold waypoint should be enough!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: AI stay and hold?
« Reply #3 on: 28 Feb 2009, 12:34:31 »
I think I saw a note in one of the patch changelogs that said they'd fixed that.
Don't quote me on it though.

Another way to make sure there's still baddies left is place them well. Get them inside buildings, in courtyards and around corners and the like. You'll doubtless have problems with your guys waliing around corner and getting whacked but that will just make you more careful.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Rommel92

  • Members
  • *
Re: AI stay and hold?
« Reply #4 on: 01 Mar 2009, 22:30:07 »
Set their combat mode to "YELLOW". That always helps too.  :P

Otherwise best suggestion is the one by wolfrug.
Code: (wolfrugs) [Select]
unitName disableAI "MOVE"; unitName disableAI "TARGET";

Offline Psybercastor

  • Members
  • *
Re: AI stay and hold?
« Reply #5 on: 23 Apr 2009, 13:57:03 »
I basically have the same problem. I want the enemy to stay in it's specific area and don't run away regardless how much combat is taking place somewhere close. However, I DON'T want to use disableAI "MOVE". I still want them to be able to move, but just in their own area. I wan't them to act as a bunker/sentry/guardpost sorts of groups.

Another idea would be to use disableAI "MOVE", but disable that script as soon as the player is close by enough, or they have visual contact or something like that. Is that possible?

Offline Ext3rmin4tor

  • Members
  • *
Re: AI stay and hold?
« Reply #6 on: 23 Apr 2009, 18:57:13 »
I've never found a way to completely make the AI hold the position without running away, but this method is good:

Create a HOLD waypoint and set the Combat Mode to "Don't fire" (it's the second from the top of the dropdown menu). In this mode the units will engage the enemy only if he is aware of their presence and can harm them. The problem is if they hear shooting it might happen that the leader decide to use some scout units and so you'll have someone running anyway but this prevents the whole group to break formation and run everywhere like fools
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!