Jump to content
Sign in to follow this  
subliminalss

Turning Independent to hostiles during mission

Recommended Posts

Mission= Driving through a mercenary controlled city on secret ambush everyone jumps out of SUV, attacks main base of mercs who now become the enemy once shot at, rest of mission is getting away.

A: does anybody know how to change the independents from friendly to enemy once one of them is killed,

im thinking when (A) is killed independents = enemy. If anyone knows the commands to make this happen it will be greatley appreciated

I know i could set my team as captives until (A) is dead then not captives but that is a bit of a work around id ideally like it a bit more like i suggested.

Thanks in advance

Share this post


Link to post
Share on other sites

Never works the way you want. When A is killed enemies run out from houses works, or from behind a wall, but changing a unit's side mid-mission will not result in the instant "shoot my new enemies" that you expect. In testing this in 40 switches, I was shot once and waved to 39 times.

Share this post


Link to post
Share on other sites

Wouldn't it be possible to have all of the mercenaries join a group on the OPFOR side once one of them is killed? Actually, I think I'll go test that out...

Share this post


Link to post
Share on other sites
Never works the way you want. When A is killed enemies run out from houses works, or from behind a wall, but changing a unit's side mid-mission will not result in the instant "shoot my new enemies" that you expect. In testing this in 40 switches, I was shot once and waved to 39 times.

AMEN to that ive just been playing and its probably easier to set a bunch of triggers and conditions if there isnt a direct code for it. I knew it wouldnt work for OPFOR but maybe for indep as i thought it might have been a part of the main campaign.

The AI is to slow to do it in the rambo fashion i wanted it anyway and the AI just stand there and get shot. I hate replaying missions after getting killed etc and i can see this one being a big 50 times tried and eventually get lucky and kill them all.

Guess if i keep it a sudden hit and run i can stay as a captive or trigger it off and when everyone is killed trigger it on again outside a certain area.

Share this post


Link to post
Share on other sites

I just tried the method I suggested above, and it works. You circumvent the issue completely by simply having the independent troops change sides to OPFOR rather than change who independent is friendly toward.

Share this post


Link to post
Share on other sites
I just tried the method I suggested above, and it works. You circumvent the issue completely by simply having the independent troops change sides to OPFOR rather than change who independent is friendly toward.

Doesnt this mean everyone tries to form up and join formation. Although i guess this would be semi realistic, unless i get everyone to join individual groups.

Share this post


Link to post
Share on other sites

Are all of your independent soldiers in their own group to start with? It would be easy to have pre-existing independent groups join new OPFOR groups, one OPFOR group for each original independent group. Then you would not see any abrupt changes in formation.

Edited by ST_Dux
typo

Share this post


Link to post
Share on other sites

That's not a problem. Make sure all of them are named in the editor and that you have at least one OPFOR unit somewhere in the map (he can be way off in the middle of nowhere), then in init field of the player unit put the following:

indArray = [(list all of your independent unit names here)]

and in the init field of each independent unit put the following:

call compile ((str this) + "Opf = createGroup east");this addEventHandler ["killed",{{[_x] join (call compile ((str _x) + "Opf"));_x removeAllEventHandlers "killed"} forEach indArray}]

Edited by ST_Dux

Share this post


Link to post
Share on other sites

I had to edit my last post as I forgot a couple of major details. I've tested the last edit and it works, though. Each unit will create their own group dynamically and then join that group whenever any of them gets killed.

Edited by ST_Dux
typo

Share this post


Link to post
Share on other sites

Here is another way.

Create Takistani Locals / Independants as your Mercs. Set them as friendly to Opfor. Ok now they are the enemy but you dont want them to attack you unless you attack them. So set the Mercs waypoints as careless, now they wont attack you. Final part is to creat FiredNear eventhandlers to each Merc group leader to trigger a changebehaviour.sqf (change behaviour to combat for mercs in this script)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×