Is there away to set events happening based on weapons loadouts or even type of jet? So I have a template training scenario set up right now. Ground targets and air targets. I know about triggers but was wondering if one could set stuff to spawn based on jet type and load out.
Rough example would be
player enters trigger 1 in a M2000C loaded with 2 magics and 2 supers. This spawns 4 SU-27s. But if you entered the trigger with GBU-12s instead of Magics and Supers it would spawn a JTAC to lase ground targets instead of SU-27s.
Or will I have to due separate triggers. So if Im loaded with A/A I hit trigger 1 and A/G I hit trigger 2.
If unit in zone or group. Make each group easily identify able like AA1 AG1.
Trigger would be:
Once/ GROUP In zone/group aa1/ ai activate/ AA enemy
Where AA enemy is placed with late activation box checked
Is it possible to set a flag with a trigger based on weapons load out? So enter Trigger zone and then have flag 1 true if 2x supers and flag 2 false. But enter the same zone and have flag 1 false with 2x 12s and flag 2 true?
There is a Bomb In Zone Condition that I have not used. But me thinks it would only be detectable if dropped. Set up a zone close to your jet in air start and see if you can get a message out by flying through it with a bomb loadout.
Ill give it a shot. Thanks
hmmm that seems to be for released bombs, there is one for missiles too. I think I figured out away to do what I want though. It will involve random explosions at mission start but it might work.
In the example, the only real IF THEN is the Mirage with A2A load out. Your JTAC would be there to lase things no matter what.
The task then is to have the sim sending Su-27s or not. @Cib’s Group designation wold be the easiest way, however, you may want the choice to be made on the ramp sing the in sim load out window.
If that’s the case, you might want to consider some sort of altitude flight profile to distinguish A2G from A2A. Setting an altitude range for A2A along with the trigger zone should work - for example…above 18,000 ft MSL = A2A mission and thus an A2A load out, and a set of Su-27s is then activated. Could add in a speed range - above 650 knots along with the altitude. Not perfect but might be worth a try.
I believe getAmmo should return the current loaded ammunition on a unit:
Sure…if you want to explore the depths of Lua code! (just kidding. good call )
An accurate description of scripting:
Not Lua programming but. For a BEAR escort mission I wanted the BAR to loop around until I got close enough, and then head off on a new course for a maritime patrol (MARPAT).
Set Flag 1 to 0 value (off)
Set the BEAR in a loop between WP 1 and WP2.
Set WP 3 to start of BEAR’s MARPAT legs
Set a Start Intercept zone of 150 m
Set a trigger to turn Flag 1 to on when my unit gets inside Start Intercept Zone
Set a ME action to Go To WP 3 if Flag 1 is active.
Didn’t work. evidently I had to drop out f the Loop Action first so I set that acton to end when Flag 1 goes to on and keep the Go To WP3 action when Flag 1 goes to on.
Technically it still doesn’t work. Rather than go directly WP3, it goes to WP 1 first…because its the start of the Lop command?…but at this time it is “good enough for government work” … although I’d really like it to go directly to WP3.
Use task Orbit instead, then use a task push to switch their waypoint to the desired one.
I wrote loop - I meant Orbit.
In that case, it sounds like you need to clear the Orbit task out; you can use a script but I think there’s a triggered action to do so.
An easy peasy way is set up some F10 Radio selections for your targets. Repeat a message to make the selection before takeoff.
I have scripts that detect client takeoff and type of aircraft. Ill post a copy in a bit…
Or put a Stop condition in the Orbit Action.
You can put a moving zone on the Bear, and a Stop Orbit when a Blue plane gets inside the zone.
I made a mission where the Red was aggressive until in the Blue Recon Plane’s moving zone then set Red to ROE HOLD and back to Free when out of the zone. It worked really well such that Red harassed the Blue all day long with close fly bys. Guns only and the moving zone radius was just under the Red gun range.
ME Stuff -
Temp.zip (14.5 KB)
The Jumeriah Keyhole.lua shows how to detect client aircraft by era. You may be able to use this with Franze’s suggestion of getAmmo.
Subject is on topic even though this one thread has been hibernating.
Would someone who is savvy with DCS World mission editor triggers please tell me what is wrong with the triggers in this simple mission I created. I get the initial “Good luck!” message then get the ships are dead message when taking out the tanks, nothing for the mission completion. Trying to learn the trigger system and not finding any clearly written docs (at least that my pea brain can understand). TIA for any assistance. march3.zip (9.6 KB)
Your conditions are all “coalition in zone” when they should be “all coalition out of zone.”
Thank you so much, Franze! That was all it took.
If I may ask, what resources do you use for mission building reference?
I have tried multiple YouTube videos but they just do not seem to be clear in describing what to be done.