Jump to content

Recommended Posts

Posted (edited)

It seems that SPAWNED groups don't RTB very well so I thought I'd just have them DEACTIVATE as they enter the RTB Zone. I've attached the simple .miz and .lua files... Can someone tell me what I'm doing wrong here??

 

-- Define the Group/Template

local Spitfire_GP1_P9374 = SPAWN:New( "Spitfire GP1 P9374" ):InitRandomizePosition(false):InitLimit( 4, 1 )

 

-- Spawn Late Activated Group/Template

local SpitfireGP1P9374 = Spitfire_GP1_P9374:Spawn()

 

-- Find/Name the Spawned Group/Template

RTB_1 = GROUP.FindByName( SpitfireGP1P9374 )

 

-- Name the RTB Zone

RTB_Funtington = ZONE:New("Funtington Zone")

 

-- RTB FUNCTION to REMOVE SPAWNED GROUPS when IN an RTB zone, BELOW an altitude (in meters?) and BELOW a speed (in kph?)

function GROUP_RTB( RTB_GP, RTB_ZONE, RTB_SPEED, RTB_ALTITUDE )

-- if RTB_GP:IsAlive() then

local RTB_GP_Position = RTB_GP:GetPositionVec3()

if (RTB_GP:IsPartlyInZone(RTB_ZONE) and (RTB_GP:GetSpeedMax() <= RTB_SPEED) and ( RTB_GP_Position.z <= RTB_ALTITUDE )) then

RTB_GP:Destroy(false) -- I think the 'false' will still allow the removal of the group; it just won't report it as a CRASH correct?

end

-- end

end

 

-- Scheduler to check every 10 seconds to see if there's a group in the RTB Zone??

SCHEDULER:New( nil,

function()

GROUP_RTB(RTB_1, RTB_Funtington, 281.6, 609.6) -- 175mph, 2000ft

end, {}, 10, 10 )

SPAWNED GP RTB TEST.miz

TEST.lua

Edited by ChuckIV
Uploaded files

"Never in the field of human conflict was so much owed by so many to so few." Winston Churchill

 

SYSTEM:

Processor - Intel® Core i9-9900KF CPU @ 3.60GHz 3600MHz water-cooled

Installed memory (RAM) - 32.0 GB

64-bit Operating System, x64-based processor

Windows 10 & DCS on SSD

Video Card - water-cooled NVIDIA GeForce RTX 2080 Ti

Internet: Cable 200Mbps 12Mbps

  • Recently Browsing   0 members

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