OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Messiah on 06 Feb 2005, 15:57:58

Title: check for gunner?
Post by: Messiah on 06 Feb 2005, 15:57:58
i was wondering if it was possible to check if a vehicle has a gunner... i went through the command reference and didnt really find anything.... i tried to search these forums, but no luck...

i need it for an init.sqs to check of a vehicle is either empty (only has gunner place) or maned from the start.

cheers  :)
Title: Re:check for gunner?
Post by: MachoMan on 06 Feb 2005, 16:04:13
Code: [Select]
isNull gunner vehicle perhaps?
Title: Re:check for gunner?
Post by: Messiah on 06 Feb 2005, 18:24:30
would that return if there was or wasnt a gunner?
Title: Re:check for gunner?
Post by: redgun on 06 Feb 2005, 20:57:04
gunner vehicle

returns who's gunner in a vehicle.
you've just to find out which value is returned when nobody is in there.

maybe objNull

so it would look like that


?(gunner veh1 == objNull): bla bla ...
Title: Re:check for gunner?
Post by: MachoMan on 07 Feb 2005, 14:13:13
No redgun that won't work!

From the comref:
Quote
objNull

Type of returned value:
Object
Description:
non-existing object. This values is not equal to anything, even to itself.

Me still thinks Mesiah should test my idea. ;)

Edit:

Hmm perhaps it will cause the example is:
Quote
Example:
player == objNull
Darn confusing comref.
Title: Re:check for gunner?
Post by: StonedSoldier on 07 Feb 2005, 15:23:05
id agree, id try;

?isNull (gunner vehicle):hint "We Need A Shooter Over Here"
Title: Re:check for gunner?
Post by: Grizzlie on 07 Feb 2005, 15:38:14
Maybe "alive gunner veh" ?

Title: Re:check for gunner?
Post by: Killswitch on 07 Feb 2005, 17:01:03
Why keep guessing? Test your assumptions before posting and just solve the problem and answer the question. And here it is:
Code: [Select]
isNull gunner somevehiclewill return the value true if the vehicle has a gunner. It will return false if the vehicle has no gunner.

If the vehicle itself isn't even equipped with a gunner position (like a civilian car) that test still works (result is false, obviously).