-
Posts
1996 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Wrecking Crew
-
-
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
-
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...
-
1
-
-
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.
-
1
-
-
4 hours ago, cfrag said:
This kind of reminds me of an old joke:
"Hey doctor, whenever I do this it hurts!"
I've seen that comic. The patient was reaching for his wallet
-
-
On 3/26/2024 at 8:02 AM, Tippis said:
Some of this could probably be fixed by scripting up what is probably what is more often the desired outcome: a specific set of numbers, but in random order, or at least some kind of weighted function where previous results are less likely to reappear. I.e. not random at all in the literal sense, but more appealing to the intuitive sense of what a random pattern should look like.
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
-
1
-
2
-
-
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 controlExample --
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
-
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
-
See the attachment. Someday I'll clean this up
WC's Script & Mist Examples.lua
Much of what is in here came from the help that I got in this forum.
-
2
-
-
-
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.
-
-
-
Here is a way to keep a message up, by repeating it...
-
Here is an example. It's long ...
This is yours --
if trigger.misc.getUserFlag(5),1) == 5 then
is missing a "(" like this Flag((5,1) == 5,,,, but I don't know if that actually works
local msg = {} msg[#msg + 1]='Welcome to the Witches Hollo mission! \n \n' if trigger.misc.getUserFlag('30000') == 0 then -- All Four Objectives Still Alive -- Blue Counter F30000 is False msg[#msg + 1]='Blue must clear out the Witches Hollo of the Red HQ and three Red Camps. See the Briefing for HQ & camp target coordinates. \n \n' msg[#msg + 1]='Use JTAC Hummers to spot targets and laser designate. \n \n' msg[#msg + 1]='Go Blue! \n \n' msg[#msg + 1]='Blue to win: \n' msg[#msg + 1]='Destory the Red HQ and three camps: East Camp, Central, and West. \n \n' msg[#msg + 1]='See the Radio F10 Menu for mission options including Restart. \n \n' end if trigger.misc.getUserFlag('30000') == 1 then -- Three Objectives Still Alive if trigger.misc.getUserFlag('30101') == 0 then -- RDR VGrp01 HQ Alive msg[#msg + 1]='Very nice Blue pilots -- one camp was destroyed. \n \n' msg[#msg + 1]='Finish the mission objectives. Destroy the Red HQ building! \n' else -- RDR VGrp01 HQ Dead FT 30101 msg[#msg + 1]='Very nice Blue pilots -- the Red Headquarters was destroyed! \n \n' msg[#msg + 1]='Finish the mission objectives -- destroy the three Red camps at Witches Hollo. \n' end end if trigger.misc.getUserFlag('30000') == 2 then -- Two Objectives Destroyed, Two Still Alive if trigger.misc.getUserFlag('30101') == 0 and trigger.misc.getUserFlag('33001') == 0 then -- HQ & Central Camp Alive msg[#msg + 1]='Blue pilots -- destroy the Red Headquarters at Witches Hollo! \n \n' msg[#msg + 1]='The Central Red camp is also operational. \n \n' msg[#msg + 1]='Destroy these two targets to finish the mission objectives. \n' end if trigger.misc.getUserFlag('30101') == 0 and trigger.misc.getUserFlag('33101') == 0 then -- HQ & East Camp Alive msg[#msg + 1]='Blue pilots -- destroy the Red Headquarters at Witches Hollo! \n \n' msg[#msg + 1]='The East Red camp is also operational. \n \n' msg[#msg + 1]='Destroy these two targets to finish the mission objectives. \n' end if trigger.misc.getUserFlag('30101') == 0 and trigger.misc.getUserFlag('33201') == 0 then -- HQ & West Camp Alive msg[#msg + 1]='Blue pilots -- destroy the Red Headquarters at Witches Hollo! \n \n' msg[#msg + 1]='The West Red camp is also operational. \n \n' msg[#msg + 1]='Destroy these two targets to finish the mission objectives. \n' end if trigger.misc.getUserFlag('30101') == 1 then -- HQ Plus One Camp Dead msg[#msg + 1]='Very nice Blue pilots -- the Red Headquarters was destroyed! \n \n' msg[#msg + 1]='Finish the mission objectives -- destroy the last two Red camps at Witches Hollo: \n' if trigger.misc.getUserFlag('33001') == 0 then -- Central Camp Alive msg[#msg + 1]=' Central Camp \n' end if trigger.misc.getUserFlag('33101') == 0 then -- East Camp Alive msg[#msg + 1]=' East Camp \n' end if trigger.misc.getUserFlag('33201') == 0 then -- West Camp Alive msg[#msg + 1]=' West Camp \n' end msg[#msg + 1]='\n \n' end end if trigger.misc.getUserFlag('30000') == 3 then -- Three Objectives Destroyed if trigger.misc.getUserFlag('30101') == 0 then -- HQ Alive msg[#msg + 1]='Blue pilots -- the Red Headquarters building is still operatonal. \n \n' msg[#msg + 1]='Destroy this structure to complete the mission objectives and send the red dogs back to Kaspi! \n \n' end if trigger.misc.getUserFlag('33001') == 0 then -- Central Camp Alive msg[#msg + 1]='Blue pilots -- The Central Red camp is still operatonal. \n \n' msg[#msg + 1]='Destroy this fortification to complete the mission objectives! \n \n' end if trigger.misc.getUserFlag('33101') == 0 then -- East Camp Alive msg[#msg + 1]='Blue pilots -- the East Red camp is still operatonal. \n \n' msg[#msg + 1]='Destroy this fortification to complete the mission objectives! \n \n' end if trigger.misc.getUserFlag('33201') == 0 then -- West Camp Alive msg[#msg + 1]='Blue pilots -- the West Red camp is still operatonal. \n \n' msg[#msg + 1]='Destroy this fortification to complete the mission objectives! \n \n' end end if trigger.misc.getUserFlag('30000') > 3 then -- All Objectives Destroyed msg[#msg + 1]='Blue wins today hooray! Fun flying under the clouds. \n \n' msg[#msg + 1]='All mission objectives are met! \n \n' msg[#msg + 1]='Mop up any remaining Red units around Witches Hollo. \n \n' end trigger.action.outText(table.concat(msg), 25)
-
8 hours ago, SickSidewinder9 said:
Or can we make it not break IC somehow?
Yep. Had to turn off IC on the Hollo Pointe server for this
-
1
-
-
Interesting..
Perhaps you renamed the Unit Name to a value that is now the first in the list? What is the Unit Name?
-
I think Rudel_chw's answer is correct.
I will reply that the mission will start with the first unit that is placed in the mission. When I think about it, I like to have the first unit being a Reaper or a F-117. I don't know how it could be changed once the new mission gets saved.
-
22 hours ago, MadKreator said:
Quick side-track here… Do you like Open Mod Manager better than OVGME?
Yes. I used JSGME way back for rFactor. I tried OVGME but found OMM and chose it because it is up to date. I set up my OMM like this, it took a couple of tries -
C:\Users\..\Saved Games\DCS Mods\DCS Open Beta\Library
And
C:\Users\..\Saved Games\DCS Mods\DCS Open Beta\Backup
-
1
-
Identical Events not all receiving the same Event data.
in Scripting Tips, Tricks & Issues
Posted
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.