Jump to content

Any workarounds for DCS not recognizing spawned assets?


Recommended Posts

I've got a mission where random groups of Ground and Air Vehicles spawn in. Since they don't obviously show up in the ME, is there any way to assign points for killing them, or verifying that they are dead? I'd like to get a "Mission Complete" message, or something like that, if they are all destroyed. I suck at LUA scripting (my code is all stolen), so pretend like you're talking to a moron. :D

Link to comment
Share on other sites

I've struggled with this for dynamically created air units, I still haven't found a simple way for detecting them being dead.

 

However, an easy way to detect ground units, especially if they don't move far or at all, is to just use a ME trigger with the condition all of red out of zone.

"Through The Inferno"

Endless, Dynamic, Open-World Experience for DCS World
Link to comment
Share on other sites

Group.getByName() used to not return if the group was dead, but either it was changed as a feature or a bug. Either way I've been using this overloaded function to check if it is dead.

 

 

local function groupIsDead(groupName) -- a certain bug hasn't been fixed, so I have to use this instead. 
   if (Group.getByName(groupName) and Group.getByName(groupName):isExist() == false) or (Group.getByName(groupName) and #Group.getByName(groupName):getUnits() < 1) or not Group.getByName(groupName) then
       return true
   end
   return false
end

The right man in the wrong place makes all the difference in the world.

Current Projects: Scripting Wiki, Something...

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD, IADScript, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Thanks for the tips, I'll see what I can do. After the 2.5 merge, I REALLY hope they look at Missions and the ME. There are coders out there doing absolute magic with what they've been given to work with. The capability for much more exists, but it shouldn't be this damned confusing.


Edited by tn_prvteye
Spelling errors, not enough coffee
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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