-
Posts
2004 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Wrecking Crew
-
Here's information on some Mist scripts that I have gathered over the years. I do like to script messages into a Mission Status script, with flags to control the flow. Maybe these examples will help you. The Flags document uses numerical values; those number values could be replaced with a naming scheme, now that flags allow alpha characters. Enjoy! Erl Sis 29C9a.miz Erl Sis Scripts.lua WC's Flags.txt WC's Script & Mist Examples.lua
-
I made a mission where the target ac (Red MiG-21Bis?) had a small diameter moving zone and when the aggressor (Blue F-86) ac lined up for a shot and got within the zone, its ROE was set to Green so it wouldn't shoot, and when it left the zone the ROE got set back to Red so it would line up again. It worked pretty well. I don't have the mission anymore... For the RTB, set a flag to On when the engagement starts and do a Time Since Flag on that flag to force the RTB.
-
Ground units not doing what they've been told
Wrecking Crew replied to Gunfreak's topic in Mission Editor
I have not had issues with Immortal or Invisible. You don't mention Alarm State. Try setting that to Green to see if your units behave better. I have found that in order to keep ground units moving through hostile territory, I'll set both Alarm State to Green and ROE to Weps Hold. -
This is what I ended up with, after testing combos of the recommendations. I kept the 'event.initiator.id_ == 73695398' bc without it there were errors -- cfrag 04 -- detect if the Hosta bridge is destroyed: -- Hosta Bridge Destroyed Flag is 91401 local mybridgedest = {} function mybridgedest:onEvent(event) if (event.id == world.event.S_EVENT_DEAD) then if(event.initiator ~= nil) then -- Franze — 02/13/2024 3:44 PM -- if(event.initiator:getCategory() == 5 and event.initiator.id_ == 73695398) then if(Object.getCategory(event.initiator) == 5 and event.initiator.id_ == 73695398) then trigger.action.setUserFlag(91401, true) trigger.action.outText("Hosta bridge destroyed! Nice job, Blue. Word", 10) end end end end world.addEventHandler(mybridgedest) --- This ^^^ works, no initiator errors. -------------------------------------------------- My friend made some points to me that I want to share,,, this is his perspective… take a peek at the id field: it's looking for id_ because that object doesn't have an id field, it's got id_ so getID will return nil because the field id isn't there for this object... even though it should be, it just has an underscore instead a number of static map objects are this way: (This is the Hosta Bridge in the pic -- WC) getID will work with most instances, but sometimes it's backward logic in DCS terms `Object.getCategory(event.initiator)` vs `event.initiator:getCategory()` : depends on what category you're trying to find as these vary from type to type; using the latter saves some guesswork if you don't want to guess whether or not the initiator is an object or not eg if you did Unit.getCategory you might get a nil result for the record, within LUA, `if(variable ~= nil) then` is functionally identical to `if(variable) then` with the exception that the first will also detect a variable set to false within LUA, everything undefined is nil myarray = {flagone = "String", flagtwo = 2} for i, d in pairs(myarray) do trigger.action.outText("Key: " .. tostring(i) .. " Value: " .. tostring(d) .. "\n", 10) end if(myarray.flagthree ~= nil) then trigger.action.outText("Oh no! Flag three has broken the space time continuum!", 10) else trigger.action.outText("Flag three is not present.", 10) end -- despite the key value flagthree not being present... ~= nil still works
-
Here we go again --- Armor deploys RPG_Team --- this clones a RPG_Team team at an armor group's position --- Tanks vs. Tanks 05 --- Mission Start Radio Add for Coalition per VGrp --- Once Deploy RPG_Team, remove Radio --- Blue --- Blue VGrp12 RPG Team --- Blue VGrp01 Tank --- Blue VGrp07 Bradley --- --- Red --- Red VGrp12 RPG Team --- Red VGrp01 Tank --- Red VGrp07 BMP --- local grpNameArmor = 'Blue VGrp01 Tank' local grpNameRPG_Team = 'Blue VGrp12 RPG Team' local unitNameArmor = Group.getByName(grpNameArmor):getUnit(1):getName() local basePos = mist.getLeadPos(grpNameArmor) local baseHeadingRad = mist.getHeading(Unit.getByName(unitNameArmor)) local baseHeadingDeg = baseHeadingRad * 180 / math.pi local newGroupRPG_Team = mist.getGroupData(grpNameRPG_Team) local newCoords = { [1] = { x = basePos.x + ((75 * math.cos(baseHeadingDeg)) - (0 * math.sin(baseHeadingDeg))), y = basePos.z + ((75 * math.sin(baseHeadingDeg)) + (0 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg, }, [2] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg + 40, }, [3] = { x = basePos.x + ((-75 * math.cos(baseHeadingDeg)) - (-75 * math.sin(baseHeadingDeg))), y = basePos.z + ((-75 * math.sin(baseHeadingDeg)) + (-75 * math.cos(baseHeadingDeg))), heading = baseHeadingDeg - 40, } } for i = 1, #newGroupRPG_Team.units do newGroupRPG_Team.units[i].x = newCoords[i].x newGroupRPG_Team.units[i].y = newCoords[i].y newGroupRPG_Team.units[i].heading = newCoords[i].heading end newGroupRPG_Team.clone = true mist.dynAdd(newGroupRPG_Team) trigger.action.outText(grpNameArmor .. ' just dropped off an RPG Team!', 20) --- end of Armor deploys RPG_Team
-
Don't you love it when you can fix it yourself? Glad you sorted it out. I would have said to split out those Sound Actions to see if that helped.
-
Appropriate TACAN channel for tanker?
Wrecking Crew replied to Drevin's topic in Missions and Campaigns
I am prolly not answering your question, so I hope this helps. I've picked this info up over the years, it's what I use... Tanker Friendly Altitudes & Speeds KC-130 is all tactical drogue, KC-135 is all boom, KC-135MPRS is all drogue KC-130 Tanker Freq 298 MHz AM, "Shell", 9Y, "SHL", 15,000' @ 336 kts, for AV-8, drouge KC-135 Tanker Freq 297 MHz AM, "Arco", 10Y "ARC", 12,000' @ 310 kts, for A-10, boom KC-135 -- 20,000' @ 410 kts, for F-15C & F-16, boom KC-135MPRS Freq 296 MHz AM, "Texaco", 11Y "TEX", 23,000' @ 430 kts, for F-14 & F/A-18, drogue IL-78M Tanker Freq 290 MHz AM, 23,000' @ 430 kts, for Su-33 AWACS Freq 277 MHz AM, "Overlord", 24,000' @ 450 EWR Freq 280 AM, "Axeman" Stennis Carrier Freq 380 MHz AM, TACAN Bearing 74X "STE", ICLS 11 Tarawa Freq 390 MHz AM, TACAN 75X "TAR", ICLS 12 -- For 250 kias. To get this set the Speed in the Mission Editor as follows: 30,000 ft. 400 kts 25,000 ft. 375 kts 20,000 ft. 350 kts 15,000 ft. 325 kts 10,000 ft. 300 kts For intermediate heights, change it by 5 kts per 1000 ft. --- Frequency Band Designations - AM Unless Specified: 30-37 (FM): Blue Ground 50-57 (FM): Red Ground 216-227: Red FARPs 228-239: Blue FARPs 271-276: Red AWACS/GCI 277-282: Blue AWACS/GCI 290-295: Red Tankers 296-302: Blue Tankers 304-314: Red Flights 315-326: Blue Flights 361-379: Red Ships 380-399: Blue Ships TACANS X Channels for Ground/Ships Y Channels for Tankers/Air Units 32-43: Red 2-11, 50-80: Blue WC's Flags.txt -
Advise noted.. I am aware of the ID issue. You and Franze talk the same language I'll work with him on my script and post it here, if that's OK with @Pizzicato to continue this conversation on this thread. I had the same problem/solution detecting 'Roki Tunnel destroyed'. Because, IIRC, Map Object Destroyed did not work.
-
cfrag - I will use your recommendation in my new mission. My pal Franze has tried both methods, and said it's easy to test with an Explode the Bridge.. will do that if my errors continue. Pizzicato - no idea why it's happening, and it is very random, maybe one in ever 20 runs of the mission, in both ME single player and on the server.
-
I was getting this 'initiator' error -- see pic. And fixed it with this line added to the code -- if(event.initiator ~= nil) then For this -- -- detect if the Hosta bridge is destroyed: -- Hosta Bridge Destroyed Flag is 91401 local mybridgedest = {} function mybridgedest:onEvent(event) if (event.id == world.event.S_EVENT_DEAD) then if(event.initiator ~= nil) then -- Franze — 02/13/2024 3:44 PM if(event.initiator:getCategory() == 5 and event.initiator.id_ == 73695398) then trigger.action.setUserFlag(91401, true) trigger.action.outText("Hosta bridge destroyed! Nice job, Blue. Word", 10) end end end end world.addEventHandler(mybridgedest)
-
Here is a mission file from @Black6 that I am going to work with. One of his scripts does the 'detect enemy aircraft with search radar'. I am hoping to use this for low level flight Blue ac vs a Red SAM site. I am starting with this from his mission.. Do Script -- Flat Face detection local DetectingUnit = Unit.getByName('P19') local TargetUnit = Unit.getByName('Tiger-1') if Controller.isTargetDetected(DetectingUnit , TargetUnit , Radar) == true then trigger.action.outText('detected by Flat Face', 10) trigger.action.setUserFlag( "11", true ) end
-
M.E. load Screen (Does this happen to you?)
Wrecking Crew replied to DishDoggie's topic in Mission Editor
I use this utility from Skatezilla that has a Repair and Clean option. I always use this to Update as it saves the previous versions. Give it a go... -
M.E. load Screen (Does this happen to you?)
Wrecking Crew replied to DishDoggie's topic in Mission Editor
It looks like we have the same setup - Win 11 and the latest DCS.. On the ME load, when I click left & right, I'll see a Windows is not responding. In Full Screen it stayed up long enough to where I clicked Continue, in Windowed Mode it went on through. Both modes loaded the mission. -
M.E. load Screen (Does this happen to you?)
Wrecking Crew replied to DishDoggie's topic in Mission Editor
I've seen that comic. The patient was reaching for his wallet -
Unable to Reuse Parking Space for Second Aircraft
Wrecking Crew replied to edwardsjethro's topic in Mission Editor
Some aircraft have a Takeoff From Ground option. That might help if you have run out of parking spaces. -
In triggers Flag Set Random Value is not random
Wrecking Crew replied to Richrach's topic in Mission Editor
Hi Tippis, folks. I did this, in my clunky way I have five sets of coordinates and want one set chosen randomly, for the first objective. When the objective is complete, another one can be accepted and the next coordinate set is randomly selected from the remaining four. Rinse and repeat. For the set up, Flag 5 is set to a random value between 1 - 5 at mission start. Then scripting will define a dictionary with values {1, 2, 3, 4, 5}. Mission Start: Flag 5 set to a random value from 1-5 Mission Start: Create a "F5Dict", and remove the current value of Flag 5 from the dictionary. Flag 5 value determines the coordinate set (one of five) for the objective -- MS, code.Create F5Dict Flag5Dict = {1,2,3,4,5} do local Flag5Value = trigger.misc.getUserFlag('5') local indexsearch = 0 for index, data in pairs(Flag5Dict) do if (data == Flag5Value) then indexSearch = index end end table.remove(Flag5Dict,indexSearch) end After the first objective is complete, the player can select to attack a second objective from the remaining four values in the dictionary; Flag 75 goes True, so Switched Condition Do Script.. -- SC, Select Next Killbox, F75T do if #Flag5Dict > 0 then local indexRand = math.ceil(math.random(#Flag5Dict)) trigger.action.setUserFlag(5, Flag5Dict[indexRand]) -- remove the new value table.remove(Flag5Dict,indexRand) end end Complete the objective. Rinse & repeat. Credit for the code help goes to Franze Boxcutter Hari 02.lua Boxcutter Hari 29S1g.miz -
There is an Action for Smoke Marker On Unit.
-
Wow, blast from the past! @Mav87th I use a "Latch" flag approach -- --- System Flags --- --- Latches: do not turn off once set --- Timers: Use for control Example -- Flag 50 goes true and is the Latch flag that will never go false again Flag 506 is the associated Timer flag and can be turned On or Off as needed. Another tip -- for every mission I have a .lua file with all of the notes, scripts, flag assignments, and events. See the attached. edit 20240228 -- updated miz file Confounded 02.lua Confounded Bridge 29C1f.miz
-
Multiple aircraft in a flight?
Wrecking Crew replied to Warlock99's topic in User Created Missions General
Big aircraft don't do well with Groups of more than 1 Unit. Make the first aircraft with its loadout, waypoints, altitude and speed. Then clone it with Cntrl-c -> Cntrl-v. Also, a Client (or Player) can be the 1st Unit in a Group that has wingmen (or wingwomen) but not 2nd, 3rd, etc. -
Perhaps this will help -- --- MS: code.Create & Load Client Tables aircraftClientBlueNames = {} aircraftClientRedNames = {} do local function contains(tbl, val) for _,v in ipairs(tbl) do if v == val then return true end end return false end for uName, uData in pairs(mist.DBs.humansByName) do if(contains({'red'}, uData.coalition)) then if not(contains(aircraftClientRedNames, uName)) then table.insert(aircraftClientRedNames, uName) end end if(contains({'blue'}, uData.coalition)) then if not(contains(aircraftClientBlueNames, uName)) then table.insert(aircraftClientBlueNames, uName) end end end end
-
SkateZilla's utility can Clean and Repair. It can manage up to six DCS installs. Here is my home screen with one DCS Open Beta install.. Here's a post about setting it up ..
-
Yes, @2circle see this DCS utility -- DCS Updater GUI Utility, by SkateZilla --
-
You tried to use the Message To All Seconds as the repeating interval, but that is not what it is for, it is for the time the message is to be displayed. A Repeat Message has to be Initiated and then use a Time Since Flag to repeat it.