avibird 1 155 Posted September 29, 2019 For some reason most likely mine loli can't get the mission to end when all units are killed. I have attempted multiple codes in the trigger with activation opfor and not present. These mission triggers work before. Share this post Link to post Share on other sites
avibird 1 155 Posted September 29, 2019 I was at my BBQ lol here are some of the codes. condition ((east countSide allUnits) + (Independent countSide allUnits)) == 0 on activation "END1" call BIS_fnc_endMissionServer; condition TriggerActivated "Trig1" on activation "Trig1" call BIS_fnc_endMission; Share this post Link to post Share on other sites
gokitty1199 225 Posted September 29, 2019 a suggestion, since triggers would be constantly checking the condition, it may be better to check if all opfor/independents are eliminated via a entityKilled event handler so its only going to check each time something dies instead of every like (is it 3ms for triggers?). addMissionEventHandler ["EntityKilled", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _opAndIndiRemaining = count (allUnits select {side _x isEqualTo east || side _x isEqualTo independent}); if (_opAndIndiRemaining <= 0) then { "EveryoneWon" call BIS_fnc_endMissionServer; }; }]; 2 Share this post Link to post Share on other sites
avibird 1 155 Posted September 29, 2019 Hey thank you I will try this. Do I put this in a game logic mission init ect. Where do I put the code. The triggers usually works I don't know why it will not work now. Your way is most likely more efficient then the trigger 😉 Share this post Link to post Share on other sites
gokitty1199 225 Posted September 29, 2019 Just now, avibird 1 said: Hey thank you I will try this. Do I put this in a game logic mission init ect. Where do I put the code. The triggers usually works I don't know why it will not work now. Your way is most likely more efficient then the trigger 😉 off a glance it looks correct. put it in initServer.sqf Share this post Link to post Share on other sites
avibird 1 155 Posted September 29, 2019 I still don't understand why a simple trigger will not work when Opfor and ind units are not present to end mission. Share this post Link to post Share on other sites
avibird 1 155 Posted September 30, 2019 Ok got a simple trigger to work when all of opfor is killed in the trigger area. Trigger Type end #1 Activation opfor Activation type not present Condition this On activation endmission "end1"; Simple trigger that works but I would like to add independent units to that as well. Help would be great Share this post Link to post Share on other sites
wogz187 1086 Posted September 30, 2019 @avibird 1, Quote I would like to add independent units to that as well Try like this, opforTRIG = createTrigger ["EmptyDetector", getpos _thisPOS]; opforTRIG setTriggerArea [100, 100, 100, false, 0]; opforTRIG setTriggerActivation ["EAST", "NOT PRESENT", true]; opforTRIG setTriggerTimeout [0, 0, 0, true]; opforTRIG setTriggerStatements ["this && GUER countSide thislist == 0", """Success!"" call BIS_fnc_endMission;",""]; Have fun! 1 Share this post Link to post Share on other sites
Gunter Severloh 4064 Posted September 30, 2019 Simpler version: Put 2 triggers down and let them overlap, they will be area triggers where both independent and opfor will be inside. Place a 3rd trigger no size. Trigger1 Variable name: c1 Activation: Independent activation type: not present on activation: c1UnitsDead = true; Trigger2 Variable name: c2 Activation: OPFOR activation type: not present on activation: c2UnitsDead = true; Trigger3 No size Condition: c1unitsdead && c2unitsdead on activation: [ ] call BIS_fnc_endMission; 2 1 Share this post Link to post Share on other sites
wogz187 1086 Posted September 30, 2019 @avibird 1, Right. So-called "old-school" editor triggers... 1 trigger: Type: end #1 Activation: OPFOR Activation Type: not present Condition: this && GUER countSide thislist == 0 On Activation: hint "Good Job";😉 @Gunter Severloh's triggers are great if you want to determine IND and EAST separately. Like, "We've killed all those pesky rebels. Now, it's time for CSAT to pay!". 1 2 Share this post Link to post Share on other sites
gokitty1199 225 Posted September 30, 2019 am i the only one who thinks its a bad idea to have triggers rapidly checking to see if a side is dead(not being a dick im honestly asking if it would be considered worse or better than the below method as i just dont use trigger conditions ever)? specifically having multiple triggers that are constantly checking the exact same thing for 2 sides when you can check everything only when a unit dies right away? i just read your post again and im assuming you want to check and see if any of those (opfor and independent) units are inside of the trigger area, you can simply do this and remove the constant trigger condition checks all together with this in initServer.sqf. this checks only when one of the units die and not continually, just a quick little blurp if that makes sense and checks only for the amount of units inside of the trigger area. if you want to change it to all the opfor/independent units across the entire map just remove inAreaArray enemyCountTrigger. enemyCountTrigger being the name of the trigger for this test addMissionEventHandler ["EntityKilled", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _opAndIndiRemaining = count (allUnits select {side _x == east || side _x == independent} inAreaArray enemyCountTrigger); if (_opAndIndiRemaining <= 0) then { "EveryoneWon" call BIS_fnc_endMissionServer; }; }]; if you want to check opfor and independent separately just do this addMissionEventHandler ["EntityKilled", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _IndiRemaining = count (allUnits select {side _x == independent} inAreaArray enemyCountTrigger); _opforRemaining = count (allUnits select {side _x == east} inAreaArray enemyCountTrigger); //do whatever you want with the number of remaining opfor/independent }]; 2 Share this post Link to post Share on other sites
avibird 1 155 Posted September 30, 2019 @wogz187 your suggestion above not work 😞 @gokitty1199 I am old school for sure. I like to see things on the map when I am designing and making the mission. I don't really know how much it will really affect game performance this way or that way. I am curious to really know is there a big difference in performance wise. I will definitely give your suggestion a run and see how it works. I am always open to new things but always rely back on what I know. @Gunter Severloh 5 triggers is a lot for one thing. There must be a way to call it correctly in one trigger. But at least I have options now 😊 Share this post Link to post Share on other sites
wogz187 1086 Posted September 30, 2019 @avibird 1, Quote your suggestion about this not work Me bad? Type: end #1 Activation: Independent Activation Type: not present Condition: this && EAST countSide thislist == 0 On Activation: hint "Good Job";@gokitty1199, Quote its a bad idea to have triggers rapidly checking to see if a side is dead It most certainly is but It's also a common practice and I think, if not overused, the performance impact is negligible. Have fun! 1 Share this post Link to post Share on other sites
gokitty1199 225 Posted September 30, 2019 5 minutes ago, wogz187 said: It most certainly is but It's also a common practice and I think, if not overused, the performance impact is negligible. Have fun! do you by chance know how often triggers check their conditions? i saw someone posted it a few weeks ago but for the life of me i cannot find that post Share this post Link to post Share on other sites
wogz187 1086 Posted September 30, 2019 Just now, gokitty1199 said: do you by chance know how often triggers check their conditions? i saw someone posted it a few weeks ago but for the life of me i cannot find that post Every half second, I think. Just like whileTrue's. So even having a waitUntil with a 3-5 second delay spawn at mission start would be more efficient than using triggers. And your method above being magnitudes more efficient than that. 1 Share this post Link to post Share on other sites
gokitty1199 225 Posted September 30, 2019 2 minutes ago, wogz187 said: Every half second, I think. Just like whileTrue's. So even having a waitUntil with a 3-5 second delay spawn at mission start would be more efficient than using triggers. And your method above being magnitudes more efficient than that. that seems about right since it prints out hints pretty quickly with just a slight delay sometimes, thank you. scripting ftw 1 Share this post Link to post Share on other sites
pierremgi 4890 Posted September 30, 2019 Yes a trigger checks the condition every 0.5 sec. Using trigger or EH is OK. The problem here is to avoid a count inside an area as big as the map (so position related for nuts here). So forget the presence inside the trigger area, or a use of inArea inside the EH. Focus on global count: EAST countSide allUnits == 0 && INDEPENDENT countSide allUnits == 0 or better allUnits findIf {side group _x in [EAST,INDEPENDENT]} == -1 2 Share this post Link to post Share on other sites
avibird 1 155 Posted September 30, 2019 @pierremgi thank you for your input on this. So there are many ways to get thinks to work in Arma but what is the easiest and more efficient way? I like to have options and multiple ways so I can learn educate myself. Where does your code go to be called. Do I put it into a trigger sqf ECT how do I call it for the mission. Share this post Link to post Share on other sites
pierremgi 4890 Posted September 30, 2019 You have choice between (works in SP/MP): the easiest: a simple trigger (not server only, no area), type #end1, with: allUnits findIf {side _x in [EAST,INDEPENDENT]} == -1 in condition field or, if you prefer a scripted way, in initServer.sqf: addMissionEventHandler ["EntityKilled", { if (allUnits findIf {side _x in [EAST,INDEPENDENT]} == -1) then {"EveryoneWon" call BIS_fnc_endMissionServer} }]; The second one is probably preferable, especially when you have plenty of units (>200). Note: But I'm not sure it's the most reliable. The MEH fires ONLY on each kill but what if a multiple final kills (enemy helo crash, without anymore unit to kill after that)? I don't know. You can just hope that the final MEH (several for crash) will meet the condition. This remark is just an intuition, not a proven tested fact. On the other hand, a trigger will check for the condition every 0.5 sec., no matter the "events". So, you have countless and regular opportunities to finally meet the condition. 1 1 Share this post Link to post Share on other sites
avibird 1 155 Posted September 30, 2019 @pierremgi thank you I will test it out tonight as well as @gokitty1199 @Gunter Severloh and @wogz187 suggestions to see if I notice any performance differences. I am old school I like to see things on the map when I am design in the mission. Share this post Link to post Share on other sites
avibird 1 155 Posted October 20, 2019 @gokitty1199 @wogz187 @pierremgi and @Gunter Severloh None of your suggestions or codes worked to end the mission for both OPFOR and IND units when dead/not present in the mission or trigger area. The only one I can get to work is @Gunter Severloh three trigger setup😊 There must be a way to setup this up with only one trigger I am sure of it but lack the knowledge. Open to more suggestions or ideas! 1 Share this post Link to post Share on other sites
Gunter Severloh 4064 Posted October 20, 2019 You've had several answers already for one trigger, i dont see what the issue is, unless you have a mission that has 200+ units on it and your not caching them, and its taken you 6 months to build like my ISIL Foothold then 3 triggers isn't going to kill the fps. Just place down what works and go with it, nobody but you will know and or see the triggers. What does your mission have in it that is making you worried about performance, or what exactly are you worried about? Share this post Link to post Share on other sites
avibird 1 155 Posted October 20, 2019 😊 well your code with the multiple trigger setup is the only one that works. I do have over 200 units in the mission. I don't have an issue with things on the map and per our conversation but still want to learn how to get things working with different methods of setup. Yes I have the mission ending when all units are killed or not present in the AO but with your setup the missions ends abruptly with no fading music just the snowed screen. Just messing around in the editor to see how things work. So yes I am still looking for a one trigger setup or a initServer.sqf setup to end the mission when all opfor ind units are killed or not present that works because the other options provided above do not work to end the mission only your setup with three trigger setup. It was greatly appreciated by the way 😊 Share this post Link to post Share on other sites
jandrews 116 Posted October 20, 2019 1 hour ago, avibird 1 said: 😊 well your code with the multiple trigger setup is the only one that works. I do have over 200 units in the mission. I don't have an issue with things on the map and per our conversation but still want to learn how to get things working with different methods of setup. Yes I have the mission ending when all units are killed or not present in the AO but with your setup the missions ends abruptly with no fading music just the snowed screen. Just messing around in the editor to see how things work. So yes I am still looking for a one trigger setup or a initServer.sqf setup to end the mission when all opfor ind units are killed or not present that works because the other options provided above do not work to end the mission only your setup with three trigger setup. It was greatly appreciated by the way 😊 200+ units all over map? Why not just spawn in the # units as mission progresses. Then script the trigger with final 1-2 squads spawned for mission end? Share this post Link to post Share on other sites
Gunter Severloh 4064 Posted October 20, 2019 56 minutes ago, jandrews said: Why not just spawn in the # units as mission progresses. Yup may be the best way imo. From my AI compilation list script section: AI Caching and Distribution SP/MP by Naughthttp://tinyurl.com/q7y8nba An SQF script designed to dynamically cache and distribute AI units across machines for maximum performance. Editor based AI script by trigger SP/MP by Murklorhttp://www.armaholic.com/page.php?id=26909 This script caches the units placed on the map and spawns them when needed. Share this post Link to post Share on other sites