Kolmain 6 Posted October 18, 2010 (edited) How would I check if a unit has a weapon and if they are in a vehicle of either West or East? EDIT: Found this for a weapon: ´ll describe what I did bellow, for the use of others (with less than the basic of scripting)-Created my unit, OPFOR named "me", in it init Field: this setcaptive true; removeallweapons this; -Created 4 Blufor soldiers pointing at me -created some ammoboxes -Created a trigger type "none", condition: (currentweapon me != "") or (primaryweapon me != "") or (secondaryWeapon me != ""); On act.: me setCaptive false; On Deac.: me setCaptive true; I just added the "or (primaryweapon me != "") or (secondaryWeapon me != "")" part because in the specific case, hidden weapons (like a RPG on the back) uncover the unit in my mission. When previewing it, as soon as you get a weapon, you read it´s respective hint and the enemy AIs starts to shoot. If you drop the weapon, they cease fire. Edited October 18, 2010 by Kolmain Share this post Link to post Share on other sites
kyfohatl 10 Posted October 18, 2010 Ok, you've figured it out for the weapon, heres how to check to see if a unit is in a vehicle: Its pretty simple <Name_of_unit> in <Vehicle's_name> e.g. S1 in myVehicle If unit "s1" is in "myVehicle", then the expression returns the value "true". Also, you can use the syntax below to see if a unit has a certain weapon: <Name_of_unit> hasWeapon "Weapon class" If the unit does posses the defined weapon (if you put just two "" with nothing inbetween, it should check to see if the unit has no weapons), then the expression returns a value of "true". Just one thing: I'm not sure if the weapon class should be in single quotes ('') or doule quotes (""), but I'm sure you can just test that quickly. Share this post Link to post Share on other sites
Kolmain 6 Posted October 18, 2010 what about any vehicle at all? Share this post Link to post Share on other sites
ProfTournesol 956 Posted October 18, 2010 what about any vehicle at all? vehicle name_of_unit != name_of_unit Share this post Link to post Share on other sites