avibird 1 141 Posted January 16, 2017 I have a very large coop mission template that I have been working on with a modified revive script that the playable units will never die only go unconscious. How would you setup an end game trigger when all the playable/ switchable units are unconscious. Avibird. Share this post Link to post Share on other sites
avibird 1 141 Posted January 16, 2017 Any information on how to setup this kind of end mission trigger. Share this post Link to post Share on other sites
johnnyboy 3743 Posted January 16, 2017 I think your condition will look something like this. Change "unconscious _x" part to however you test if a unit is unconcious. {!(isUnconscious _x)} count (playableUnits + switchableUnits) == 0; The above is true when no playable/switchable units are conscious. How do you test if a unit is uncoucious? Share this post Link to post Share on other sites
dchan200 18 Posted January 17, 2017 3 hours ago, johnnyboy said: How do you test if a unit is uncoucious? Maybe lifeState will work. 1 Share this post Link to post Share on other sites
avibird 1 141 Posted January 17, 2017 I am not really sure I use a modified version of BTC= Quick Revive that I altered some of the files so units will never die even under water they will only go Unconscious. there are some many files of codes that I am not sure where to look for where to check or know exactly what you what me to look for. I can add a few lines together after I get some redirection from others. how would you put the lifestate into the code like this {!(lifestate _x)} count (playableUnits + switchableUnits) == 0; Share this post Link to post Share on other sites
johnnyboy 3743 Posted January 17, 2017 Well according to the wiki, if you setUnconcious a unit, his lifeState is INCAPACITATED. If your scripts are using setUncoucious command, then this should be the trigger code: {!(lifeState _x == "INCAPACITATED")} count (playableUnits + switchableUnits) == 0; If you know the name of a unit, or if you (the player) is unconcious while testing, then you can verify the lifeState of the player using the debug console. Type this into one of the 4 Watch boxes: lifeState player If it says INCAPACITATED, then we're on the right track. I suggest this because I have no idea how your revive script achieves rendering players unconscious. Share this post Link to post Share on other sites
dchan200 18 Posted January 17, 2017 I took a brief look into =BTC= Quick Revive's code and they do not use setUnconscious so lifeState will not work. Instead, each unit is given a boolean btc_qr_unc (true = unconscious). Let's modify johnnyboy's code with this in mind: {!(_x getVariable ["btc_qr_unc", false])} count (playableUnits + switchableUnits) == 0; 1 Share this post Link to post Share on other sites
avibird 1 141 Posted January 18, 2017 Thank you both for the help and education on scripting (: I can't wait to test it out on my mission. I hope this would work. I have a large coop mission with 100 playable units divided into various groups. Non of the units will ever die only go unconscious this was one component that I was missing to have the mission failed. The design of the mission is to play coop with 16 players all in control of different groups of units - infantry paratroopers armor recon medical frogman gunships ect or played by a single player like a large RTS with the ability to go first person and team switch into other units when needed. Avibird. Share this post Link to post Share on other sites
avibird 1 141 Posted January 19, 2017 @ dchan200 and johnnyboy thank you it works (: Share this post Link to post Share on other sites
4 40 Posted January 19, 2017 Late to the party but the easiest way I know of is to just do blufor countSide allUnits <= 0 because when you're incapacitated you get setCaptive'd, which means you aren't technically blufor or whatever anymore. So it works out anyway. 1 Share this post Link to post Share on other sites