Jump to content

Recommended Posts

Posted

The code below is used to clone an RPG team at the position of an armor group; it is fired off with a Radio command. I want the RPG team to be Player Can Drive - is this possible with Infantry - that is not a settable option in the ME? Is there a line I could add to the code to set this attribute?

 

Also, there is a line that will set the skill level, like skill = 'excellent'. Can someone please show what that code line looks like? Like:

newGroupRPG_Team.skill = excellent ?

Thank you.

 

 

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)

 

 

I have also used this code to generate a MANPADS team when a helicopter lands for 20 seconds.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Posted

Unlike MANPAD player cannot control normal infantry... Yet. :)

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...