Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

How to check if a unit is marked as an ESCORT?

 
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 >> How to check if a unit is marked as an ESCORT? Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to check if a unit is marked as an ESCORT? - 7/14/2021 8:18:21 PM   
boogabooga

 

Posts: 328
Joined: 7/18/2018
Status: offline
I'm trying to find the flag that marks a unit as an escort. It does not seem to be a a property of the UNIT wrapper. Also, the unitlist of the mission does not seem to distinguish between escorts or strikers.
Post #: 1
RE: How to check if a unit is marked as an ESCORT? - 7/15/2021 2:30:28 AM   
KnightHawk75

 

Posts: 1210
Joined: 11/15/2018
Status: offline
While one can set it, one can not query such on a unit or a mission unit list via Lua.

Workaround is either filter the mission.unitlist members (after having to 'get' each) by a known set of characteristics (unit type,dbid,loadoutid,guid,etc) that applies only to the escorts, or simply say by name containing a string you add to all escorts like " [escort]", and hope the user doesn't rename the unit.






< Message edited by KnightHawk75 -- 7/15/2021 2:33:44 AM >

(in reply to boogabooga)
Post #: 2
RE: How to check if a unit is marked as an ESCORT? - 7/16/2021 3:11:24 AM   
boogabooga

 

Posts: 328
Joined: 7/18/2018
Status: offline
So how does Command know who the escorts are? Surely there has to be a flag somewhere?

To get to a point here, exposing the "Escort" status would be very useful and go very well with the new "UNASSIGN" feature, for those times where you want to remember exactly what someone was doing before they get unassigned. ;)

< Message edited by boogabooga -- 7/16/2021 4:32:42 AM >

(in reply to KnightHawk75)
Post #: 3
RE: How to check if a unit is marked as an ESCORT? - 7/16/2021 5:47:49 AM   
KnightHawk75

 

Posts: 1210
Joined: 11/15/2018
Status: offline

quote:

ORIGINAL: boogabooga

So how does Command know who the escorts are? Surely there has to be a flag somewhere?

To get to a point here, exposing the "Escort" status would be very useful and go very well with the new "UNASSIGN" feature, for those times where you want to remember exactly what someone was doing before they get unassigned. ;)


Yes it exists in the system one way or another already, but it's not LUA accessible, I've remarked on the lack of it in past posts but it was never the focus of a topic so probably easily overlooked even if seen in passing. Perhaps time for a direct feature request for it's addition. I recall finding the feature annoyingly limiting when I was writing a mass swap unit X for Y script and being unable to restore a units possible prior "escort" assignment cause I couldn't query for it.

The next question may become how might we prefer it be implemented. Flag on the unitwrapper or something like enhancing mission wrapper with mission.escortlist returning just the guid's that are escorts, something else, both?
While ideally I might prefer having .unitlist return something like table of tables{guid="guidhere",name="",isescort=true|false} like some others do, it would be a breaking change and would likely be nixed. If mission.escortlist existed one could match .unitlist members against members of .escortlist members (if not nil) if trying to avoid escorts in the list, and if you just want the escorts it's handy as well, and avoids the expense of having to 'get' all .unitlist members just to determine if a unit is an escort to it's assigned mission if it was flag. Not to mention the mission wrapper is already linked in unit wrapper via unit.mission (when one is assigned) anyway so in a way adding it to mission.escortlist actually adds it to both. That's what I was thinking anyway but I'm interested in others thoughts.



(in reply to boogabooga)
Post #: 4
RE: How to check if a unit is marked as an ESCORT? - 7/16/2021 7:29:38 AM   
michaelm75au


Posts: 13353
Joined: 5/5/2001
From: Melbourne, Australia
Status: online
The 'escort' flag is tied to the unit so it makes sense to add a property to the unit wrapper - '.isEscort'.
So from the 'mission.unitlist' you can check each assigned unit to see if it is part of the escort or not.
[Added for future build]

_____________________________

Michael

(in reply to KnightHawk75)
Post #: 5
RE: How to check if a unit is marked as an ESCORT? - 7/16/2021 9:14:56 PM   
KnightHawk75

 

Posts: 1210
Joined: 11/15/2018
Status: offline
quote:

So from the 'mission.unitlist' you can check each assigned unit to see if it is part of the escort or not.

? Doesn't that forces one to "get" all members of the list when just wanting to get a list of escorts, doesn't seem as efficient but I'm not really gonna quibble.

(in reply to michaelm75au)
Post #: 6
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> How to check if a unit is marked as an ESCORT? 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.305