Jump to content

lua functions unit:getMinRange() & unit:getMaxRange() & unit:getDetectionRange() & unit:pointInRange(vec3)


Kappa-131st

Recommended Posts

In the mission editor, we can see yellow and red circles indicating respectively the maximum detection range and the maximum firing range.
There is also a minimum range for some models.

It would be interesting to create lua functions to return its information, as well as a function indicating if a point or a unit are "within range" of fire. This can be used in particular for artillery script, or dca...

Function we needed : 

- unit:getMinRange() return minimum range of unit in metter
- unit:getMaxRange() return maximum range of unit in metter (red circle)
- unit:getDetectionRange() return maximum detection Range in metter (yellow circle)
- unit:pointInRange(vec3) param point (vec3) of a position. Return boolean (true/false) if a param "point" is between min and max range.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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