Page 1 of 1

"UnitBaseStatus" trigger

Posted: Thu Mar 09, 2023 5:25 pm
by lumiere
For new MDSP tutorial series what attracted me most was UnitBaseStatus trigger rathar than new strike mission settings.

This trigger will be fired when target's (it could be ranged from all units of side to specific unit) current status changed to desired condition.

Currently this trigger is not configuable via Event Editor (hope it could be done soon) and requires ScenEdit_SetTrigger() function.

Here is my code:

Code: Select all

local trigger = "Blue_AircraftLands"
local TargetFilter={
TargetSide= 'Blue',
TargetType= "Aircraft",
TargetSubType= nil,
SpecificUnitClass= nil,
SpecificUnitID= nil,
}
local TargetCondition= 6
local trigger = ScenEdit_SetTrigger({mode="update", name=trigger, type="UnitBaseStatus",
TargetFilter=TargetFilter, TargetCondition=TargetCondition})
print(trigger)
"TargetFilter" specifies by table what unit to check. You need at least "TargetSide" value.

"TargetCondition" (Lua Docs incorrectly says "TargetStatus" but I got error for this) specifies target's desired status. I only checked for aircrafts but I could find following values:
0 = Airborne
1 = Parked (Ready)
2 = Taxiing to take off
3 = Taxiing to parking spot
4 = Taking off
5 = On final approach
6 = Completing landing
7 = Readying

Possible event I came up with using this trigger is "Belenko landed to Hakodate Airport", "Cancel aircraft's taking off under bad weather" or "Automatically change aircraft loadout after landing".

Hope this post helps.

Re: "UnitBaseStatus" trigger

Posted: Thu Mar 16, 2023 9:01 am
by KnightHawk75
Thanks, I had even forgot UnitBaseStatus was added under the hood.

Re: "UnitBaseStatus" trigger

Posted: Sat Mar 18, 2023 10:16 am
by michaelm75au
I have implemented the Lua UnitBaseStatus into the UI; got fed up extracting it from GetTriggers() all the time. :D

Re: "UnitBaseStatus" trigger

Posted: Sat Mar 18, 2023 1:54 pm
by KnightHawk75
michaelm75au wrote: Sat Mar 18, 2023 10:16 am I have implemented the Lua UnitBaseStatus into the UI; got fed up extracting it from GetTriggers() all the time. :D
Nice! :D :D