Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

AutoDetect UnitEntersArea Event

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> AutoDetect UnitEntersArea Event Page: [1]
Login
Message << Older Topic   Newer Topic >>
AutoDetect UnitEntersArea Event - 7/16/2021 7:33:50 PM   
Parel803

 

Posts: 451
Joined: 10/10/2019
From: Netherlands
Status: offline
Goodevening,
Hope somemone can help me. Try to make a contact autodetectable when entering a circle around a MPA. As simulating sort of an AIS.
I made a circle on a fake side which updates it's position every 15 seconds, position update is the Blue MPA as centre.
The event for autodetect has a trigger: unit enters area with the RP's of that circle.
The action of the event I made is: ScenEdit_SetUnit ({side=UnitX().side, unitname=UnitX().name, Autodetectable=true})
When my AIS track enters the circle the detection window stops but no autodetect is given. Also the name is't changing to the correct one. Looking at that unit is says it's has autodetect.
Another track which is autoDetect given in advance is showing it's correct name.I misused the RP's circle or I made errors in the action of the event.

with regards Gert-Jan

Attachment (1)
Post #: 1
RE: AutoDetect UnitEntersArea Event - 7/16/2021 11:47:23 PM   
KnightHawk75

 

Posts: 1212
Joined: 11/15/2018
Status: offline
Either I don't follow exactly or I can't reproduce the problem playing under 1147.29.

I press play... the circles move, eventually they cover the 2 Civ AIS units, those units get marked autodetectable and show up as such on say the smugglers side.
I then added a sailboat to side Civilian AIS for added test, to west of the moving circle, marked as not-autotectable, waited a bit for circle to cover it, it changed them to autodetectable as expected and shows up as such on other sides such as smugglers within a couple seconds.
quote:

Also the name is't changing to the correct one.

Not sure what you mean by name change, I see no code for changing any unit or contacts name?



< Message edited by KnightHawk75 -- 7/16/2021 11:48:08 PM >

(in reply to Parel803)
Post #: 2
RE: AutoDetect UnitEntersArea Event - 7/18/2021 12:36:00 PM   
Parel803

 

Posts: 451
Joined: 10/10/2019
From: Netherlands
Status: offline
KnightHawk, thank you for you're time. Apologize for my english, even my dutch is rubbish.
For a autodetect unit which I did in advance via editor the name I see of that contact is the name I gave it with initiating (name is tstAutoDetect). The Skunk in bearing 272, detected on radar at 55nm, has a regular updated detection on the Right side of the screen. When the event is fired (AIS Autodetect On) the update detection stops, no showing autodetect. The image and DB name is showing but het name stays "Skunk #3". Her given platform name is UK 323.
I was wondering why I, as Blue Side, don't see het Platform name. If it is intended, I apaologize for time lost. If it is not I'm looking for my error.

with regards Gert-Jan

(in reply to KnightHawk75)
Post #: 3
RE: AutoDetect UnitEntersArea Event - 7/18/2021 8:33:10 PM   
KnightHawk75

 

Posts: 1212
Joined: 11/15/2018
Status: offline
Oh the the contact name change you meant, ah ok.
I'll take another look at that see what I can see - I vaguely remember issues in certain instances a year ago when testing detectionlevel changes like that.




< Message edited by KnightHawk75 -- 7/18/2021 8:34:51 PM >

(in reply to Parel803)
Post #: 4
RE: AutoDetect UnitEntersArea Event - 7/18/2021 11:11:57 PM   
KnightHawk75

 

Posts: 1212
Joined: 11/15/2018
Status: offline
Yup. If the ship\skunk contact is previously spotted prior to detection level changing\jumping to auto-detect|4, it's contact name is not updated, where as if it was previously unknown it's properly labeled by the unit name. I would report that. There may be some reasoning for that logic\way it operates, but I can't think of any right now.

Attached (autodetectonragekh.zip) a dirty sledgehammer workaround (ie there are better ways to workaround it) which updates all ship contact names that are auto detected to their unit names every so often.

Not directly related but would not be surprised if detection triggers based on level-4 may not fire too, even though you don't have any in the scene, it's what I was remembering from when I saw something similar some time ago.
http://www.matrixgames.com/forums/fb.asp?m=4942330
http://www.matrixgames.com/forums/fb.asp?m=4942303


Attachment (1)

(in reply to Parel803)
Post #: 5
RE: AutoDetect UnitEntersArea Event - 7/19/2021 7:45:00 AM   
Parel803

 

Posts: 451
Joined: 10/10/2019
From: Netherlands
Status: offline
KnightHawk, thanks again. Will check out the work around.
regards Gert-Jan

small question, should I post this in Tech? Or is it just the way the game works.

< Message edited by Parel803 -- 7/19/2021 10:36:27 AM >

(in reply to KnightHawk75)
Post #: 6
RE: AutoDetect UnitEntersArea Event - 7/19/2021 9:08:33 PM   
KnightHawk75

 

Posts: 1212
Joined: 11/15/2018
Status: offline
If you want it fixed\changed I'd post in tech support, the current behavior doesn't strike me as intentional but that's the only way to find out for sure.

(in reply to Parel803)
Post #: 7
RE: AutoDetect UnitEntersArea Event - 7/23/2021 3:52:32 PM   
Parel803

 

Posts: 451
Joined: 10/10/2019
From: Netherlands
Status: offline
Thx for you're help and time,
with regards

(in reply to KnightHawk75)
Post #: 8
RE: AutoDetect UnitEntersArea Event - 8/11/2021 12:50:32 PM   
Parel803

 

Posts: 451
Joined: 10/10/2019
From: Netherlands
Status: offline
Follow Up questions if I may. My LUA still in embryotic stage.
Sometimes almost understand stuff and then it's gone :-)
Again working on the AIS simulation (and IFF) in CMO. Made a scen with a circle and circle keeps updating.

In my previous scen I had an event where UnitX changed autodetectable when entering the area. Worked great, especially with the update name function from KH.
ScenEdit_SetUnit ({side=UnitX().side, unitname=UnitX().name, Autodetectable=true}) with regular trigger

But now I have the circle RP's (names) later on in the scenario, so can't select the RP's in trigger: unit enters area.
I was wondering if this could be solved with a function where it says when an unit from side CivilianAIS side enters the circle defined in another event switches to AutoDetectable?
Or could it be done in something that's making a complete event as shown on the github site?
Or is it just a stupid question, if so, disregard entirely.

Thoughts were to activate the new event when the circle is initiated? But not really know how to start getting the RP's when unitX enters etc.

with regards GJ

Attachment (1)

(in reply to Parel803)
Post #: 9
RE: AutoDetect UnitEntersArea Event - 8/11/2021 11:09:05 PM   
KnightHawk75

 

Posts: 1212
Joined: 11/15/2018
Status: offline
If you are asking if you have an arbitrary bounded location you want to check if something is inside that polygon, without using in-area triggers directly yeah there are ways. If you mean can you add\change the defined RP's 'after the fact' because they don't exist before hand (I think this is what you mean), yeah you can, along with creating the entire trigger dynamically if needed.

You programmatically update\create the Triggers Area entries 'later' inside the trigger involved with set trigger mode=update and feed it what's needed. http://commandlua.github.io/#ScenEdit_SetTrigger
Now sometimes finding all the options that are available or exact option name or format can be tricky, it's best to just create a sample trigger with the gui and in the lua console interrogate the options names and cases\spellings.
ev = ScenEdit_GetEvent('EventNameHere')
print(ev.details.triggers); --dump the triggers to see what's available

There are some samples as I recall buried in the Legion for dynamically creating detection trigger events, keywords would be UnitDetected targetfilter.
https://www.matrixgames.com/forums/tm.asp?m=4973762
https://www.matrixgames.com/forums/tm.asp?m=4986324

If you need to create your own area trigger system, you could do that too (I don't think this applies to your needs - just saying). You do that by looking yourself who's inside a given area at timed intervals say every 15sec, and keeping track (if needed) of what shows up and what disappears 'detect' arrival, presences, and exit. But that's all custom code and as extensive or as light as you need it to be. Basically you end up creating your own little event system. There you can make use of sideWrapper:unitsInArea().
http://commandlua.github.io/#wrapper_Side

Another option if that doesn't work for you is you can search the forums for an InPolygon function and example usage I posted a while ago. It actually what lead me to the request the addition of what became side:unitsInArea. I use the side:unitsInArea option when ever I need area and pre-filtering, and still use the pure Lua InPolygon for quick checks for 'is something in side something else' as I can avoid needing a side wrapper and RP's entirely and just feed numeric lat\lons. Each has it's place. But random shout out to Michael again for adding unitsInArea.



< Message edited by KnightHawk75 -- 8/12/2021 4:11:56 PM >

(in reply to Parel803)
Post #: 10
RE: AutoDetect UnitEntersArea Event - 8/12/2021 8:20:17 AM   
Parel803

 

Posts: 451
Joined: 10/10/2019
From: Netherlands
Status: offline
KnightHawk, thx again for your time and help
with regards GJ

(in reply to KnightHawk75)
Post #: 11
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> AutoDetect UnitEntersArea Event Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.234