Home   Help Search Login Register  

Author Topic: Unit in vehicle  (Read 1103 times)

0 Members and 1 Guest are viewing this topic.

pazuzu

  • Guest
Unit in vehicle
« on: 28 Jul 2005, 22:08:56 »
How do I detect a unit in vehicle?

I want to know when a squad is loaded in a chopper & use this for a trigger.

Thanks.

Offline Blanco

  • Former Staff
  • ****
Re:Unit in vehicle
« Reply #1 on: 28 Jul 2005, 22:24:39 »
The answer is stated in your question :)

Code: [Select]
unitname in vehiclename

Search or search or search before you ask.

pazuzu

  • Guest
Re:Unit in vehicle
« Reply #2 on: 28 Jul 2005, 23:31:39 »
Thanks for the quick reply...

OK, I can get this to work if all units are alive by the time they load in chopper but if any have died It wont fire the trigger so I need to check somehow if unit is alive...

I typed it like this:

p1 in acat AND p2 in acat...etc.

How would I exclude the ones that are dead so trigger will fire when whats left of the group are loaded in chopper?

Thanks.

klavan

  • Guest
Re:Unit in vehicle
« Reply #3 on: 28 Jul 2005, 23:45:53 »
({_x in acat} count units yourgroup == count units yourgroup)

Klavan
« Last Edit: 28 Jul 2005, 23:47:12 by klavan »

pazuzu

  • Guest
Re:Unit in vehicle
« Reply #4 on: 29 Jul 2005, 00:31:20 »
Thank you...

And how about detecting a unit getting out of vehicle?

What would the syntax be for that?

Thanks again.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Unit in vehicle
« Reply #5 on: 29 Jul 2005, 00:43:59 »
vehicle unitname == unitname

or

vehicle unitname != acat

or in your case if you want check for the whole group;

"vehicle _x == _x" count units yourgroup == count units yourgroup

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

pazuzu

  • Guest
Re:Unit in vehicle
« Reply #6 on: 29 Jul 2005, 03:30:51 »
Hmm, I cant get that command to work.

Could you give me another example?

I got: vehicle airman != acat

It must be wrong syntax...

Thanks.

klavan

  • Guest
Re:Unit in vehicle
« Reply #7 on: 29 Jul 2005, 19:17:17 »
To check if a man is NOT aboard of a SPECIFIC vehicle:
! unit in vehiclename
(Example : !Mike in Bradley1)

To check if a man is NOT aboard of a NON-SPECIFIC vehicle:
unit == vehicle unit
(Example : Mike == vehicle Mike)

To check if a man IS aboard of a SPECIFIC vehicle:
unit in vehiclename
(Example : Mike in Bradley1)

To check if a man IS aboard of a NON-SPECIFIC vehicle:
unit != vehicle unit
(Example : Mike != vehicle Mike)

Klavan
« Last Edit: 29 Jul 2005, 19:22:12 by klavan »

pazuzu

  • Guest
Re:Unit in vehicle
« Reply #8 on: 29 Jul 2005, 20:03:59 »
Great...thats much clearer.

Thanks for the help.

How would I use this for a whole group.

To detect group inside vehicle I use:

({_x in acat} count units grp1 == count units grp1)


Maybe just:

({!_x in acat} count units grp1 == count units grp1)

I'll give it a test...

Thanks again.

klavan

  • Guest
Re:Unit in vehicle
« Reply #9 on: 29 Jul 2005, 20:11:40 »
 ({_x in acat} count units grp1 == count units grp1)
Right if you want to check if all the units of grp1 are aboard of acat

To check if the units are NOT aboard of acat:
 ({_x in acat} count units grp1 == 0)

Klavan

pazuzu

  • Guest
Re:Unit in vehicle
« Reply #10 on: 30 Jul 2005, 02:02:26 »
OK, I'll try that.

It worked like this too:

  ! ({_x in acat} count units grp1 == count units grp1)

Just by puting a "!" before it.

Thanks for the help.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Unit in vehicle
« Reply #11 on: 30 Jul 2005, 16:53:02 »
to make it work more often you should make the check:
 ({_x in acat} count units grp1 == {alixe _x} count units grp1)
because when units die they aren't always removed from the group. it can take a while sometimes

pazuzu

  • Guest
Re:Unit in vehicle
« Reply #12 on: 30 Jul 2005, 18:49:06 »
Oh I see. Very clever

Thanks.