Listing aircraft at an airbase?
Posted: Fri Jul 11, 2025 11:18 pm
I am working on a logistics model and I need to know which aircraft are at (or assigned) to a specific airbase, to properly route munitions where they need to go. The one "OOB" answer I saw points to a dead link from 2018.
I dont care if they are at the base, or just assigned to the base, but I want to create a list. I can brute force this in ugly ways but I was hoping there was something programatic that I can do.
My one brute force idea is use an event trigger (via remain x time trigger), save its name/guid to a 'based at' global table. Query the table for my logistics scripts. This works, but if the unit is destroyed, I then need a means to remove it from the "based at" table (which I can do via event triggers - unit destroyed = remove from table. This would also require one version of the script per airbase. I think this would work, but it feels ugly.
Hoping there is a more elegant way.
edit:
This might work (tweaking the action of course), I'll try this when I am able. Source from 2019:https://forums.matrixgames.com/viewtopi ... e#p4459960
I dont care if they are at the base, or just assigned to the base, but I want to create a list. I can brute force this in ugly ways but I was hoping there was something programatic that I can do.
My one brute force idea is use an event trigger (via remain x time trigger), save its name/guid to a 'based at' global table. Query the table for my logistics scripts. This works, but if the unit is destroyed, I then need a means to remove it from the "based at" table (which I can do via event triggers - unit destroyed = remove from table. This would also require one version of the script per airbase. I think this would work, but it feels ugly.
Hoping there is a more elegant way.
edit:
This might work (tweaking the action of course), I'll try this when I am able. Source from 2019:https://forums.matrixgames.com/viewtopi ... e#p4459960
Code: Select all
local carrierorairfield = ScenEdit_GetUnit({side="Your Side", unitname="Your AirBase"})
for i = 1, #carrierorairfield.embarkedUnits.Aircraft do
local currentaircraft = ScenEdit_GetUnit({guid=carrierorairfield.embarkedUnits.Aircraft[i]})
ScenEdit_SetLoadout({UnitName=currentaircraft.name, LoadoutID=0, TimeToReady_Minutes=0})
end