Jump to content

Recommended Posts

Posted

I'm trying to piece together a conquest type mission where aerodromes can be captured when a player parks in a specific zone for a specific amount of time. I can not figure out how to script the removal of any vehicle within a zone to allow for a propper aerodrome capture.

 

In essence:

 

If blue coalition in "capturezone" for 360 seconds then

remove all [red][vehicle] from "airfield zone"

MISTclone BLUE vehicles in "airfield zone" (zone around the airfield ownership circle on F10 map)

Message: 'Airfield is now BLUE'

else do same for RED capture

 

 

Scripting the ownership of an Aerodrome would be ideal but I'm aware that is not currently possible. I know how to make everything work except the removal of any coalition vehicle (placed with CTLD or MIST clones). Any help would be a huge stress relief and greatly appreciated.

Posted

Self Bump. This is what I have so far, but not sure if I'm using the Destroy func properly

 

local redunits = mist.makeUnitTable({'[red][vehicle]'})
local zone_name = {'capture'}
local units_capture = mist.getUnitsInZones(redunits, zone_name, 'cylinder')
for i = 1, #units_capture do -- iterate through the units
Unit.getByName(units_capture):destroy()
   end
end

Posted

Got it! Last reply for reference for anyone else.

 

local redunits = mist.makeUnitTable({'[red][vehicle]'})
local zone_name = {'capture'}
local units_capture = mist.getUnitsInZones(redunits, zone_name, 'cylinder')
for i = 1, #units_capture do -- iterate through the units
units_capture[i]:destroy()
end

 

If anyone has any tips or more efficient ways to make this idea happen, please let me know. LUA is a blast to learn!

  • Recently Browsing   0 members

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