[Logged] Add Reference Point Relativity (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Tech Support



Message


tmoilanen -> [Logged] Add Reference Point Relativity (1/27/2021 7:37:16 PM)

Hi - I'm attempting to set a reference point's relativity via LUA script.

I am getting the following error:

"Missing unit xxxxx from relative bearing" (xxxxx substituted for the GUID.)

I suspect this is because I am trying to make the Reference Point relative to a unit of the other side, although I can manually set it in God's Eye View.

Any help would be appreciated. Script is below:

a = ScenEdit_GetUnit({name='elint'})
print(a)
myguid = a.guid
mylat = a.latitude
mylon = a.longitude
print(myguid)
print(mylat)
print(mylon)


b = ScenEdit_GetUnit({name='nimitz'})
print(b)
yourguid = b.guid
print(yourguid)

c = Tool_Bearing(myguid,yourguid)
print(c)

d = Tool_Range(myguid,yourguid)
print(d)
d = d - 240
print(d)

position = World_GetPointFromBearing({latitude=mylat,longitude=mylon,distance=d,bearing=c})
print(position)

rplon = position.longitude
print(rplon)
rplat = position.latitude
print(rplat)

if rplon > 180 then
rpvar = rplon - 180
print(rpvar)
rplon = 180 - rpvar
print(rplon)
end
if rplon < 180 then
rplon = rplon * -1
end

ScenEdit_AddReferencePoint({side='Russia',name='test1',lat=rplat,long=rplon,clear=true})
ScenEdit_SetReferencePoint({side='Russia',name='test1',bearingtype=1,relativeto=yourguid})




KnightHawk75 -> RE: Add Reference Point Relativity (1/28/2021 4:06:18 PM)

The search is done against the same side the RP is set to, your hunch is correct,so the gui may be the only way to accomplish what you want.




WSBot -> RE: Add Reference Point Relativity (1/31/2021 11:59:43 PM)

0014385




Rory Noonan -> RE: Add Reference Point Relativity (2/1/2021 12:00:49 AM)

Thanks for the heads-up guys, this is something we'd like to improve [:)]




michaelm75au -> RE: Add Reference Point Relativity (2/1/2021 12:21:37 AM)

Can you supply a test save with how you are trying to do this on? So we can test exactly what you are trying to do.




tmoilanen -> RE: Add Reference Point Relativity (2/1/2021 11:35:58 PM)

Hi Michael - save file is attached.

I've been playing around with this for the better part of a week. I've created an event when a certain contact is detected (in this case an E-2 Hawkeye AEW.) As a result of this RP's are created relative to the contact's position, and I wanted to have them move relative to the contact (to simulate the aircraft trying to avoid flying into the radar umbrella.)

I ended up adding a secondary event that triggers hourly to adjust the location of the reference points, which works great if the contact is travelling in a straight line.

Tom




michaelm75au -> RE: Add Reference Point Relativity (2/1/2021 11:56:24 PM)

Attaching the relative RPs to the contact will cause them to jump around if the uncertainty zone starts to grow (and the actual location of the contact is lost), but I will have a look.




KnightHawk75 -> RE: Add Reference Point Relativity (2/2/2021 1:07:25 AM)


quote:

ORIGINAL: michaelm75au

Attaching the relative RPs to the contact will cause them to jump around if the uncertainty zone starts to grow (and the actual location of the contact is lost), but I will have a look.


True, though allowing a side option for the referenced guid such that I could instead of a contact say give it the actual 'other' side unit could open up some options. Yes doing it vs an enemy might be 'cheating' because your ai is acting off possible information the contact wrapper for it may not have, but that's not bad in all situations. Also thinking about about "escorting" or tailing, or otherwise staying around or in sync with some neutral, civilian or non-enemy or 3rd party side could be interesting. Cause I don't (maybe i'm wrong) think I can add one of my units as escorts to an allied or non-allied sides missions if I recall (or maybe that was just with the one-way trust version of the relation. I could think of some uses for it though, niche to be sure.
Once you find this moving train\vip car, hang back 15mi and follow it\hang around it via relativity, check ct wrapper every minute if it's AoUn is > x disengage, if not keep following it via "relativity". Food for thought maybe.




boogabooga -> RE: Add Reference Point Relativity (2/2/2021 4:45:44 AM)

quote:

ORIGINAL: KnightHawk75


quote:

ORIGINAL: michaelm75au

Attaching the relative RPs to the contact will cause them to jump around if the uncertainty zone starts to grow (and the actual location of the contact is lost), but I will have a look.


True, though allowing a side option for the referenced guid such that I could instead of a contact say give it the actual 'other' side unit could open up some options. Yes doing it vs an enemy might be 'cheating' because your ai is acting off possible information the contact wrapper for it may not have, but that's not bad in all situations. Also thinking about about "escorting" or tailing, or otherwise staying around or in sync with some neutral, civilian or non-enemy or 3rd party side could be interesting. Cause I don't (maybe i'm wrong) think I can add one of my units as escorts to an allied or non-allied sides missions if I recall (or maybe that was just with the one-way trust version of the relation. I could think of some uses for it though, niche to be sure.
Once you find this moving train\vip car, hang back 15mi and follow it\hang around it via relativity, check ct wrapper every minute if it's AoUn is > x disengage, if not keep following it via "relativity". Food for thought maybe.



Another thing to consider might be adding undetectable, infinitely fueled, etc. "magic" vehicles to the database. Those would facilitate the ability to have reference points/zones move around arbitrary paths.




KnightHawk75 -> RE: Add Reference Point Relativity (2/2/2021 10:36:49 PM)

quote:

infinitely fueled

This you can do yourself mostly along with a timer, see attached refueling script I use all the time.
You used to be able to add extra gas tanks to loadouts in cmano but that feature (or interface bug that allowed it) was removed in cmo with changes to the weapons dialog. :(

For undetectable, find a unit in the database that has no signatures, or no signatures of the type you're worried about and use that as the unit, we may need a few more generics like that (perhaps that aren't facilities) but usually I've been able to find one to fit my purpose.

Usually something that is underground like gas tanks or bunker units, but even some above ground units for instance can't be detected by radar only TV\IR and couple even with that at super close such that you need great equipment and basically have to fly almost directly over them.





michaelm75au -> RE: Add Reference Point Relativity (4/1/2021 11:28:07 PM)


quote:

ORIGINAL: tmoilanen

Hi Michael - save file is attached.

I've been playing around with this for the better part of a week. I've created an event when a certain contact is detected (in this case an E-2 Hawkeye AEW.) As a result of this RP's are created relative to the contact's position, and I wanted to have them move relative to the contact (to simulate the aircraft trying to avoid flying into the radar umbrella.)

I ended up adding a secondary event that triggers hourly to adjust the location of the reference points, which works great if the contact is travelling in a straight line.

Tom


So in essence, you want to create a set of RPs on the Russia side that are visible and moving with the actual position of the AEW. So when it lands, you know the location of the carrier?




thewood1 -> RE: Add Reference Point Relativity (4/1/2021 11:56:03 PM)

One non-cheating approach might be the RP can only be placed when the target is within a certain detection state. Maybe a percent or some other measure. If the target goes above that said state, the RP disappears and the player gets an game event warning.

I know this is only semi-related to the OP, but it would address a couple other threads that have come up very recently about keeping investigating units from getting too close and also around tailing a contact.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.859375