Home   Help Search Login Register  

Author Topic: unit switch to bluefor side AFTER game has already commenced  (Read 1817 times)

0 Members and 2 Guests are viewing this topic.

Offline ual002

  • Members
  • *
Is there anyway to make a civilian unit switch to bluefor side AFTER game has already commenced using the join command.  As far as I can tell its just allowing me to command a civilian unit (bad guys wont shoot at him but will shoot at me).  And yes I know about seting a civilian as a follower to a bluefor with probability of 0 presence, thats how my character is being seen as bluefor.  I just want to be able to arrive at a small trigger area with a civilian dude in the middle and have him join my team AS a bluefor.  

Then comes the hard part.  If i could get the first part to work I would like our whole team to be setcaptive using group variable name not object variable name.  Aparently setcaptive needs an object name not a whole group.  Because then I wanted to have a trigger set up so that if any member of the team is unarmed, he is "setcaptive true" and if armed, then "setcaptive false"

Anyone follow me?  
If you havent figured out Im making a red dawn style mission.  WOLVERENES!!!!!!!!!!

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #1 on: 24 Jul 2007, 01:00:44 »
First part i don't know, someone else might have an answer.

But for the second thing, this should work:
Code: [Select]
{_x setcaptive true} foreach units group player
if it's meant for players group, else replace "group player" with the groupname.

Offline ual002

  • Members
  • *
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #2 on: 24 Jul 2007, 01:05:31 »
Nice.  thanks, still need answer to the first part.

Cheers

Offline SniperUK

  • Members
  • *
  • I'm a llama!
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #3 on: 24 Jul 2007, 01:07:15 »
side1 setFriend [side2, value]

Sets how friendly side1 is with side2. For a value smaller than 0.6 it results in being enemy, otherwise it's friendly. Not sure if thats what you're afterbut i dont think you can get him to witch sides other than this.

Offline ual002

  • Members
  • *
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #4 on: 24 Jul 2007, 01:56:49 »
see, that will keep him on civilian side, but just make civilians friendly to another given side. 

Offline SniperUK

  • Members
  • *
  • I'm a llama!
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #5 on: 24 Jul 2007, 02:00:13 »
that is the closest you will get i think. But look in http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA for different solutions.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #6 on: 27 Jul 2007, 03:15:01 »
try making him bluefor by the "set probability to 0" method also. If you need him to not be shot, then setCaptive him until the trigger.
It's a shot in the dark, but see if it works.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #7 on: 28 Jul 2007, 17:47:00 »
My suggestion is to do a quick setpos switch:

1) Have your civilian unit that joins the group in its location

2) on an island way off to the side of the map, put the same civilian type commanded by a BLUEFOR with zero probability (you know this way)

3) then when the player has the civilian join, you can instantly switch them out and delete the original civilian and setpos the bluefor civilian to that location.  You could put a gamelogic there to make it easier; BLUECIVILIAN SETPOS GETPOS GAMELOGICOLDCIVVY.  If done instantly i don't think its gamey at all and allows you to make this happen!!!  The code can be included in the trigger too.


Also I've heard that setunit captive false (and true) works only once for the unit- so you can't go back and forth just in case that was a consideration.

« Last Edit: 28 Jul 2007, 17:55:09 by Lee »

Offline ual002

  • Members
  • *
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #8 on: 28 Jul 2007, 18:32:47 »
Very useful info guys, i think ill make it bluefor from the get go but make him "captive" suggested by tyger.  Although the set unit pos idea from lee is very sneaky too.

Can anyone think of a way to make and units in my group set captive false forever once they have picked up a gun?  If we can figure this out Ill be able to proceed with the mission.

And its a useful thread for other newbies like me.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #9 on: 28 Jul 2007, 21:51:09 »
(count weapons myCaptive) > 1

Put that in a trigger condition line and in the activation line:

myCaptive setCaptive false

Note: One for each unit!

@Lee
As far as OFP goes, then that is not true. You can do it and undo it multiple times. I don't know ArmA wise since I haven't gotten ArmA yet, but i'd assume the same is true.
« Last Edit: 29 Jul 2007, 05:48:13 by Tyger »
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline LeeHunt

  • Former Staff
  • ****
  • John 21:25
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #10 on: 29 Jul 2007, 05:30:25 »
Thanks Tyger, good to know!! And the count weapons mycaptive >1 line helps me out in a mission i'm working on as well  :)

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #11 on: 29 Jul 2007, 05:47:15 »
Quote
And the count weapons mycaptive >1 line helps me out in a mission i'm working on as well
Not a problem mate! Here to help! :)

And just itching for ArmA to come in! :P
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline firecontrol

  • Members
  • *
Re: unit switch to bluefor side AFTER game has already commenced
« Reply #12 on: 29 Jul 2007, 06:24:44 »
I'm a nitpicky bastard here... but I think it's important. :)

Should be:
(count weapons myCaptive) >= 1
or
(count weapons myCaptive) > 0

Greater than or equal to. Otherwise he'd have to have two 'weapons' to trigger it.
Also, if the unit picks up anything "thrown", i.e. grenades, this will not add to the weapons count. Keep in mind. :) A combination of 'hasWeapon' and 'magazines' can be added to check for grenades. Or simpler, an 'In' command... e.g.
"HandGrenadeTimed" in (magazines myCaptive)   <---- note, 'in' is case sensitive! HandGrenadeTimed is different than handgrenadetimed

http://community.bistudio.com/wiki/weapons
« Last Edit: 29 Jul 2007, 06:49:43 by firecontrol »