GrizzlyBear83 Posted November 28, 2018 Posted November 28, 2018 (edited) I'm not completely sure how to do this, or even explain! But I'm gonna do a CAS/BAI mission were you fly out to an area with lots of vehicles to attack. When destroying say four fixed targets (fuel tanks for instance) I can do triggers no problem; like target one destroyed and you get a message, a "Flag On" and a trigger firing so I can for instance "stack" the flags (1 through 4) for a final trigger saying all targets destroyed plus mission goals/points for each target. But with say some 10-15 tanks and other assorted vehicles I want to do accumulated destruction on the targets; say the player destroyed 49% of the targets you get those 49 points, not enough for a mission success, but 50% or more targets destroyed you get the vaunted mission success/mission goal points. And so forth. Am I making myself clear? Back in the Jane's F/A-18 days I could do this no problem. I've learned most stuff to make missions in DCS by looking at other authors missions, but this is eluding me. Like I looked at the missions in the Hornets Nest campaign where the author does exactly like I want to do... But I didn't understand how to set everything up. Help appreciated in some form. Thanks. Edited November 28, 2018 by GrizzlyBear83
dark_wood Posted November 28, 2018 Posted November 28, 2018 You need goals (from the left menu in ME): "When evaluating a mission for success, draw, or failure, the simulation uses point totals that are assigned by the mission builder. If total points at the end of a mission are 49 or less, the mission is a failure; if total points equal 50, the mission is a draw. If total points are 51 or higher, the mission is deemed a success. This point total is also used to define which stage and mission may be chosen next in a campaign. The same set of conditions used in the Trigger system is also used to define mission goals. In the Goal window, the list of all created goals is displayed in the top pane. Once a goal is selected by clicking on it, the conditions of the goal are listed in the bottom pane." More details here: https://srv0files.eagle.ru/dcs/manuals/DCS_User_Manual_EN.pdf page 106 (or simply search goals).
GrizzlyBear83 Posted November 28, 2018 Author Posted November 28, 2018 (edited) Not exactly what I was looking for, more how to have a trigger registering accumulated x ammount of destroyed targets. Is it "Group Alive Less Than" and you set the percentage? Edited November 29, 2018 by GrizzlyBear83
Pikey Posted November 28, 2018 Posted November 28, 2018 A dead eventhandler is ideal for this. you will need to check the name of the unit that died is something you set yourself to avoid counting other things. In moose it would be as easy as making a SET of all tanks and a scheduler to count the ones left alive every so often. This way would avoid a lot of event processing when you have a death, which can cause a stutter. I'm not sure of a ME only solution, it's starting to get beyond the GUI here. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
QuiGon Posted November 28, 2018 Posted November 28, 2018 Funny, I just made a mission that includes exactly such a validation. I achieved this with a small LUA script which I can give you when I'm home later today if you want. Intel i7-12700K @ 8x5GHz+4x3.8GHz + 32 GB DDR5 RAM + Nvidia Geforce RTX 2080 (8 GB VRAM) + M.2 SSD + Windows 10 64Bit DCS Panavia Tornado (IDS) really needs to be a thing!
dark_wood Posted November 28, 2018 Posted November 28, 2018 Not exactly what I was looking for, more how to have a trigger registering accumulated x ammount of destroyed targets. Is it "Group Alive Less Than" and you sent the percentage? Well, if you combine goals with "MISSION SCORE HIGHER THAN" condition - you got a trigger, but if i understand correctly, you need a score on each unit destroyed, not groups.
GrizzlyBear83 Posted November 29, 2018 Author Posted November 29, 2018 (edited) Funny, I just made a mission that includes exactly such a validation. I achieved this with a small LUA script which I can give you when I'm home later today if you want. I'd love that. Although I use MIST, and not the other script file. A lot of things to consider it seems. I looked at other missions and some authors use Group Alive Less Than, so I just copied their trigger setup exactly in my missions as well as mission score. Will see what happens. I'm building a large campaign with the F/A-18, and will convert it to the F-14 as well down the line and, it's a good process to learn the editor, even if I'm doing very simple editing at the moment. Edited November 29, 2018 by GrizzlyBear83
Frag Posted November 29, 2018 Posted November 29, 2018 I did the exact same thing few weeks ago. Here is how you can do it without the use of MOOSE or MIST. Create a trigger for each vehicle that should count as destroyed that way: TRIGGER TYPE: Once Comment: [a name of your choice] EVENT: NOEVENT CONDITIONS TYPE: UNIT DEAD UNIT: [the unit] ACTIONS ACTION: FLAG INCREASE FLAG: 900 (or any other number you want to use as flag number) VALUE: 1 Then at the end of your mission, create two trigger (I trigger my end mission when the plane is parked back in its parking space). In the following example, you need to kill 11 targets to win. One for mission success TRIGGERS TYPE: Once Comment: [a name of your choice] EVENT: NOEVENT CONDITIONS 1 TYPE: FLAG IS MORE FLAG: 900 VALUE: 10 CONDITIONS 2 TYPE: UNIT INSIDE ZONE UNIT: [your plane unit] ZONE: [Define a zone where you will park your plane] ACTIONS ACTION: MESSAGE TO ALL TEXT: MISSION SUCCESS!!! SECONDS: 10 One for mission failure TRIGGERS TYPE: Once Comment: [a name of your choice] EVENT: NOEVENT CONDITIONS TYPE: FLAG IS LESS FLAG: 900 VALUE: 11 CONDITIONS 2 TYPE: UNIT INSIDE ZONE UNIT: [your plane unit] ZONE: [Define a zone where you will park your plane] ACTIONS ACTION: MESSAGE TO ALL TEXT: MISSION FAILURE SECONDS: 10 Don't hesitate to contact me to fine tune it. For the example place the final parking space not at the same location as the initial parking space so the triggers will not fire at the mission start. I personally park back at the same location, but I had to add one more condition to both those final triggers to make sure that those dont fire at the beginning of the mission. But I did not explain those here to keep the example simple.
QuiGon Posted November 29, 2018 Posted November 29, 2018 I'd love that. Although I use MIST, and not the other script file. Sorry for the late reply, but here it is: tanksDestroyed = 0 tanksDamaged = 0 for i = 1,12,1 do tank = 'Tank' .. i keks = StaticObject.getByName(tank):getLife() if keks < 5 then if keks > 0 then tanksDamaged = tanksDamaged + 1 else tanksDestroyed = tanksDestroyed + 1 end end end trigger.action.outTextForCoalition(coalition.side.BLUE, tanksDestroyed .. " fuel tanks destroyed", 10, false) trigger.action.outTextForCoalition(coalition.side.BLUE, tanksDamaged .. " fuel tanks damaged", 10, false)This script iterates through the objects/units that are supposed to be checked, checks their status (damaged or destroyed) and displays two messages with the number of damaged and destroyed objects/units. for i = 1,12,112 is the number of objects/units that are to be checked tank = 'Tank' .. iIn my example the objects that are to be checked are static fuel tanks, which I named Tank1, Tank2, Tank3, ... Tank12. So I use the variable tank to iterate through them. life = StaticObject.getByName(tank):getLife()life holds the health status of the object/unit. As I used fuel tanks in my case, I had to use "StaticObject.getByName(tank):getLife()", but if you have units you have to use "Unit.getByName(tank):getLife()". Remember that the variable tank has to have the name of the unit (e.g. Tank1 in my case). Intel i7-12700K @ 8x5GHz+4x3.8GHz + 32 GB DDR5 RAM + Nvidia Geforce RTX 2080 (8 GB VRAM) + M.2 SSD + Windows 10 64Bit DCS Panavia Tornado (IDS) really needs to be a thing!
GrizzlyBear83 Posted December 1, 2018 Author Posted December 1, 2018 Awesome guys! Gonna try em both. Thanks a lot!
Recommended Posts