Purzel 35 Posted July 24, 2014 Hi there, can anyone tell me what to write into the condition field, if a player/unit has ist weapon in his/its hands...? I need this for an undercover-mission. When the units have drawn their weapons, they should be engaged by enemy units. My undercover-unit is set to "this setcaptive true". I did a .sqf-file where the unit will be set to "setcaptive false" for 3 minutes, wenn shots are fired by my units. if Shots are fired: {_x addEventHandler['Fired',{shotIsFired = true}]} forEach (units group this); then: UC1 setcaptive false; UC2 setcaptive false; UC3 setcaptive false; sleep 180; UC1 setcaptive true; UC2 setcaptive true; UC3 setcaptive true; now I want the same, if they have their weapons in their hands instead of their backpacks. I just need the condition for that... THX a lot! Greetz Purzel Share this post Link to post Share on other sites
barbolani 198 Posted July 24, 2014 This: https://community.bistudio.com/wiki/primaryWeapon If the return is "" then, they have their weapon in backpack or no weapon. Please check it, I'm at the office. Share this post Link to post Share on other sites
Jona33 51 Posted July 24, 2014 https://community.bistudio.com/wiki/currentWeapon Might work better than primaryWeapon. If you're doing it properly you'd check PrimaryWeapon, CurrentWeapon, SecondaryWeapon and HandgunWeapon Share this post Link to post Share on other sites
Purzel 35 Posted July 24, 2014 (edited) Please help, i´ve no idea how this works... I´m the "copy & paste" scripter..., but I don´t understand anything about scripting.. I need this as a condition... I don´t know, how to change those codes to a working condition. Edited July 24, 2014 by Purzel Share this post Link to post Share on other sites
Jona33 51 Posted July 24, 2014 Ok no worries, note, what appears below depends on what you want to do, if you want to make it so that when weapons are dropped you will go back to being captive then include the DeAct line and set the trigger to be repeatable, if you want to make it so that when you're holding weapons your cover is blown and you will be permanently regarded as the enemy leave the trigger as once and don't include the DeAct line. Condition: !(currentWeapon UC1 == "") On Act: UC1 setCaptive false; On DeAct: UC1 setCaptive true; This is the simplest way, but some mods allow you to holster your weapon, and have no weapons in your hand meaning that you could have a machine gun on your back but that wouldn't activate the trigger. So the other way is Condition: !(PrimaryWeapon UC1=="") or !(SecondaryWeapon UC1=="") or !(HandgunWeapon UC1=="") OnAct: UC1 setCaptive false; DeAct: UC1 setCaptive true; Share this post Link to post Share on other sites
Purzel 35 Posted July 24, 2014 Great! Tomorrow i will test this! Share this post Link to post Share on other sites
Purzel 35 Posted August 7, 2014 Great it works...! Unfortunatly its working too, when I was throwing a chemlight... hahaha! But I guess, this will not be changeable... :-( A big "Thanks!" for your help! Greetings Purzel Share this post Link to post Share on other sites
Poupoko 10 Posted May 4 On 7/24/2014 at 8:01 PM, Jona33 said: Ok no worries, note, what appears below depends on what you want to do, if you want to make it so that when weapons are dropped you will go back to being captive then include the DeAct line and set the trigger to be repeatable, if you want to make it so that when you're holding weapons your cover is blown and you will be permanently regarded as the enemy leave the trigger as once and don't include the DeAct line. Quote Condition: !(currentWeapon UC1 == "") On Act: UC1 setCaptive false; On DeAct: UC1 setCaptive true; This is the simplest way, but some mods allow you to holster your weapon, and have no weapons in your hand meaning that you could have a machine gun on your back but that wouldn't activate the trigger. So the other way is Quote Condition: !(PrimaryWeapon UC1=="") or !(SecondaryWeapon UC1=="") or !(HandgunWeapon UC1=="") OnAct: UC1 setCaptive false; DeAct: UC1 setCaptive true; Hello, it doesn't work for me. 😢 I made a cideo so you can see : https://streamable.com/pr7ayx I still get shot Share this post Link to post Share on other sites
Necropaulo 31 Posted May 4 Hey @Poupoko, i've wrote a little incognito script a few months ago. I don't use setCaptive, but joinSilent to civilian side : //Undercover by P.Milkman - 2023 //bob is your player //1. Place a trigger on the map of any size. //2. Set type and activation to "NONE" //3. Set it to trigger "Repeatedly" //4. In the condition field place the following: currentWeapon bob == "" && secondaryWeapon bob == "" // you can add a lot of condition about gears too with : && vest bob == "" && headgear bob == "" or headgear bob == "H_Booniehat_oli" etc... //to select autorized gears //5. In the "On Act." field place: [bob] joinSilent createGroup civilian; hint "You're undercover !"; //6. In the "On Dea." field : [bob] joinSilent createGroup west; hint "You're hostile !"; I hope it will help you 😁 Share this post Link to post Share on other sites
Poupoko 10 Posted May 4 7 hours ago, Necropaulo said: Hey @Poupoko, i've wrote a little incognito script a few months ago. I don't use setCaptive, but joinSilent to civilian side : //Undercover by P.Milkman - 2023 //bob is your player //1. Place a trigger on the map of any size. //2. Set type and activation to "NONE" //3. Set it to trigger "Repeatedly" //4. In the condition field place the following: currentWeapon bob == "" && secondaryWeapon bob == "" // you can add a lot of condition about gears too with : && vest bob == "" && headgear bob == "" or headgear bob == "H_Booniehat_oli" etc... //to select autorized gears //5. In the "On Act." field place: [bob] joinSilent createGroup civilian; hint "You're undercover !"; //6. In the "On Dea." field : [bob] joinSilent createGroup west; hint "You're hostile !"; I hope it will help you 😁 Hey man that's really cool thank you ! But I spent the evening trying to make on the other script workand finally managed to get it done ! Just toise 0 or 1 instead of true or false 🥲 Share this post Link to post Share on other sites