[1268.1] Example of tracking status change

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

[1268.1] Example of tracking status change

Post by michaelm75au »

Attached an example of the status change check that is in 1268.1 build.

There is an event that triggers when 'MiG-31BM Foxhound' lands and changes to the 'Readying' state.
There is also a special action event that shows how the Lua event was created.

The framework was created a few years back for the concept of handling landing/readying/takeoff events, but it was causing exception and run errors. It has been updated with more mature code, but it is still a work in progress so be wary. :D
For example it will need some limits added to it otherwise the simulation could grind to a halt if there were many a/c being monitored across many bases in a scenario.
Attachments
Sandbox - Lua samples 1.14b with aircraft .scen.zip
(879.06 KiB) Downloaded 24 times
Michael
Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

Re: [1268.1] Example of tracking status change

Post by Parel803 »

Good evening,
Not knowing to much about LUA and EVENTs. Do appreciate examples when new stuff arise.
Trying it, got the message, but the trigger "UnitBaseState" isn't filled in (Edit Event Trigger) and can't find it "Create New Trigger".
If that is how it is suppose to be, forgive me.
regards GJ
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

Re: [1268.1] Example of tracking status change

Post by michaelm75au »

This is not a normal Event trigger currently.
It is only available by being created with Lua script.

At some future point, it may/will be added to the normal Event editor,
Michael
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: [1268.1] Example of tracking status change

Post by KnightHawk75 »

michaelm75au wrote: Fri Aug 12, 2022 10:21 pm This is not a normal Event trigger currently.
It is only available by being created with Lua script.

At some future point, it may/will be added to the normal Event editor,
It's still a fantastic addition, reducing overhead polling and logic we previously had to embed to track change of status (and even then if it was too quick one could miss one if < 1s between changes). Thanks again for the feature add, and the usage sample, has utility way beyond just takeoff\landing\ready etc though. ;)
Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

Re: [1268.1] Example of tracking status change

Post by Parel803 »

Micheal,
Understood. Great addition.
best regards GJ
Post Reply

Return to “Lua Legion”