OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly on 20 Jun 2004, 05:05:49

Title: Check If Soldier Is In Chopper
Post by: CopyrightPhilly on 20 Jun 2004, 05:05:49
yo,

i'm after the command to check if the soldier is in the chopper or not

i tryed
?soldier1 incargo: goto "in"

but no joy

thanks in any help

cheers, philly
Title: Re:Check If Soldier Is In Chopper
Post by: Dubieman on 20 Jun 2004, 05:09:42
I just looked at it in CHOFPSE and it is something like

?soldier1 in_heli : goto "in"

Maybe check if the person is in the vehicle, not in cargo. Maybe your not specifing the vehicle so that's why it isn't working.

Not totally sure :-\
Title: Re:Check If Soldier Is In Chopper
Post by: CopyrightPhilly on 20 Jun 2004, 05:13:12
thanks for the quick reply, but still no joy with it.

cheers, philly
Title: Re:Check If Soldier Is In Chopper
Post by: CopyrightPhilly on 20 Jun 2004, 05:22:42
ok i used

?soldier1 in _chopper: goto"in"

but it didnt wait until the soldier was in the chopper, it just did it as the leader says to get in it.

any ideas? anyone

cheers, philly
Title: Re:Check If Soldier Is In Chopper
Post by: Dubieman on 20 Jun 2004, 05:31:06
Another shot in the dark without NVGs... :P

Howsabout a double arguement.

?soldier1 in_chopper && ?soldier1 incargo_chopper :goto "in"

Maybe, I've forgotten what and is, gawd I'm tired, anyways I've haven't been writing scripts lately so....
I was thinking you could do what you did originally and add another arguement to see when the soldier is actually in the chopper not ordered.  :-\
Title: Re:Check If Soldier Is In Chopper
Post by: CopyrightPhilly on 20 Jun 2004, 05:36:24
nar it just give me another error, thanks for the help anyway GuiltyRoachKilla , and have a good night

cheers, Philly
Title: Re:Check If Soldier Is In Chopper
Post by: Chris Death on 20 Jun 2004, 05:42:33
errm - lots of shots in the dark here  ::)  :D

how about:

?soldier1 in name_of_chopper: goto "in"

or how about:

?vehicle soldier1 == name_of_chopper: goto "in"

or:

?vehicle soldier1 == name_of_chopper AND soldier1 != driver name_of_chopper AND soldier1 != gunner name_of_chopper

or:

?vehicle soldier1 != soldier1: goto "in"

:note - the last one you should use only in case if you're sure
that soldier1 is only able to board that one chopper and nothing
else.

~S~ CD
Title: Re:Check If Soldier Is In Chopper
Post by: dmakatra on 20 Jun 2004, 13:23:55
How about:

@ soldier1 in _chopper : goto "in"

If that works I'll eat your brains as penalty for noobiness. ;D

:beat: *Gets Shot* :beat:
Title: Re:Check If Soldier Is In Chopper
Post by: MachoMan on 20 Jun 2004, 19:29:34
As ever i have a better way  ;D

This will work for any chopper in the game: (hell it'll even work for planes ;) )

Code: [Select]
? "Air" counttype [vehicle soldier1] == 1 :  goto "in"

or use:

Code: [Select]
? "Helicopter" counttype [vehicle soldier1] == 1 :  goto "in"

if u strictly want it to be choppers.

EDIT:
Modified because mr. Death is right, i should have read more carefully & checked my coding for stupid mistakes ;)

Title: Re:Check If Soldier Is In Chopper
Post by: Tomb on 20 Jun 2004, 20:29:07
 ::) there are so many spell to pick that you could use belt AND braces, hehe  ;D

condition:
?bob in Air1 AND ((vehicle bob) !=bob)

Title: Re:Check If Soldier Is In Chopper
Post by: MachoMan on 20 Jun 2004, 20:47:53
Yeah, but u ppl all asume 1 thing, that he knows wich chopper the player will end up in, wich doesn't have to be the case ofcourse.
Title: Re:Check If Soldier Is In Chopper
Post by: Chris Death on 20 Jun 2004, 21:08:44
@MachoMan;

first:

@anything: do anything

doesn't work

?anything: do anything

does work

second:

Philly was asking for a command to check if soldier1 is in
the chopper - which makes me feel he's been talking
about an specific chopper.

However, if you replace your @ by an ? the condition should
work too (except: soldier1 is not the player).

@BMOT  ;D - if bob is in air1 then his vehicle isn't worth to
be compared, wether it's him or not - it isn't for sure then.
Except: air1 is an array, but why would you use it to check
then anywayz.

~S~ CD