SUPPA HOT FIYA 0 Posted May 24, 2017 Hi guys, I'm making ravage scenario which begins with an action packed, panicky introduction, followed by a helicopter extraction to actually start the scenario. Everything else is already finished, so this is the last challenge I'm facing and I don't know what to do. I've created a lot of units for this introduction (civilian/zombie and NATO), but I want them all gone or dead (they get cleaned up automatically really fast) once the player leaves the boundaries of a trigger. This is solely for performance purposes. I have named each individual zombie, civilian and NATO unit and tried the following: [z1, z2, z3, z4, z5, z6, z7, z8, z9, z11, z12, z13, z14, z15, z16, z17, z18, z19, z20, z21, z22, z23, z24, z25, z26, z27, z28, z29, z30, z31, z32, z33, z34, z35, z36, z37, z38, z39, z40, z41, z42, z43, z44, z45, z46, z47, z48, z49, z50, z51, z52, z53, z54, z55, z56, z57, z58, z59, z60, z61, z62, z63, z64, z65, z66, z67, z68, z69, z70, z71, z72, z73, z74, z75, z76, z79, z80, z81] setdamage 1 but this didn't work (generic expression error). the unit list should be 100% correct, I have checked it three times now (the missing units like z10 and z77/z88 are meant to be missing). What am I doing wrong? Share this post Link to post Share on other sites
sarogahtyp 1105 Posted May 24, 2017 _units = [z1, z2, z3, z4, z5, z6, z7, z8, z9, z11, z12, z13, z14, z15, z16, z17, z18, z19, z20, z21, z22, z23, z24, z25, z26, z27, z28, z29, z30, z31, z32, z33, z34, z35, z36, z37, z38, z39, z40, z41, z42, z43, z44, z45, z46, z47, z48, z49, z50, z51, z52, z53, z54, z55, z56, z57, z58, z59, z60, z61, z62, z63, z64, z65, z66, z67, z68, z69, z70, z71, z72, z73, z74, z75, z76, z79, z80, z81]; { _x setdamage 1; true } count _units; using correct syntax of setDamage helps... Therefore we have that wiki. 3 Share this post Link to post Share on other sites
Mokka 29 Posted May 24, 2017 Beat me to it, sarogah ;_; 2 Share this post Link to post Share on other sites
SUPPA HOT FIYA 0 Posted May 24, 2017 29 minutes ago, sarogahtyp said: _units = [z1, z2, z3, z4, z5, z6, z7, z8, z9, z11, z12, z13, z14, z15, z16, z17, z18, z19, z20, z21, z22, z23, z24, z25, z26, z27, z28, z29, z30, z31, z32, z33, z34, z35, z36, z37, z38, z39, z40, z41, z42, z43, z44, z45, z46, z47, z48, z49, z50, z51, z52, z53, z54, z55, z56, z57, z58, z59, z60, z61, z62, z63, z64, z65, z66, z67, z68, z69, z70, z71, z72, z73, z74, z75, z76, z79, z80, z81]; { _x setdamage 1; true } count _units; using correct syntax of setDamage helps... Therefore we have that wiki. 1 thank you, that did the trick! Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted May 24, 2017 Add this to spice things up a bit: { _x setdir random 360; _x setvelocityModelspace [random 5,random 5,10]; _x setdamage 1; true } count _units; Cheers 3 Share this post Link to post Share on other sites
Midnighters 152 Posted May 24, 2017 @Mokka for the better. *cough*. @Grumpy Old Man this is more like it. Share this post Link to post Share on other sites
Mokka 29 Posted May 24, 2017 @Midnighters I am unsure of your intentions, but as of now all I've seen from you if off-putting and insulting. This goes from discouraging people from staying active in the editing/scripting part of this game to issuing comments far off the topic present in a thread. I do not wish any further interactions with you from this point, and this is the nice way of putting things. If you are unwilling to help people because of your "pitiable" past, leave it off this board and for yourself, instead of shedding a bad light on the entirety of the Arma 3 community. Thank you. Share this post Link to post Share on other sites
pierremgi 4743 Posted May 24, 2017 5 hours ago, sarogahtyp said: _units = [z1, z2, z3, z4, z5, z6, z7, z8, z9, z11, z12, z13, z14, z15, z16, z17, z18, z19, z20, z21, z22, z23, z24, z25, z26, z27, z28, z29, z30, z31, z32, z33, z34, z35, z36, z37, z38, z39, z40, z41, z42, z43, z44, z45, z46, z47, z48, z49, z50, z51, z52, z53, z54, z55, z56, z57, z58, z59, z60, z61, z62, z63, z64, z65, z66, z67, z68, z69, z70, z71, z72, z73, z74, z75, z76, z79, z80, z81]; { _x setdamage 1; true } count _units; using correct syntax of setDamage helps... Therefore we have that wiki. Hi sarogahtyp, just a question: true in loop? what for? Share this post Link to post Share on other sites
Mokka 29 Posted May 24, 2017 This has to do with how the count command works. It expects a boolean statement as result, to indicate counting preferences. https://community.bistudio.com/wiki/count Share this post Link to post Share on other sites
pierremgi 4743 Posted May 24, 2017 Count works for boolean or nothing returned. So, you can remove the true here, as setDamage returns nothing. 1 Share this post Link to post Share on other sites
Mokka 29 Posted May 24, 2017 I do believe that it's more of a security thing, I do it this way myself as well. "Just to make sure" Share this post Link to post Share on other sites
pierremgi 4743 Posted May 24, 2017 https://community.bistudio.com/wiki/Code_Optimisation#forEach_vs_count Share this post Link to post Share on other sites
UDIE 4 Posted May 24, 2017 Midnighters, thanks for your help with the arsenal :) 1 Share this post Link to post Share on other sites
sarogahtyp 1105 Posted May 25, 2017 I do believe that it's more of a security thing, I do it this way myself as well. "Just to make sure"Yes this is the reason why I put that true in it. Sometimes u use commands in the count which returning anything and maybe u r not aware about it. In this case u get weird behaviour or errors. The true is there because I won't think about that everytime and so it prevents bug fighting.Just a security thing as u stated...sent from mobile using Tapatalk 1 Share this post Link to post Share on other sites