Home   Help Search Login Register  

Author Topic: Insubordination: group doesn't stop attacking enemies  (Read 3938 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
I've got a new problem (surprise surprise).

I have a group of planes moving to certain area and attack everything they'll find. As far everything works. But then, at certain circumstances i want the group to stop attacking (out of fuel/ammo) and return to base.

But sadly they insist of continuing attacking remaining enemies.

What i've tried so far:
I've set waypointbehaviour to "CARELESS" and waypointcombatmode to "BLUE". Also i directly ordered setcombatmode and setbehaviour accordingly to waypoints settings written before. I used disableAI "AUTOTARGET". I have even used removeallweapons on the planes. But even then they do flying attacks.

So how do i tell the group that from now on they should ignore enemy presence and fly back home to refuel/rearm?

Code: [Select]
_STM_squad setCombatMode "BLUE";
_STM_squad setBehaviour "CARELESS";
_STM_squad enableAttack false;

{
_x disableAI "AUTOTARGET";
}
foreach units _STM_squad;

{
(_x select 0) flyinheight (_STM_flylevel * 2);
removeallweapons (_x select 0);
}
foreach _STM_squad_list;
_STM_squad move position _STM_start_obj;
[_STM_squad, 0] setWaypointPosition [position _STM_start_obj, 0];
[_STM_squad, 0] setWaypointType "MOVE";
[_STM_squad, 0] setWaypointBehaviour "CARELESS";
[_STM_squad, 0] setWaypointCombatMode "BLUE";
[_STM_squad, 0] setWaypointFormation "ECH LEFT";

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Insubordination: group doesn't stop attacking enemies
« Reply #1 on: 15 Apr 2008, 07:50:39 »
Sounds very annoying.  Arma can drive you crazy.

Another option is to set the enemies in the area to setcaptive true.  Then they will hopefully ignore them.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Rommel92

  • Members
  • *
Re: Insubordination: group doesn't stop attacking enemies
« Reply #2 on: 15 Apr 2008, 08:08:48 »
Bloody 'ell, you've tried mostly everything, how about AllowFleeing 1.0, and make sure the weapons are definetly removed... and uh, if worst came to worst, swap out the pilots with a new group... otherwise (dunno code) try and see if you can reset their "KnowsAbout"...  :blink:

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Insubordination: group doesn't stop attacking enemies
« Reply #3 on: 15 Apr 2008, 14:22:11 »
@johnnyboy

Thanks for your input. Sadly setcaptive isn't an option as there might be ground troops (infantry, Tanks) of the same side as the planes are so a setcaptive on enemy vehicles would affect these also.

@Rommel92

Yep, thats one thing i can try to set the allowfleeing (by thinking of it, setskill 0 i can also try). Reset the knowsabout....hmmm...already thought about that but didn't found a way to do that. Also i guess it would be ineffective since while the plane is flying above the enemies, the knowsabout would instantly goin back up.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Insubordination: group doesn't stop attacking enemies
« Reply #4 on: 15 Apr 2008, 16:42:55 »
You could try setFriending the enemies to be friends.
If that works just reset them back to being enemies once the planes are far enough not to attack them..  :scratch:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Insubordination: group doesn't stop attacking enemies
« Reply #5 on: 15 Apr 2008, 17:07:44 »
@ h-

Thanks for your input but i guess this would result in the same problem as a setcaptive command. While it would solve the problem for the planes, the changed friends setting would also count for ground units....would look some kind of funny some infantry suddenly stop firing each other and settle down to drink a beer together.

These are all good ideas in general if i would be making a mission where i could myself control what happens when. But it is for a script i'm working on which should work independently (as far as possible) from anything happens in the mission.

But please continue throwing your inputs, as i said, the ideas are good in general but unusable in this particular problem.

Offline Loyalguard

  • Former Staff
  • ****
Re: Insubordination: group doesn't stop attacking enemies
« Reply #6 on: 15 Apr 2008, 18:05:18 »
I have never had setCombatMode "BLUE" not work for me before, but, I have always used it on individuals not groups and never with units in vehicles.  Perhaps add the setCombatMode command to your forEach loop to make sure it is applied to every unit.  Perhaps also try...

Code: [Select]
forEach (crew vehicle _x)
...as well for the planes themselves in addition/instead of the groups.  Other than that I am stuck.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Insubordination: group doesn't stop attacking enemies
« Reply #7 on: 15 Apr 2008, 20:15:06 »
@Loyalguard

Thanks, i will try this to setcombatmode to each unit and the plane also. Maybe this will help to solve the problem although the comref says that the setcombatmode should be for groups or objects. I will see what happens.

So the things i'll try:
set allowfleeing to 1
set skill to 0
and finally using setcombatmode on the whole group, each unit of the group and each plane.

I will report back after some testing.

Last thing i could try if anything else fails (but this would include the need of an addon and i really would like to have no addon depencies) i will try to use the viewblockers from MAP_misc addon setposing around the plane.....if anything else fails

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Insubordination: group doesn't stop attacking enemies
« Reply #8 on: 15 Apr 2008, 21:17:16 »
Quote
Thanks for your input but i guess this would result in the same problem as a setcaptive command
True, missed the setCaptive part in your earlier post.. :(

Quote
although the comref says that the setcombatmode should be for groups or objects.
One single soldier (not grouped to enyone else) is a group, the soldier itself being the leader.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Insubordination: group doesn't stop attacking enemies
« Reply #9 on: 15 Apr 2008, 22:09:10 »
Quote
One single soldier (not grouped to enyone else) is a group, the soldier itself being the leader.
Yep, i know. The pilots are all in one group and i already used setcombatmode on the group. I will try what happens if i set combat mode to the group and also to each unit separately. I know this would be some kind of redundance but at this point i'll try everything, even if it sounds more than stupid.

Offline Rommel92

  • Members
  • *
Re: Insubordination: group doesn't stop attacking enemies
« Reply #10 on: 15 Apr 2008, 22:13:03 »
I use:
Code: [Select]
_Grp setcombatmode "Red";_Grp being a Group name, so I'm pretty sure it works on groups. Sorry bud... lol.  :confused:

Offline Loyalguard

  • Former Staff
  • ****
Re: Insubordination: group doesn't stop attacking enemies
« Reply #11 on: 15 Apr 2008, 23:31:46 »
setVehicleInit and  processInitCommands  may also be an option to execute the mode commands as well.

Offline Darren

  • Members
  • *
Re: Insubordination: group doesn't stop attacking enemies
« Reply #12 on: 16 Apr 2008, 00:02:32 »
Could these actions not assist?

REARM
unitname action ["rearm",rearmvehiclename]
Unitname rearms at specified rearmvehiclename.
Rearmvehiclename can be anywhere on the map, ammo transfer is by magic.
Unitname does not reload weapon automatically if it had no ammo beforehand.

REFUEL
unitname action ["refuel",refuelvehiclename]
Unitname refuels at specified refuelvehiclename.
Refuelvehiclename can be anywhere on the map, fuel transfer is by magic.

REPAIR
unitname action ["repair",repairvehiclename]
Unitname repairs at specified repairvehiclename.
Repairvehiclename can be anywhere on the map, repair is by magic.

How about telling them to move to base?

What about disableAI "Target" ● (disable watching assigned target)?
Even if you disable the "MOVE" AI, the units will still move out to attack the enemy, unless you
disable the "TARGET" AI.

Or take their attention elsewhere?
unit(s) glanceAt position
unit(s) lookAt position







Offline Rommel92

  • Members
  • *
Re: Insubordination: group doesn't stop attacking enemies
« Reply #13 on: 16 Apr 2008, 05:07:11 »
How about telling them to "GET OUT", as in the waypoint at the base. This usually works for breaking engagements.  :yes:

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Insubordination: group doesn't stop attacking enemies
« Reply #14 on: 16 Apr 2008, 08:42:09 »
If you have the RACS side set to "Friendly to Everyone", or friendly to the enemy side, then you could group the planes to a RACS (independent side) unit who has a probability of presence set to zero.

This would set the plane's units to a neutrality state.  After they re-arm and refuel, you could then re-group them with a unit from the correct side so they would re-engage targets.

Might work. 
« Last Edit: 16 Apr 2008, 08:46:24 by johnnyboy »
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...