Event autoDetectable

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
Parel803
Posts: 941
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

Event autoDetectable

Post by Parel803 »

My question might not be Lua but I cannot find what I'm doing wrong.
I made an event for civilian air, remain in area and was hoping that units, coming form Airfields, changed to Autodetectable. I had it working in a small test scenario but seems I'm doing something wrong here. Hoping someone sees waht it is.
The Event is: Civilian Air - AutoID 5 sec in area
best regards Gert-Jan
Attachments
2ASWASuWv3Civi.zip
(366.43 KiB) Downloaded 8 times
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Event autoDetectable

Post by KnightHawk75 »

The problem appears you are relying on the UnitRemainsInArea trigger to actually process _each_ /all units that qualifies the match param. It will not, it will process the first one it finds that matches the rule (which will always be the same unless it specifically lands or leaves the area) and stop executing. You would have to set a trigger for each single unit you wanted tracked for UnitRemainsInArea. You could if you don't need it really to be time-inside dependent just use UnitEntersArea, which will process each one (eventually). If you do need it to be time-inside dependent and don't want to create a trigger for each, then there are workarounds via creating your own tracker via regular-time trigger and tracking time and inside|outside yourself, but I'll save the details on that unless you need them as I'm thinking UnitEntersArea probably address what you want for the scene involved.
Parel803
Posts: 941
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: Event autoDetectable

Post by Parel803 »

KH thank you. I misunderstood. It's not really time depending, and wanted to (sort of) simulate the IFF and that those airliners are civ neutral. So I'll try with the unitEntersArea.
regards GJ
Post Reply

Return to “Lua Legion”