Jump to content

Recommended Posts

Posted

I'm writing a script to track whether a bomb has landed in a zone to trigger events and I've noticed that when testing with Mk-82 bombs on the F-16, when my script checks what ammo I have loaded it returns MK-82s as being in category 3 (bombs).  This is as expected.  When I initiate a shot event and check the weapon returned by the shot event for category, it's a category 2 (rocket). I'm guessing this is a bug within DCS but I'm not sure.  Any ideas?

To be clear my idea in checking category is to make the script hopefully work with any bomb so players can modify their loadouts if they desire and not break the script.  I guess the other way to do it would be to check for all valid typeNames returned by the bombs that are valid ordnance to be dropped from player aircraft but this seems ridiculously time consuming when I should just be able to validate a category enum.

Posted

There has been a long standing behavior where getCategory returns the object category and not any sub-category within that object type. Its returning whether it is a unit, weapon, static object, base, etc. 

The workaround, especially if using weapons, is to use getDesc() and then check the weapon category and other info like missileCategory or guidanceType

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

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

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