Home   Help Search Login Register  

Author Topic: Checking If A Vehicle is Manned  (Read 934 times)

0 Members and 2 Guests are viewing this topic.

Javito

  • Guest
Checking If A Vehicle is Manned
« on: 12 Aug 2006, 21:47:25 »
Okay, I'm going back and testing my first mission before I post it on the Beta forum in the coming week. Making a few little tweaks here and there. One thing I'd like is this. I have an anti-tank gun which must be manned by two men of your squad. It doesn't matter who, and I want the player to be able to choose which soldiers to assign where. I want a trigger to check and see if this gun is manned but I don't know how to do it. I know how if a specific soldier like r1 is manning the gun, but I don't know how to check if -anybody- from the USSR side is. Can anyone help me out?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Checking If A Vehicle is Manned
« Reply #1 on: 12 Aug 2006, 21:59:20 »
Code: [Select]
gun_manned = false

#loop
~1
?not (side (gunner vehicle_name))=="east":goto "loop"

gun_manned = true

#loop2
?not  ((gunner vehicle_name) in vehicle_name):gun_manned = false; goto "loop1"

exit

untested but should work.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Checking If A Vehicle is Manned
« Reply #2 on: 12 Aug 2006, 22:18:20 »
Would this not work:
if (count crew vehiclename < 1) then {code for an unmanned vehicle} else {code for a manned vehicle}

?
« Last Edit: 12 Aug 2006, 22:37:07 by THobson »