Home   Help Search Login Register  

Author Topic: [solved] How to make friendly groups engage each other?  (Read 1692 times)

0 Members and 1 Guest are viewing this topic.

Offline zwobot

  • Members
  • *
Hi Community,
I want to trigger friendly units to engage the player's squad and stop the friendly units engaging the player's squad if a certain condition is met.

I tried setting a negative rating to all the units in the player's group via addRating but this makes the AI units in the player's group engage each other.

Background:
in my mission the player's squad is reentering friendly lines in the dark after a patrol and the player has to challenge the observation post to identify his group as friendlies.
Failing to do this there would be a chance that the AI manning the observation post would engage the player's squad until they use the correct challenge and password.

I need a solution which I can turn on mid-mission since the player's squad will have contact with another friendly group prior to approaching the observation post.

Edit:
another approach I just tried is to joinSilent the player's group to a WEST unit and back to an EAST unit once correctly challenged.
Basically this works however: Apart from the command bar being cluttered with the 'foreign' dummy units, also triggers checking for the presence of the group attached to the original player group seize working after these measures.
« Last Edit: 03 Aug 2011, 20:45:05 by zwobot »
"Executing tactics in real combat is the hardest thing one can ever do...well I've never given birth but..well whatever."

Offline Ext3rmin4tor

  • Members
  • *
Re: How to make friendly groups engage each other?
« Reply #1 on: 01 Aug 2011, 01:55:03 »
You can create a group for an enemy side (enemy to player's side and thus to all the other groups of that side) with createGroup. After that use joinSilent as you did. If there is no pre-placed unit on the map for the new group side, remember to first use createCenter for that side or it won't work.

Do the same to switch back to a friendly group.
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline zwobot

  • Members
  • *
Re: How to make friendly groups engage each other?
« Reply #2 on: 01 Aug 2011, 07:58:58 »
Thanks Ext3rmin4tor, your solution works how I wanted  :good:

The only problem now is the presence triggers linked directly to the group are not working. As an alternative I can link the triggers only to the player ('Vehicle' activation instead of 'Whole group').
"Executing tactics in real combat is the hardest thing one can ever do...well I've never given birth but..well whatever."

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to make friendly groups engage each other?
« Reply #3 on: 01 Aug 2011, 09:46:59 »
I suggest you don't use triggers linked to the group, instead use something like this in the On Activation field:

Code: [Select]
{_x in thisList} count units group Player > 0
That's the same as "any unit of the group inside this trigger's area".

Code: [Select]
Player in thisList
= Activated by the player only.

Remember to leave the trigger activations as "Anyone" instead of "BLUFOR" or "OPFOR", since the Player's group will change allegiance half-way through :)

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

Offline zwobot

  • Members
  • *
Re: How to make friendly groups engage each other?
« Reply #4 on: 03 Aug 2011, 20:44:52 »
That does the trick. Thank you  :)
"Executing tactics in real combat is the hardest thing one can ever do...well I've never given birth but..well whatever."