Lula scripting : getting airbase - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 02-10-2019, 02:03 PM   #1
CougarFFW04
Member
 
Join Date: Jul 2018
Posts: 183
Default Lula scripting : getting airbase

Hi DCS scripting Gurus,


Is there any way with DCS, Mist, MOOSE or whatever to get the airbase where a flight is parked ?


Thanks
CougarFFW04 is offline   Reply With Quote
Old 02-10-2019, 04:00 PM   #2
Fisherman82
Member
 
Join Date: Aug 2016
Posts: 197
Default

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.
Fisherman82 is offline   Reply With Quote
Old 02-11-2019, 11:35 AM   #3
CougarFFW04
Member
 
Join Date: Jul 2018
Posts: 183
Default

Hi Fisherman82,

Thanks for the tips.
Too bad that DCS do not provide us with a simple function that would return the base where the aircraft is parked
CougarFFW04 is offline   Reply With Quote
Old 02-11-2019, 11:49 AM   #4
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Asgård
Posts: 1,956
Default

In Moose there is a function to get the closest airbase from any coordinate.
Code:
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
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-8700K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 3200 MHz DDR-4| Win 10 64-bit | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | CV1
funkyfranky is online now   Reply With Quote
Old 02-11-2019, 01:05 PM   #5
CougarFFW04
Member
 
Join Date: Jul 2018
Posts: 183
Default

Quote:
Originally Posted by funkyfranky View Post
In Moose there is a function to get the closest airbase from any coordinate.
Code:
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.
CougarFFW04 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:44 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.