Forum Jump :

Author Message

Posts: 17

Level: Member

Country: ch
In-game name:

#1 Posted at 2017-01-01 00:10        
So, for a mission I'm making, I would like multiple groups to initially ignore each other, but then either upon the advance of BLUFOR or a radio command to order the advance, the groups start fighting.

The scenario would be that resistance forces take up arms against the OPFOR occupiers when they see that help is coming and that victory is achievable (while also meaning that the player must be careful about over reliance on FLIR - its not enough to see people holding weapons in an area not known to be occupied by BLUFOR)

I would like to use Independent Militia groups that aren't armed with modern military weapons (they use hunting rifles and old AKs - and I'd planned on altering the weapon loadout a bit more to remove rifles from some of them and give them just handguns)

I've looked here:

- but none of the solutions are really satisfactory.

NOTE: It is not possible to change the Resistance side relationship while a mission is running.
So there goes the way I wanted to do it... to have the independent(resistance) side be friendly to both sides, then become enemies with the OPFOR when BLUFOR approaches

Then that link suggests arming civilians... I can do that, but...
"NOTE: By default no side will shoot units on the civilian side, even when fired upon by them (same as for captives)."

So.... that won't work, I want it to be "civil war", not civvies slaughtering the military
"1) You can make other sides hostile to a civilian by making the civilian renegade, but this will mean other civilians too will attack the unit"
Again, I don't want this to be a case of the locals just killing each other, I want them to fight as a group against the occupiers, and I don't want the advancing BLUFOR to attack them either.

They also mention: "2) To enable hostility both ways - civilians shooting at a side and the side shooting back, you need to move the civilian unit to a hostile side."
Their first suggestion just makes them start on another side... it notes:
"Causing a civilian unit to change sides during a mission by using the joinSilent command and joining them to a living officer (using an officer with deleteVehicle this in their init field will not work), will cause the civilian to attack the other side, but the other side will not attack the civilian."
That's not what I want either...

So far my only idea is just to spawn the armed miltia units when Blufor advances... but I'm not even sure that's going to work as I don't want to spawn uniformed fighters, and I think the default class spawns have no weapons - I don't know how to add weapons to spawned units, and it would be really nice if I could do all the stuff with these units in the editor, with a GUI to set waypoints, simple compy and pasting of units etc...

So how do I do this? How do I have two groups of units coexists until a trigger is tripped, and then start fighting?

Author Message

Posts: 1589

Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 58
In-game name: Kobayashi Maru

#2 Posted at 2017-01-01 02:09        
The note seems to me absolutely wrong. You can change what you want with a script during the mission. I do that without any problem. My last mission (wip) scenario changes side for resistance along with the number of separatist victims.:
3 dead, resistance becomes enemy;
20 dead more; resistance asks for truce;
3 dead more > enemy
... truce, enemy
+ capture or kill of a boss. The script is long and not immediate (for example, you need to know the side of the victim before he's been killed because all dead are civilians).

So, just script what you need with setFriend and getFriend. I guess it's possible in Arma2 also.

Same for civilian but generally, there are some links with resistance, so check that.
As you can't have civilian groups, use civilian for specific behavior only.
Don't forget you can make a unit open fire, even if civilian (or friendly) just scripting something like:

// _surveyed is an unit under arrest or investigation. It's just an example. _plyr is also a variable, you can replace by player in SP
[_surveyed] join grpNull; // just in case of inside a group 
_surveyed setCaptive true; // AI units will not fire at, and only player has to manage the case
_surveyed setDir ([_surveyed, _plyr] call BIS_fnc_dirTo);
_surveyed doWatch _plyr;
_surveyed setBehaviour "COMBAT";
_surveyed reveal [_plyr,0.8];
_surveyed allowFleeing 0;
if ((_surveyed getVariable "oldSide") == civilian) then { // I formerly registered the side on a variable "attached to" the unit 
_surveyed addMagazine "16Rnd_9x21_Mag"; // always magazines before to have the gun loaded and ready
_surveyed addWeapon "hgun_P07_F"; // add gun
_surveyed setUnitPos "UP";
[_surveyed,_plyr] spawn { // following needs a loop, so spawn the code 
  params ["_surveyed","_plyr"];
  while {alive _surveyed && (_surveyed distanceSqr _plyr) < 400 && captive _surveyed} do {
    _surveyed doWatch _plyr;
    //_surveyed doTarget _plyr; no need
    sleep 0.3;
    _surveyed doFire _plyr; // at least
    _surveyed doSuppressiveFire ((getposASL _plyr) vectorAdd [0,0,1.2]); // help for firing
  }; // end loop
}; // end spawn

Now, you civilian will fire at player if you run this code (addAction for investagate or arrest.., trigger). The unit must be not too close to the player (5 to 10 m seems good).
I guess there are some other smarter codes, but it's an answer.

This post was edited by Pierre MGI (2017-01-01 02:16, 593 days ago)



Author Message

Posts: 1189

Level: Member

Country: tr
Occupation: Computer Science student
Age: 20
In-game name: Wak

#3 Posted at 2017-01-01 09:29        
You should be able to use the setFriend command during a mission, don't think it'll be as buggy as the wiki mentions.

You can also try to find what BIS did in the first campaign mission

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage