Home   Help Search Login Register  

Author Topic: Insubordination: group doesn't stop attacking enemies  (Read 3261 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...

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Insubordination: group doesn't stop attacking enemies
« Reply #15 on: 16 Apr 2008, 08:44:01 »
<<duplicate post deleted>>  Sry about that, my browser froze, and I re-submitted... :-[
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 Loyalguard

  • Former Staff
  • ****
Re: Insubordination: group doesn't stop attacking enemies
« Reply #16 on: 16 Apr 2008, 11:14:54 »
@Johnny

I think the problem is that Myke is designing a resource that needs to work independent of the mission so any changes to friendliness or other side related behaivor could mess up what the original mission maker has created.

@Myke-

I think Darren's suggestion of adding disableAI "TARGET" in addition to "AUTOTARGET" is a good idea.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Insubordination: group doesn't stop attacking enemies
« Reply #17 on: 16 Apr 2008, 22:18:57 »
Ok, tried a few things....without any usable result until now. I'll post the actual code so you can see what i've tried.

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

{
_x disableAI "AUTOTARGET";
_x disableAI "TARGET";
_x setskill 0;
_x setCombatMode "BLUE";
_x setBehaviour "CARELESS";
_x action ["rearm",_STM_start_obj]
}
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 "GET OUT";
[_STM_squad, 0] setWaypointBehaviour "CARELESS";
[_STM_squad, 0] setWaypointCombatMode "BLUE";
[_STM_squad, 0] setWaypointFormation "ECH LEFT";

Please do not write that same thing is set twice or even three times and is completely redundant. I just try anything that comes in my mind. The result is still the same. The planes continue to fly attacks, even after removing all weapons which is more than pointless. What i will try next is to set the group to civilian side. Maybe this will stop them attacking and make them fly back home.

Info: i don't care if they fly in formation or each on its own, as long they return to carrier position.

If someone knows something i've not already tried please tell me, i'm getting mad about this one.


:EDITH:
Problem solved!
And the Oscar goes to....johnnyboy! :D
Although i didn't used RACS side but civilian side, his way was working like a charm:
Code: [Select]
_STM_temp_center = createcenter Civilian;
_STM_temp_group = createGroup Civilian;

units _STM_squad join _STM_temp_group;
deletegroup _STM_squad;
Thats all it neededs (although the waypointsettings are still in). Thanks to all who throwed theyr input in here, gave me a lot ideas to try.
And if someone would find a solution for this problem i would be really happy for today.

Thanks again mates.
« Last Edit: 16 Apr 2008, 23:17:43 by myke13021 »

Offline Darren

  • Members
  • *
Re: Insubordination: group doesn't stop attacking enemies
« Reply #18 on: 16 Apr 2008, 23:10:16 »
May I ask if you could make a "workable" version of you mission available (basically just enough to simulate the problem)

It's difficult for me on sample pieces of functions/scripts to simulate the problem or suggest a solution.
 :dunno:

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Insubordination: group doesn't stop attacking enemies
« Reply #19 on: 16 Apr 2008, 23:19:23 »
@Darren

You might have missed i've edited my last post. Problem is solved. Else i would surely provide an example mission but it isn't necessarly any longer. But thx mate.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Insubordination: group doesn't stop attacking enemies
« Reply #20 on: 17 Apr 2008, 17:43:56 »
Quote
And the Oscar goes to....johnnyboy!

I accept this Oscar in the name of my mother and father, and wish to donate the proceeds to Whirled Peas...

...glad I could help matey!  ;)
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...