Home   Help Search Login Register  

Author Topic: Get out and stay out!  (Read 1508 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Get out and stay out!
« on: 28 Dec 2004, 20:31:55 »
I want the crew of certain vehicles to abandon the vehicle and walk.  I  have the following code in a script:

Code: [Select]
if ((canMove _veh) and (fuel _veh > 0.05) and (side driver _veh == west)) then {goto"VehOkay_1"}
_crew = crew _veh
{unassignVehicle _x} forEach _crew
_crew orderGetIn false
#VehOkay_1

I tested it with a vehicle that had  setFuel 0

The result was the Gunner and the Driver got out and the Gunner then got back in!

How do I get them all out and keep them out?
« Last Edit: 28 Dec 2004, 20:32:23 by THobson »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Get out and stay out!
« Reply #1 on: 28 Dec 2004, 20:34:28 »
Remove his ammo maybe?


Planck
« Last Edit: 28 Dec 2004, 20:34:47 by Planck »
I know a little about a lot, and a lot about a little.

GrimMonkey

  • Guest
Re:Get out and stay out!
« Reply #2 on: 28 Dec 2004, 20:46:40 »
Did you try locking the vehicle?

Code: [Select]
if ((canMove _veh) and (fuel _veh > 0.05) and (side driver _veh == west)) then {goto"VehOkay_1"}
_crew = crew _veh
{unassignVehicle _x} forEach _crew
_crew orderGetIn false
_veh Lock True
#VehOkay_1

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Get out and stay out!
« Reply #3 on: 28 Dec 2004, 21:45:53 »
locking only works on players, it has no affect on AI att all

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Get out and stay out!
« Reply #4 on: 28 Dec 2004, 22:35:39 »
try using veh remove all magaziens/ammo(dont know which,

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Get out and stay out!
« Reply #5 on: 28 Dec 2004, 23:24:07 »
Cracked it.  It seems that telling the crew of a vehicle to unassignVehicle does not work on its own.  Somehow the crew are uniquely linked to the vehicle.  The code that solves my problem is:

Code: [Select]
if ((canMove _veh) and (fuel _veh > 0.05) and (side driver _veh == west)) then {goto"VehOkay_1"}
_crew = crew _veh
[_crew select 0] join grpNull
{unassignVehicle _x} forEach _crew
{[_x] join (_crew select 0)} forEach _crew
#VehOkay_1
It seems that it is necessary to assign the crew members to a group that is in noway associated with the vehicle - otherwise they just keep trying to get beck in.

I did not get chance to try the ammo/magzines bit - but anyway that would have spoiled what I was trying to achieve.
« Last Edit: 28 Dec 2004, 23:25:42 by THobson »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Get out and stay out!
« Reply #6 on: 28 Dec 2004, 23:34:46 »
Was this a vehicle placed via the editor fully crewed?


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Get out and stay out!
« Reply #7 on: 28 Dec 2004, 23:40:59 »
Yes.  Is this a known issue?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Get out and stay out!
« Reply #8 on: 28 Dec 2004, 23:43:20 »
Sort of

They do the same thing if you issue:

fredc action ["getout", fred]
fredd action ["getout", fred]
fredg action ["getout", fred]

fred being the vehicle.


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Get out and stay out!
« Reply #9 on: 28 Dec 2004, 23:45:55 »
I used action "eject" but they still kept getting back in.

Giving them a new group seem to have solved it though

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Get out and stay out!
« Reply #10 on: 24 Jan 2005, 16:51:17 »
I had this problem.   I solved it with

"unAssignVehicle _x" forEach units _group
units _group orderGetIn false
units _group allowGetIn false

I don't know which of these commands does the trick, or if its the combination of the two.... having eventually got it to work I couldn't face figuring out why, although it seems allowGetIn might be the crucial one.
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Get out and stay out!
« Reply #11 on: 24 Jan 2005, 19:34:57 »
I remember that code.  I didn't understand it, but at least it works.  If I had remembered I would have saved myself some trouble, anyway, giving the guys a new group to belong to works as well.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Get out and stay out!
« Reply #12 on: 24 Jan 2005, 19:39:00 »
It's classic ofp code - tell a loon to do something, then bang him on the head with something else to make sure he does it.    
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Get out and stay out!
« Reply #13 on: 24 Jan 2005, 21:50:04 »
Lol ;D