ALPHIVE 14 Posted September 8, 2019 Hi everybody, I tried to make removing weapon trigger but it doesnt work ... My goal is simple : when an independant enter inside a trigger named "TR1", all of his weapons are removed I want to make a firerange with auto-weapon control system By advance, thank tou guys Share this post Link to post Share on other sites
wogz187 1085 Posted September 8, 2019 @ALPHIVE, Try something like this in the ON ACTIVATION field of your trigger, { removeAllWeapons _x } forEach units thislist; Have fun! Share this post Link to post Share on other sites
ALPHIVE 14 Posted September 8, 2019 Thank you wogz ;) Share this post Link to post Share on other sites
wogz187 1085 Posted September 8, 2019 It doesn't work though, one sec... Share this post Link to post Share on other sites
Mr H. 400 Posted September 8, 2019 Units thislist is the problem just use thislist 2 Share this post Link to post Share on other sites
wogz187 1085 Posted September 8, 2019 Like this. My bad, { removeAllWeapons _x } forEach thislist; Have fun! 2 1 Share this post Link to post Share on other sites
ALPHIVE 14 Posted September 9, 2019 It doesnt work :/ Share this post Link to post Share on other sites
wogz187 1085 Posted September 9, 2019 @ALPHIVE, Quote It doesnt work :/ It works, bro. I tested it before I posted. What's happening? Nothing? Share this post Link to post Share on other sites
ALPHIVE 14 Posted September 9, 2019 Yeah bro, nothing happens when i get inside the trigger :/ and i configured it well :/ When i get inside, my weapons are not removed :'( Share this post Link to post Share on other sites
Schatten 254 Posted September 9, 2019 @ALPHIVE, provide settings of your trigger please. 2 Share this post Link to post Share on other sites
wogz187 1085 Posted September 9, 2019 @ALPHIVE, Quote When i get inside, my weapons are not removed :'( Does it return an error? Have you tried putting, hint "it worked!"; in the trigger without the script? 1 Share this post Link to post Share on other sites
gokitty1199 225 Posted September 9, 2019 46 minutes ago, ALPHIVE said: Yeah bro, nothing happens when i get inside the trigger 😕 and i configured it well 😕 When i get inside, my weapons are not removed 😢 then your trigger settings are messed up and its not firing, do what schatten said 1 Share this post Link to post Share on other sites
ALPHIVE 14 Posted September 10, 2019 Thank you for your help guys ;) Here you can find my screenshot of my trigger configuration Share this post Link to post Share on other sites
wogz187 1085 Posted September 10, 2019 @ALPHIVE, This works for me, So server only? Are you launching as MP? Share this post Link to post Share on other sites
Mr H. 400 Posted September 11, 2019 This will only work for independents so just to be sure: you're not testing with a blufor soldier are you ? Share this post Link to post Share on other sites
pierremgi 4736 Posted September 11, 2019 The problem is: you want to remove the weapon for units entering the trigger, (and perhaps, in a second time, you'd want to give them some kind of weapon for the pattern). A trigger (repeatable) fires when the condition is met (here some indep unit present), applying the code on thisList (which is the list of compliant unit(s), usually the first one or the list at start if any). Why the first one while in game? Because the trigger scans the condition every 0,5 sec and it's harder to make 2 or more units entering at the same 0,5 sec slot. Once the condition is met, you need to deact the trigger to react it again. I'm far from Arma for testing but you need to deact (empty thisList) if you want to see a good result: The condition could be: this && thisList findIf {_x isKindOf "CAManBase" && !(count weapons _x isEqualTo 0)} > -1 This way, the trigger will fire if an infantry unit has some weapon (vehicles are not concerned), and deact after it removes all weapons of thisList, so it should rearm at the next slot. NOT TESTED The second step, adding some other weapons, if any, needs to pass a variable on each disarmed unit, to be treated apart. 2 Share this post Link to post Share on other sites
wogz187 1085 Posted September 11, 2019 @pierremgi, Quote Once the condition is met, you need to deact the trigger to react it again I only tested on a single player character. Now I understand. Trigger lists are not a "real-time" tally. A trigger creates its list at time of activation and fixes those values until it's fired again. Share this post Link to post Share on other sites
pierremgi 4736 Posted September 11, 2019 Not exactly. thisList is updated every 0,5 sec. but the code runs only at each activation. So, you think thisList isn't updated but in fact the code needs to be fired again if you want to deal with this update. The only mean to re-run such code is to deactivate (make the condition wrong again) and play the repeat. Share this post Link to post Share on other sites
ALPHIVE 14 Posted September 19, 2019 Hi guys, thank you for your help 😉 So what i really write in condition, on activation ? Share this post Link to post Share on other sites
pierremgi 4736 Posted September 20, 2019 10 hours ago, ALPHIVE said: Hi guys, thank you for your help 😉 So what i really write in condition, on activation ? Answered. Did you test it? Share this post Link to post Share on other sites
ALPHIVE 14 Posted September 20, 2019 this && thisList findIf {_x isKindOf "CAManBase" && !(count weapons _x isEqualTo 0)} > -1 Your command worked thank you bro 😉 ! 1 Share this post Link to post Share on other sites