Jump to content

MegaTherion666

Members
  • Posts

    20
  • Joined

  • Last visited

About MegaTherion666

  • Birthday 11/14/1978

Personal Information

  • Flight Simulators
    DCS
    StarCitizen
  • Location
    North America
  • Interests
    DCS

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm rather new to mist/MOOSE scripting for DCS, but this was one of the first things I wanted to use it for too There's surely a much better/cleaner method of doing this, but it was fun to figure out, seems to work well enough, and it's been a nice addition for my missions... (this uses a mist scheduler, I've been meaning to convert this to 100% moose functions... but BG3 came out :P) load mist & moose. No need to add infantry templates in the ME, uses vehicle type & coalition/country to determine troop-types; (this includes spawning wwii troops from wwii units, & some insurgent mods I've picked up somewhere for other vehicle types....) -- script to spawn crew from destroyed/disabled ground vehicles env.info("GROUND CREW LOADING...") local debug = 0 -- print debug info? --BASE:TraceAll(true) --BASE:TraceOnOff( true ) --BASE:TraceLevel( 3 ) local survivalRate = 33 -- (of 100), aka 1/3rd survival rate -- min & max radus from vehicle local spawnRadiusMin = 5 local spawnRadiusMax = 15 -- match crew number to vehicle local crewManifest = { ["BTR-80"] = { crew = 3 }, ["BTR-82A"] = { crew = 3 }, ["AAV7"] = { crew = 3 }, ["BMP-1"] = { crew = 3 }, ["BMP-2"] = { crew = 3 }, ["BMP-3"] = { crew = 3 }, ["T-55"] = { crew = 4 }, ["T-72B"] = { crew = 3 }, ["T-72B3"] = { crew = 4 }, ["T-80UD"] = { crew = 3 }, ["T-90"] = { crew = 3 }, ["SA-11 Buk LN 9A310M1"] = { crew = 2 }, ["SA-11 Buk CC 9S470M1"] = { crew = 3 }, ["SA-11 Buk SR 9S18M1"] = { crew = 3 }, ["M1126_Stryker"] = { crew = 2 }, ["M1134 Stryker ATGM"] = { crew = 2 }, ["M113"] = { crew = 2 }, ["M-1 Abrams"] = { crew = 4 }, ["M2_Bradley"] = { crew = 3 }, ["M2A2_ODS_Bradley"] = { crew = 3 }, ["Marder"] = { crew = 3 }, ["Leopard-2"] = { crew = 4 }, ["Challenger2"] = { crew = 4 }, ["M-109"] = { crew = 5 }, ["2S19_Msta"] = { crew = 5 }, ["Kub 2P25 ln"] = { crew = 3 }, ["M1043 HMMWV Armament"] = { crew = 2 }, ["M1045 HMMWV TOW"] = { crew = 2 }, ["M1126 Stryker ICV"] = { crew = 3 }, ["BRDM-2"] = { crew = 2 }, ["TPZ"] = { crew = 2 }, ["MTLB"] = { crew = 4 }, ["M-60"] = { crew = 4 }, ["M-113"] = { crew = 4 }, ["BTR_D"] = { crew = 4 }, ["LAV-25"] = { crew = 4 }, ["HPG_Toyota_ISIS"] = { crew = 2, isInsurgent = true }, ["HPG_Ural_Isis_Troops"] = { crew = 4, isInsurgent = true}, ["HPG_Ural_Isis_Covered"] = { crew = 2, isInsurgent = true}, ["HPGToyotaISISDShK"] = { crew = 2, isInsurgent = true }, ["HPGUralIsisFlak"] = { crew = 2, isInsurgent = true }, ["HPGUralIsisZU23"] = { crew = 2, isInsurgent = true }, ["ERO_TOYOTA_Desert"] = { crew = 2, isInsurgent = true }, ["tt_DSHK"] = { crew = 1, isInsurgent = true }, ["tt_KORD"] = { crew = 1, isInsurgent = true }, ["HL_DSHK"] = { crew = 1, isInsurgent = true }, ["HL_KORD"] = { crew = 1, isInsurgent = true }, ["Centaur_IV"] = { crew = 5, WWII = true }, -- WWII allies -- ["Cromwell_IV"] = { crew = 5, WWII = true }, ["Churchill_VII"] = { crew = 5, WWII = true }, ["M4_Sherman"] = { crew = 5, WWII = true }, ["M4A4_Sherman_FF"] = { crew = 5, WWII = true }, ["Tetrarch"] = { crew = 2, WWII = true }, ["M2A1_halftrack"] = { crew = 2, WWII = true }, ["M4_Tractor"] = { crew = 2, WWII = true }, ["M10_GMC"] = { crew = 5, WWII = true }, ["SPH_M109_Paladin_155mm"] = { crew = 5, WWII = true }, ["M8_Greyhound"] = { crew = 2, WWII = true }, ["Truck_Bedford"] = { crew = 2, WWII = true }, ["Car_Willys_Jeep"] = { crew = 1, WWII = true }, ["Truck_GMC_Jimmy_6x6"] = { crew = 2, WWII = true }, ["Tiger_II_H"] = { crew = 5, WWII = true }, -- WWII axis -- ["Tiger_I"] = { crew = 5, WWII = true }, ["Pz_IV_H"] = { crew = 5, WWII = true }, ["Pz_V_Panther_G"] = { crew = 5, WWII = true }, ["Stug_IV"] = { crew = 4, WWII = true }, ["Stug_III"] = { crew = 4, WWII = true }, ["JagdPz_IV"] = { crew = 4, WWII = true }, ["Jagdpanther_G1"] = { crew = 4, WWII = true }, ["Elefant_SdKfz_184"] = { crew = 6, WWII = true }, ["SPG_Brummbaer_AG"] = { crew = 5, WWII = true }, ["Sd_Kfz_234_2_Puma"] = { crew = 4, WWII = true }, ["APC_Sd.Kfz.251_Halftrack"] = { crew = 2, WWII = true }, ["SturmPzIV"] = { crew = 2, WWII = true }, ["Daimler_AC"] = { crew = 1, WWII = true }, } -- Modern soldier types local BlueUnitTypes = { "Soldier M4", --repitition = odds 1/10 for stinger / rpg "Soldier M4", "Soldier M4", "Soldier M4", "Soldier M4", "Soldier M4", "Soldier M4", "Soldier M4", "Soldier M249", "Soldier stinger", } local RedUnitTypes = { "Infantry AK", --"Infantry AK ver1", causes "unknown unit" error? "Infantry AK ver2", "Infantry AK ver3", "Infantry AK", "Infantry AK ver2", "Infantry AK ver3", "Infantry AK", "Infantry AK ver2", "Infantry AK ver3", "Infantry RPG", } -- for WWII, we'll make use of specific soldiers by name as well as randomized local USsoldier = "soldier_wwii_us" local UKsoldier = "soldier_wwii_br_01" local GermanSoldier = "soldier_mauser98" local WWIIBlueUnitTypes = { USsoldier, UKsoldier, } local WWIIRedUnitTypes = { GermanSoldier, } local Insurgents = { "InsurgentMod", --"Insurgent AK-74", } local targetBailPercentage = 50 -- at what health percentage does the crew bail? (must be monitoring S_EVENT_HIT) -- DEPRECATED local spawnedGroups = {} --track units that have spawned crew -- define template data for crew local function SoldierTemplate (groupName, groupType) --bare minimum template data; populate name & type here local unitTemplate = { ["name"] = groupName, ["units"] = { [1] = { ["skill"] = "Average", ["coldAtStart"] = false, ["type"] = groupType, ["playerCanDrive"] = false, }, -- end of [1] }, -- end of ["units"] } return unitTemplate end -- Define the vehicle destruction event handler function onGroundVehicleDamaged(event) --if event.id == world.event.S_EVENT_HIT then if event.id == world.event.S_EVENT_BDA then local survivalCoinFlip = math.random(1, 100) if survivalCoinFlip <= survivalRate then if event.initiator ~= nil and event.target ~= nil then -- Get details on participants to the event local InitiatorUnit = event.initiator:getName() local InitiatorType = event.initiator:getTypeName() local InitiatorCoal = event.initiator:getCoalition() local TargetName = event.target:getName() local TargetType = event.target:getTypeName() local TargetCat = event.target:getDesc().category local TargetCoal = event.target:getCoalition() or 3 local TargetPos = event.target:getPosition().p local TargetCountry = event.target:getCountry() if debug == 1 then MESSAGE:New("DEBUG EVENT: " .. InitiatorUnit .. " type(" .. InitiatorType .. ") -> " .. TargetName .. " type(" .. TargetType .. ")(" .. TargetCat .. ") TargetCoal: " .. TargetCoal, 10,"SPAWN"):ToAll() end if TargetCat == 2 then -- if ground targets ... if crewManifest[TargetType] then -- if unit included on crewManifest, returns true local targetHealth = event.target:getLife() local targetMaxHealth = event.target:getLife0() local targetHealthPercentage = targetHealth / targetMaxHealth * 100 -- When unit is injured beyond certain point, crew bails --if targetHealthPercentage < targetBailPercentage then --track spawnedGroups so no dupes local groupKey = TargetName .. "_" .. TargetType if not spawnedGroups[groupKey] then spawnedGroups[groupKey] = true if debug == 1 then MESSAGE:New(TargetName .. "'s (" .. TargetType .. ") health is below 10% = " .. targetHealthPercentage .. "% at " .. TargetPos.x .. " x " .. TargetPos.z, 10,"SPAWN"):ToAll() end --define crew compliment according to manifest, randomize crewAlive local crewMax = crewManifest[TargetType].crew or 2 -- Default to 2 if TargetType not found (should be crewmax) local crewAlive = math.random(1, crewMax) local crewCount = 0 for i = 1, crewAlive do -- for each member of the crew... crewCount = crewCount + 1 -- Define the randomized radius around the damaged vehicle where infantry will be spawned local radius = math.random(spawnRadiusMin, spawnRadiusMax) local heading = math.random(0, 360) -- Randomize the heading of the infantry units local offsetX = radius * math.cos(math.rad(heading + (i * 360 / crewAlive))) local offsetY = radius * math.sin(math.rad(heading + (i * 360 / crewAlive))) local spawnPosition = { x = TargetPos.x, y = TargetPos.z, -- CRITICAL mis-match -- y-to-z here makes correct placement?? z = land.getHeight({ x = TargetPos.x, y = TargetPos.y }) -- Get the ground altitude at the target's x, y position } -- Add the offsets to the spawn position spawnPosition.x = spawnPosition.x + offsetX spawnPosition.y = spawnPosition.y + offsetY --random selection from the list of coalition groups local initCoal = nil local initSide = nil local RandomUnit = nil -- select solider type on some conditions... if TargetCoal == 1 then if crewManifest[TargetType].WWII == true then --RandomUnit = WWIIRedUnitTypes[math.random(1, #WWIIRedUnitTypes)] RandomUnit = GermanSoldier else RandomUnit = RedUnitTypes[math.random(1, #RedUnitTypes)] -- move to puremoose no ME end initSide = coalition.side.RED elseif TargetCoal == 2 then if crewManifest[TargetType].WWII == true then if TargetCountry == country.id.UK then RandomUnit = UKsoldier elseif TargetCountry == country.id.USA then RandomUnit = USsoldier else RandomUnit = WWIIBlueUnitTypes[math.random(1, #WWIIBlueUnitTypes)] end else RandomUnit = BlueUnitTypes[math.random(1, #BlueUnitTypes)] -- see if you can replace the previous method end initSide = coalition.side.BLUE end -- insurgents could be from anywhere/anytime if crewManifest[TargetType].isInsurgent == true then RandomUnit = Insurgents[math.random(1, #Insurgents)] end local newGroupName = RandomUnit .. "_" .. TargetName .. "-" .. i local Template = SoldierTemplate(newGroupName, RandomUnit) --populate customized template local newAlias = "Soldier" -- generic name, can be same alias among soldiers local initCoal = TargetCountry --units should inherit the vehicle country local initCat = Group.Category.GROUND -- must be set on init local heading = math.random(1, 360) -- random heading for everyone -- spawn from modified template rather than require placed unit local soldier = SPAWN:NewFromTemplate(Template, newGroupName, newAlias) :InitCountry(initCoal) :InitCoalition(initSide) :InitCategory(initCat) :InitHeading(heading) :OnSpawnGroup( function(grp) if debug == 1 then MESSAGE:New(initSide .. " Spawned: "..grp:GetName(),15,"SPAWN"):ToAll() end end ) :SpawnFromVec2(spawnPosition) if debug == 1 then MESSAGE:New(" ... SPAWN from '" .. TargetType .. "' (" .. RandomUnit .. ") " .. crewCount .. " of " .. crewMax .. " crew at " .. spawnPosition.x .. " x " .. spawnPosition.y , 10,"SPAWN"):ToAll() end end -- end crew foreach end else -- log VechicleTypes we don't have included on the CrewManifest, but ignore soldier types local isRedUnitType = false local isBlueUnitType = false local isWWIIRedUnitType = false local isWWIIBlueUnitType = false local isInsurgent = false for _, unitType in ipairs(RedUnitTypes) do if unitType == TargetType then isRedUnitType = true break end end for _, unitType in ipairs(BlueUnitTypes) do if unitType == TargetType then isBlueUnitType = true break end end for _, unitType in ipairs(WWIIRedUnitTypes) do if unitType == TargetType then isWWIIRedUnitType = true break end end for _, unitType in ipairs(WWIIBlueUnitTypes) do if unitType == TargetType then isWWIIBlueUnitType = true break end end for _, unitType in ipairs(Insurgents) do if unitType == TargetType then isInsurgent = true break end end if not (isRedUnitType or isBlueUnitType or isWWIIRedUnitType or isWWIIBlueUnitType or isInsurgent) then --if debug == 1 then MESSAGE:New("MISSING VEHICLE in script :----> No crewManifest for TargetType '" .. TargetType .. "' ", 15,"SPAWN"):ToAll() --end env.info("GROUND CREW NOTICE:----> No crewManifest for TargetType: " .. TargetType .. " ") end --end --if targetHealthPercentage end end end end --coinflip end end -- Register the event handler for the unit damage event mist.addEventHandler(onGroundVehicleDamaged) MESSAGE:New("Ground Vehicle Crews LOADED", 10,"SPAWN"):ToAll() env.info("GROUND CREW LOADED.") spawn_vehicle_crew_on_destruction.lua
  2. -searched the steam store again today: it now shows the correct/full "Normandy 2.0" in my library: jumped in game, and indeed -- it appears fixed now (I didn't have to fiddle with any DLC/downloads at all) case closed?
  3. just to show ya what we're dealing with here: not quite what it looked like on youtube ... (my settings are maxed)
  4. yea, I believe Normandy 1.0 expanded to incorporate the new areas.
  5. it certainly seems to me like a Steam issue: Search the store again now for "DCS Normandy" and see what's actually marked as "In Library" for you - I Purchased: DCS: Normandy 2 Upgrade , which states: "... for those of you who own DCS: Normandy 1944 and DCS: The Channel maps" -so should have received Normandy 2.0 aka, 'the new map'. However, this map itself is not marked as "in Library". Instead, I've got DCS: Normandy 2 Upgrade from Normandy 1944 (the $20 upgrade for "Normandy 1.0 only" owners) in my library - so yea, I got both upgrades when I bought the first one, but no actual Normandy 2.0 map. Following the links in your "Manage DLC" show the same mixup, so I'd say this is indeed something steam has to sort out for us. So I assume the 'blurry textures' are really just still Normandy 1.0.
  6. An observation of something maybe out of place: fwiw, I own the channel + normandy 1.0, so naturally I opted for the $14 upgrade on steam, not the slightly more $20 "only own 1 of these" upgrade. Now, on the DCS 'page' in my steam library, in the DLC sidebar on the right, it's showing two "Normandy 2.0" badges, but they both have the 'upgrade' text on the picture? (bottom left of badge, hard to make out in the screenshot) I would expect only one of these would have the 'update' text? (similar to the BS3 shown here as well, which was an upgrade from BS2) EDIT: searching the steam store again for "DCS Normandy" seems to imply that I own the two upgrades (I only purchased the $13.42 one) ... ... yet I apparently do not own Normandy 2.0 itself? EDIT2: ...and under "Manage my DLC" here, while it is listing that I own "Normandy 2.0 and Normandy 2.0 Upgrade 2", the "Normandy 2.0" links to the "Normandy 2.0 Upgrade from normandy 1944" store item. Certainly seems like there's a wire crossed here...
  7. This is going to be a very unique experience for DCS (fending off 109's & co from a turret), likely to re-invigorate the WWII scene a bit - can't wait! This needs to be an 'official' module - astounding work so far. Can't wait to get ahold of the skin template....
  8. RAF No.109 Squadron HS-F DK333 - "the Grim Reaper" https://www.digitalcombatsimulator.com/en/files/3329766/ stripped off most of my w.i.p weathering layers as it's probably not going to be done in time, so calling this one 'done enough' ... for now.
  9. Thanks for the quick response -that's what I figured - but was hoping it could be all done in script. "one day" maybe
  10. heyo - new to mist/lua/scripting here; -I've been reading the docs, scripting up some examples & tests... and come upon a question- hope this is the right place to ask... ...it looks to me like there's various trigger.actions for a lot of the actions available in the mission editor (ex, trigger.action.outSound = the "play sound file" action). -But I don't see a trigger.action for the various (somewhat newer) 'show picture to ____' actions? -Can I somehow trigger a 'show picture to ____' action from a lua script? Any info would be much appreciated, thanks!
  11. The 'old vessel' and tug look fairly passable in a WWII setting: but I'd love to see something like a era-suitable passenger ocean liner for a big juicy target in shipping convoys
  12. this is a fantastic addition! I can't believe the timing, as I was just messing around trying to stack static panzers on flatbed railcars the other day (they clip through). I'll 2nd the notion of a WWII variant -- most of all, I'd _love_ to see something like this https://sketchfab.com/3d-models/schwerer-gustav-2k-a412a347b48b47a9ba965a3807decc37 how and where do we donate? -- I'd be willing to grease some wheels for this sort of thing
  13. Ok, I've made the necessary lua edits for this mod to work in 2.8 -and also renamed these from generic naming 'hanabi 4/6/8' to the names of the actual firework forms these seek to imitate. Hope ya don't mind... HANABI Fireworks.zip
×
×
  • Create New...