Jump to content

Lula scripting : getting airbase


CougarFFW04

Recommended Posts

Using only whats available in DCS you can do it by setting a flag based on the unit being inside a zone and having its speed less than 1 knot (works pretty good for a normal fixed wing aircraft).

 

You have to make trigger zones around the airbases. Then you can set it up like this for example:

 

Conditions

Unit inside zone (Red Aircraft inside Kobuleti_Zone)

Units speed lower than (Red Aircraft, 1 knot)

 

Trigger

Set flag 1, value 1

 

Then you do another one:

 

Conditions

Unit inside zone (Red Aircraft inside Batumi_Zone)

Units speed lower than (Red Aircraft, 1 knot)

 

Trigger

Set flag 1, value 2

 

Then you have a flag that is 1 if Red Aircraft is at Kobuleti and 2 if its at Batumi. Under the condition that its speed is lower than 1 knot though. The trigger might become true before it reaches the parkings spot if it slows down to turn. If you know the exakt parking spot its good if you do the zone very little only around that spot. If you are using helicopters or Harriers you might want to add more conditions for units vertical speed less than or altitude less to tighten the condition up a bit more because they can stay in the air at less than 1 knot.

Link to comment
Share on other sites

In Moose there is a function to get the closest airbase from any coordinate.

local ac=UNIT:FindByName("My Aircraft")
local coord=ac:GetCoordinate()
local airbase=coord:GetClosestAirbase()
env.info(string.format("Closest airbase %s", airbase:GetName()))

Code is from the top of my head. But it should be fairly bug free ;)

  • Like 1

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

In Moose there is a function to get the closest airbase from any coordinate.

local ac=UNIT:FindByName("My Aircraft")
local coord=ac:GetCoordinate()
local airbase=coord:GetClosestAirbase()
env.info(string.format("Closest airbase %s", airbase:GetName()))

Code is from the top of my head. But it should be fairly bug free ;)

 

 

Souds good. I will have a look. Thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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