Jump to content

Unit:getCategory() return Object.Category?


Theodossis

Recommended Posts

  • 1 year later...
  • 5 months later...
  • 1 month later...
  • 2 weeks later...
On 11/6/2021 at 10:27 PM, Branli said:

Is this even going to be fixed? It really limits the verifying and conditional options in Mission Scripting / Mission Building...

As pointed by @Grimes in this thread

You can use Unit:getDesc()["category"] and that will return the expected value you need (0 for plane unit, 1 for helicopter, 2 for ground unit etc...).


Edited by toutenglisse
  • Like 1
Link to comment
Share on other sites

9 hours ago, toutenglisse said:

As pointed by @Grimes in this thread

You can use Unit:getDesc()["category"] and that will return the expected value you need (0 for plane unit, 1 for helicopter, 2 for ground unit etc...).

 

Thanks for the Tip! For the time being i created an elaborate workaround to check what kind of unit it is, naming the group something like "AI-TANK-01" "AI-PLANE-01" and extract the category data from the group name, but this makes it much easier.

Link to comment
Share on other sites

29 minutes ago, Branli said:

Thanks for the Tip! For the time being i created an elaborate workaround to check what kind of unit it is, naming the group something like "AI-TANK-01" "AI-PLANE-01" and extract the category data from the group name, but this makes it much easier.

Group.getCategory should work just fine since it is not a subclass of the Object hierarchy. 

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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