[FIXED v1.10] Unit Enters Area trigger

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
User avatar
Gunner98
Posts: 5966
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

[FIXED v1.10] Unit Enters Area trigger

Post by Gunner98 »

Not sure if this is Working as designed or if something is amiss.

In the Clip you can see the event in question and the triggers. The game file is still being tested and is here: tm.asp?m=3997036

AndrewJ reported that units entering the trigger zone were constantly triggering the event. What I was hoping for was when a unit first entered the trigger zone it would trigger the event, then when the next unit entered it would trigger again and so on.

My deduction is that the game checks often (every second apparently) and if the trigger is satisfied, the event fires.

If this is not WAD, it might be an issue.

If this is WAD, would it be better to use a 'Unit remains in area' trigger? If this is the case and it was set for 1hr, would it fire every hour that the unit is in the area? (better but not desired)

Is there a way to set up Lua to delete each unit as it first triggers the event? There are about 120 AC which could meet the conditions.

Please advise.

B

Image
Attachments
27FWarrives.jpg
27FWarrives.jpg (318.31 KiB) Viewed 265 times
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Yokes
Posts: 298
Joined: Tue Mar 13, 2007 9:27 pm

RE: Unit Enters Area trigger

Post by Yokes »

Gunner,

I've run into this before, and I think the trigger doesn't consider if it has already fired or not.

There is a way to fix it, but it involves a lot of coding. You need to initialize a variable for each unit that could trigger it at startup. Then you have to have an event that uses the "UnitX" command to get the GUID of the unit that set off the trigger, and check if the variable has already been fired for this unit. If not, do whatever you want it to do (add points, it looks like) and set the variable to true (or whatever will fail the "if" logic).

This works, but it is a lot of coding.

Yokes
mx1
Posts: 76
Joined: Thu Jan 16, 2014 6:01 pm

RE: Unit Enters Area trigger

Post by mx1 »

Regarding 'the unit stays in area' this is the only way of having Lua script being run every X minutes. If this behavior changes to 'fire once' then there is a need for additional trigger being introduced to CMANO called 'trigger every time interval'.
DeSade
Posts: 156
Joined: Mon Mar 01, 2004 5:08 pm
Contact:

RE: Unit Enters Area trigger

Post by DeSade »

ORIGINAL: Gunner98

Is there a way to set up Lua to delete each unit as it first triggers the event? There are about 120 AC which could meet the conditions.


If you want to keep units, solution given by Yokes is the one to go, its not so much coding if you could name them in some consistent way, like "27 TFW #1", "27 TFW #2" etc. It has however some bad side-effects regarding performance.

But if those aircrafts are disposable after triggering event (like they already finished mission and you grant VP for each survivor), than best way is indeed to remove them via Lua, by adding second action after +1 score with lua code like:

ScenEdit_DeleteUnit({guid=ScenEdit_UnitX().guid})

BTW, i setup small test scenario and trigger "Unit enters area" was fired only once per each unit crossing into area - I'm not sure why in your scenario its not working that way...
ComDev
Posts: 3116
Joined: Fri May 12, 2006 1:20 pm
Contact:

RE: Unit Enters Area trigger

Post by ComDev »

Thanks, have added this to our to-do list [8D]
Image

Developer "Command: Modern Air/Naval Operations" project!
Dimitris
Posts: 15378
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Unit Enters Area trigger

Post by Dimitris »

Loaded the scenario but I cannot see the reference points "27 TFW Aircraft Arrival" anywhere on the map. Any chance you have accidentally removed them?
User avatar
Gunner98
Posts: 5966
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Unit Enters Area trigger

Post by Gunner98 »

The reference points are on Side 'Marker'

Tx

B
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Dimitris
Posts: 15378
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Unit Enters Area trigger

Post by Dimitris »

OK, thanks.

Tested this again in Build 775.8 (v1.10 private beta) and it seems to work as desired. I used a single EF-111 as a test subject and entered the "27 TFW Aircraft Arrival" zone, and the trigger fired only once. It may have been fixed by one of the zone-related fixes that we have applied during v1.10 development.

Once v1.10 RC is made available (pretty soon) can you please re-check this to confirm?

Thanks.
User avatar
Gunner98
Posts: 5966
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Unit Enters Area trigger

Post by Gunner98 »

Will do. Thank you very much.
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Dimitris
Posts: 15378
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Unit Enters Area trigger

Post by Dimitris »

bump
User avatar
Gunner98
Posts: 5966
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Unit Enters Area trigger

Post by Gunner98 »

Works like a charm now that I have the update installed properly. Thanks for the fix.
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Dimitris
Posts: 15378
Joined: Sun Jul 31, 2005 10:29 am
Contact:

RE: Unit Enters Area trigger

Post by Dimitris »

Thanks for the update! Relieved that we fixed it.
Post Reply

Return to “Tech Support”