[Logged] Add Reference Point Relativity

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
tmoilanen
Posts: 74
Joined: Wed Oct 19, 2011 4:28 pm

[Logged] Add Reference Point Relativity

Post by tmoilanen »

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
Posts: 1557
Joined: Thu Nov 15, 2018 7:24 pm

RE: Add Reference Point Relativity

Post by KnightHawk75 »

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
Posts: 181
Joined: Sun Jan 17, 2021 9:31 pm

RE: Add Reference Point Relativity

Post by WSBot »

0014385
Rory Noonan
Posts: 2419
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Add Reference Point Relativity

Post by Rory Noonan »

Thanks for the heads-up guys, this is something we'd like to improve [:)]
Image
User avatar
michaelm75au
Posts: 11889
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Add Reference Point Relativity

Post by michaelm75au »

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.
Michael
tmoilanen
Posts: 74
Joined: Wed Oct 19, 2011 4:28 pm

RE: Add Reference Point Relativity

Post by 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
Attachments
ArcticThunder.zip
(132.42 KiB) Downloaded 3 times
User avatar
michaelm75au
Posts: 11889
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Add Reference Point Relativity

Post by 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.
Michael
KnightHawk75
Posts: 1557
Joined: Thu Nov 15, 2018 7:24 pm

RE: Add Reference Point Relativity

Post by KnightHawk75 »

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
Posts: 531
Joined: Wed Jul 18, 2018 12:05 am

RE: Add Reference Point Relativity

Post by boogabooga »

ORIGINAL: KnightHawk75

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.
The boogabooga doctrine for CMO: Any intentional human intervention needs to be able to completely and reliably over-ride anything that the AI is doing at any time.
KnightHawk75
Posts: 1557
Joined: Thu Nov 15, 2018 7:24 pm

RE: Add Reference Point Relativity

Post by KnightHawk75 »

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.

Attachments
refuelSideScript2.txt
(1.61 KiB) Not downloaded yet
User avatar
michaelm75au
Posts: 11889
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Add Reference Point Relativity

Post by michaelm75au »

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?
Michael
thewood1
Posts: 6886
Joined: Sun Nov 27, 2005 6:24 pm

RE: Add Reference Point Relativity

Post by thewood1 »

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.
You are like puss filled boil on nice of ass of bikini model. You are nasty to everybody but then try to sweeten things up with a nice post somewhere else. That's nice but you're still a boil on a beautiful thing! - BDukes
Post Reply

Return to “Tech Support”