Jump to content

Death Merchant

Members
  • Posts

    65
  • Joined

  • Last visited

About Death Merchant

  • Birthday 08/30/1968

Personal Information

  • Flight Simulators
    IL2, DCS
  • Location
    Charlotte NC
  • Interests
    Flight Sim, Robotics, Data Science, Model Building
  • Occupation
    Software Engineer (automation)

Recent Profile Visitors

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

  1. Mist is awesome. I'm learning it right now. Are there any sample scripts that I can look at to help me learn? Thanks, DM
  2. Is it possible to send a Datalink target from a ground unit to a Ka-50? I'm working on a Border Defense mission where Ka-50 pilots will be responding to attacks at border stations. I know I can send coords via screen messages, but can a Datalink target be sent directly to Ka-50s? Thanks, DM
  3. Is it possible to send a Datalink target from a ground unit to a Ka-50? I'm working on a Border Defense mission where Ka-50 pilots will be responding to attacks at border stations. I know I can send coords via screen messages, but can a Datalink target be sent directly to Ka-50s? Thanks, DM
  4. That works beautifully, thanks for the suggestion, but I'm having one problem. When I spawn using coalition.addGroup() the Mi-24P spawns with empty pylons, even though I have them in the unit table. I'm having trouble finding an example of the format for the table, except for the one here: https://wiki.hoggitworld.com/view/DCS_exam_group_heli Is there a collection of sample missions/scripts somewhere I can look at? Thanks for all the help, I really appreciate your time. DM
  5. Thanks for the clarification on the dynAdd function. Perhaps you can offer a suggestion on how to accomplish the following: This part works: The mission has a list of start and stop zones (CS-*, and CE-*). The mission spawns a random number of convoys that start at a random zone and drive to a random zone using coalition.addGroup and mist.groupToRandomZone. What I'd like to do is spawn a helo tasked with escorting the group along it's route. Any thoughts? coalition.addGroup? Thanks for the help. DM
  6. How an I going to tanker without auto-throttle?
  7. I'm trying us dynAdd to add an Mi-24P to escort a convoy. The helo spawns with unit name Escort-2-1 as expected, but the group name is RUSSIA hel 1. The pylons are also empty. When I try to get it's route using mist.getGroupRoute("Escort-2") I get an error. Can you tell me what's wrong with this code? if heloAdded == false then BASE:E("##### Helo Info #####") BASE:E("## Truck Group Data ##") local TruckData = mist.getGroupData("Truck") BASE:E(TruckData) BASE:E("## Helo Info ##") local HeloData = mist.getGroupTable("Escort") BASE:E(HeloData) --###### Spawn Escort #####-- BASE:E("##### Spawn Escort #####") local GroupData = mist.getGroupData("Escort", true) BASE:E(GroupData) BASE:E("##### Following Group #####") BASE:E(GroupID) --##### Helo Unit Info #####-- local HeloGroupID = mist.getNextGroupId() local HeloUnitID = mist.getNextUnitId() local EscortUnits = { [1]= { ['alt']=361.97297275484, ['alt_type']='BARO', ['livery_id']='af 440 ovp', ['skill']='High', ['ropeLength']=15, ['speed']=11.669422301483, ['AddPropAircraft']= { ['TrackAirTargets']=true, ['SimplifiedAI']=false, ['ExhaustScreen']=true, ['PilotNVG']=true, ['GunnersAISkill']=90, ['R60equipment']=true, ['OperatorNVG']=true, }, ['type']='Mi-24P', ['unitId']=HeloUnitID, ['psi']=-0.4111427285092, ['x']=8926.4008762495, ['y']=74360.971148126, ['unitName']='Escort-2-1', ['groupName']='Escort-2', ['payload']={ ['pylons']={ [1]={['CLSID']={'2x9M220_Ataka_V'}}, [2]={['CLSID']={'APU-60-1_R_60M'}}, [5]={['CLSID']={'APU-60-1_R_60M'}}, [6]={['CLSID']={'2x9M220_Ataka_V'}}, }, ['fuel']=1701, ['flare']=192, ['ammo_type']=1, ['chaff']=0, ['gun']=100, ['restricted']={}, }, ['onboard_num']='016', ['callsign']='107', ['heading']=5.1035771188166, ['point']= { ['y']=74360.971148126, ['x']=8926.4008762495, }, ['category']='helicopter', ['country']='russia', ['groupId']= HeloGroupID, ['coalition']='red', ['countryId']=0, }, } local EscortRoute = { [1] = { ["alt"] = 500, ["type"] = "TakeOffGroundHot", ["action"] = "From Ground Area Hot", ["alt_type"] = "BARO", ["form"] = "From Ground Area Hot", ["y"] = 74367.382190126, ["x"] = 8872.6877408358, ["speed"] = 41.666666666667, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { [1] = { ["enabled"] = true, ["key"] = "CAS", ["id"] = "EngageTargets", ["number"] = 1, ["auto"] = true, ["params"] = { ["targetTypes"] = { [1] = "Helicopters", [2] = "Ground Units", [3] = "Light armed ships", }, ["priority"] = 0, }, }, [2] = { ["enabled"] = true, ["auto"] = false, ["id"] = "Follow", ["number"] = 2, ["params"]= { ["lastWptIndexFlagChangedManually"] = true, ["groupId"] = GroupID, ["lastWptIndex"] = 2, ["lastWptIndexFlag"] = true, ["pos"]= { ["y"] = 457.2, ["x"] = -76.2, ["z"] = 200, }, }, }, }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] }, -- end of [1] } vars = { units = EscortUnits, country = 0, category = 'helicopter', route = EscortRoute, } mist.dynAdd(vars) Route = mist.getGroupRoute("Escort-2", true) BASE:E("##### Escort-2 Route #####") BASE:E(Route) heloAdded = true BASE:E(heloAdded) end end I'm using this code after spawning a random convoy, with a random start and destination. The group ID to follow is the group ID of the last unit in the convoy.
  8. The Helo is spawning with the Unit Name Escort-1, but with the Group Name RUSSIA hel 1. I'm looking for more examples of the tables needed to use this function, but I'm not finding much. I've updated the units table: local EscortUnits = { [1]= { ['alt']=361.97297275484, ['alt_type']='BARO', ['livery_id']='af 440 ovp', ['skill']='High', ['ropeLength']=15, ['speed']=11.669422301483, ['AddPropAircraft']= { ['TrackAirTargets']=true, ['SimplifiedAI']=false, ['ExhaustScreen']=true, ['PilotNVG']=true, ['GunnersAISkill']=90, ['R60equipment']=true, ['OperatorNVG']=true, }, ['type']='Mi-24P', ['unitId']=HeloUnitID, ['psi']=-0.4111427285092, ['x']=8926.4008762495, ['y']=74360.971148126, ['unitName']='Escort-2-1', ['groupName']='Escort-2', ['payload']={ ['pylons']={ [1]={['CLSID']={'2x9M220_Ataka_V'}}, [2]={['CLSID']={'APU-60-1_R_60M'}}, [5]={['CLSID']={'APU-60-1_R_60M'}}, [6]={['CLSID']={'2x9M220_Ataka_V'}}, }, ['fuel']=1701, ['flare']=192, ['ammo_type']=1, ['chaff']=0, ['gun']=100, ['restricted']={}, }, ['onboard_num']='016', ['callsign']='107', ['heading']=5.1035771188166, ['point']= { ['y']=74360.971148126, ['x']=8926.4008762495, }, ['category']='helicopter', ['country']='russia', ['groupId']= HeloGroupID, ['coalition']='red', ['countryId']=0, }, } It's still not working.
  9. Greetings coding gurus, I am trying to use the mist.dynAdd function to spawn an Mi-24P and load a route so that it will follow a convoy based on a Unit ID. The helo is spawning properly but doesn't seem to load the route properly, it is also spawned with empty pylons for some reason. After spawning I use Route = mist.getGroupRoute("Escort-2", true) to try to grab the route and output it via BASE:E(Route) but this error message: 2023-07-25 11:29:59.528 ERROR SCRIPTING (Main): MIST|getGroupRoute|8171: Escort-2 not found in mist.DBs.MEgroupsByName Here is the code I am using. I figure there is a problem with the tables I have created. local EscortUnits = { [1]= { ['alt']=361.97297275484, ['point']= { ['y']=74360.971148126, ['x']=8926.4008762495, }, ['alt_type']='BARO', ['livery_id']='af 440 ovp', ['onboard_num']='016', ['category']='helicopter', ['unitName']='Escort-2-1', ['AddPropAircraft']= { ['TrackAirTargets']=true, ['SimplifiedAI']=false, ['ExhaustScreen']=true, ['PilotNVG']=true, ['GunnersAISkill']=90, ['R60equipment']=true, ['OperatorNVG']=true, }, ['type']='Mi-24P', ['country']='russia', ['psi']=-0.4111427285092, ['groupId']= HeloGroupID, ['groupName']='Escort-2', ['skill']='High', ['coalition']='red', ['x']=8926.4008762495, ['payload']={ ['pylons']={ [1]={['CLSID']={'2x9M220_Ataka_V'}}, [2]={['CLSID']={'APU-60-1_R_60M'}}, [5]={['CLSID']={'APU-60-1_R_60M'}}, [6]={['CLSID']={'2x9M220_Ataka_V'}}, }, }, ['callsign']='107', ['heading']=5.1035771188166, ['unitId']=292, ['y']=74360.971148126, ['countryId']=0, ['speed']=11.669422301483, }, } local EscortRoute = { [1] = { ["alt"] = 500, ["type"] = "TakeOffGroundHot", ["action"] = "From Ground Area Hot", ["alt_type"] = "BARO", ["form"] = "From Ground Area Hot", ["y"] = 74367.382190126, ["x"] = 8872.6877408358, ["speed"] = 41.666666666667, ["task"] = { ["id"] = "ComboTask", ["params"] = { ["tasks"] = { [1] = { ["enabled"] = true, ["key"] = "CAS", ["id"] = "EngageTargets", ["number"] = 1, ["auto"] = true, ["params"] = { ["targetTypes"] = { [1] = "Helicopters", [2] = "Ground Units", [3] = "Light armed ships", }, ["priority"] = 0, }, }, [2] = { ["enabled"] = true, ["auto"] = false, ["id"] = "Follow", ["number"] = 2, ["params"]= { ["lastWptIndexFlagChangedManually"] = true, ["groupId"] = GroupID, ["lastWptIndex"] = 2, ["lastWptIndexFlag"] = true, ["pos"]= { ["y"] = 457.2, ["x"] = -76.2, ["z"] = 200, }, }, }, }, -- end of ["tasks"] }, -- end of ["params"] }, -- end of ["task"] }, -- end of [1] } vars = { units = EscortUnits, country = 0, category = 'helicopter', groupName = 'Escort-2', groupID = GroupID + 1, clone = false, route = EscortRoute, } mist.dynAdd(vars) Route = mist.getGroupRoute("Escort-2", true) BASE:E("##### Escort-2 Route #####") BASE:E(Route) heloAdded = true BASE:E(heloAdded) Thanks for the help, DM
  10. How are you trying to get the weapon info? Weapon = Event.weapon:getCategory() Should return the value of the category. https://wiki.hoggitworld.com/view/DCS_Class_Weapon Do you mind sharing your code? I have built something similar using S_EVENT_HIT to record kills. Sometimes you need to do some error handling such as: if Event.initiator.country ~= nil then
  11. Yep, bad definition. I forgot I was pulling names from a table, and not the zone object. This fixed it: SA19Spawn:SpawnInZone(ZONE:FindByName(samZone["Zone"]), true) -- Add Tunguska to SAM Zone Thanks for the help, DM
  12. Can someone help me with this error? 2023-07-19 11:06:35.385 ERROR SCRIPTING (Main): Mission script error: [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis00001939.lua"]:19167: attempt to call method 'GetRandomVec2' (a nil value) stack traceback: [C]: in function 'GetRandomVec2' [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis00001939.lua"]:19167: in function 'SpawnInZone' [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis0000581A.lua"]:336: in function 'LoadRandomSAMs' [string "C:\Users\James\AppData\Local\Temp\DCS.openbeta\/~mis0000581A.lua"]:426: in main chunk I'm trying to spawn a unit at a random location in a zone. local randSpawn = math.random(5) BASE:E("Tunguska if 3 or less.") BASE:E(randSpawn) if randSpawn <= 3 then SA19Spawn:SpawnInZone(samZone, true) -- Add Tunguska to SAM Zone BASE:E("Spawning SA-19") end The other units are spawning properly, but I get an error when MOOSE tries to call the GetRandomVec2 function. Any thoughts? Thanks, DM
  13. Yep.. we're taking it offline. No worries.
  14. Yeah, alt is engaged, I can tell by the *. I'm in Baro. It only works if I trim well, but won't hold in turns. Hhmmm.. I've been having problems in MP. I'll try it in a local mission and see if it acts differently.
×
×
  • Create New...