Page 1 of 1

relativeto not working in SetReferencePoint

Posted: Fri May 05, 2023 12:49 am
by CaptainStephanie
Hey, guys, I've been looking at here and find some issues:

1. when trying to rename a point, the attribute 'rename' is not working, but happens to find out 'newname' works;
2. when trying to set a point relative to a unit, I couldn't find the right way (or somewhere in this lua API is broken?) to make it work. Context is: I added a point 'RP-101' via GUI, and in the lua console I tried this:

Code: Select all

ScenEdit_SetReferencePoint({side='blue',name='RP-101',relativeto='Nimitz Carrier', bearingtype=0})
the above code did nothing, and no error pops up, then I added 'bearing' and 'distance' in the end , still no good.

Oh, one more question,
3. what does 'bearing' and 'distance' do in this function? and when should I use those attributes. Does it merely provide a shortcut for setting lat and lon?

any reply is appreciated~

Re: relativeto not working in SetReferencePoint

Posted: Fri May 05, 2023 12:27 pm
by thewood1
It says specifically in the documentation is bearing and distance to the relative unit if its a relative rp, i.e. "Nimitz Carrier". It should have nothing to do with lat/lon. I would suggest posting this in the lua legion subforums. It would also be helpful to have the scenario attached to validate naming, etc.

Re: relativeto not working in SetReferencePoint

Posted: Fri May 05, 2023 12:33 pm
by KLAB
CaptainStephanie wrote: Fri May 05, 2023 12:49 am Hey, guys, I've been looking at here and find some issues:

1. when trying to rename a point, the attribute 'rename' is not working, but happens to find out 'newname' works;
2. when trying to set a point relative to a unit, I couldn't find the right way (or somewhere in this lua API is broken?) to make it work. Context is: I added a point 'RP-101' via GUI, and in the lua console I tried this:

Code: Select all

ScenEdit_SetReferencePoint({side='blue',name='RP-101',relativeto='Nimitz Carrier', bearingtype=0})
the above code did nothing, and no error pops up, then I added 'bearing' and 'distance' in the end , still no good.

Oh, one more question,
3. what does 'bearing' and 'distance' do in this function? and when should I use those attributes. Does it merely provide a shortcut for setting lat and lon?

any reply is appreciated~
https://www.matrixgames.com/forums/view ... hp?f=10236

Your query may have already been asked/resolved but in general theres a lot of useful stuff in that subforum.
K