CaptainStephanie wrote: Wed May 17, 2023 12:58 am
1. when trying to rename a point, the attribute 'rename' is not working, but happen to find out 'newname' works, so probably need to update the doc.
True, this docs needs an update.
CaptainStephanie wrote: Wed May 17, 2023 12:58 am
2. after manually adding a rp on the map, its bearingtype is 'Fixed', but there's no relative unit, so this 'Fixed' might get people confused, different from the one in 'Fixed or Rotating'.
I guess that all RP will need to have some kind of bearingtype, it shouldn't be a problem if you check the relativeto, to get the points that are associated to a unit.
CaptainStephanie wrote: Wed May 17, 2023 12:58 am
3. there are three effects that I couldn't achive from console with Lua, namely,
- manually add a rp on the map, I want to make it relative to a unit, say 'Nimitz Carrier'
Code: Select all
ScenEdit_SetReferencePoint({side='blue',name='RP-101',relativeto='Nimitz Carrier', bearingtype=0})
is not working
- manually add a rp on the map, set it Fixed to Nimitz Carrier, now I want to make it Rotating to that Nimitz Carrier[vice versa, from Rotating to Fixed]
Code: Select all
ScenEdit_SetReferencePoint({side='blue',name='RP-101', bearingtype=1})
is not working
Yes, SetReferencePoint is not working as intended, we'll hope Michael can have a look on this, I'll suggest you make a bug report on the Tech Support forum.
This shows the bug behavior of the method SetReferencePoint. If you remove the key relativeto there isn't a update on RP coordinates if you press start, the Reference Point comes back to when is first located.
Create a side named BLUE and execute:
Code: Select all
ScenEdit_AddUnit({type="Ship",guid="ship-guid-001", name="Unit 1", side='BLUE',dbid=135,latitude=0,longitude=1})
ScenEdit_AddUnit({type="Ship",guid="ship-guid-002", name="Unit 2", side='BLUE',dbid=135,latitude=0.5,longitude=1})
ScenEdit_AddReferencePoint( {side='BLUE', name='Point 1',bearing=270,distance=1, relativeto="ship-guid-001", bearingtype=1} )
ScenEdit_SetReferencePoint({side='BLUE', name='Point 1', relativeto="ship-guid-002",latitude=1,longitude=-1, bearingtype=1})
-- Alternative if you remove the relativeto, execute the update you can see how the reference points moves to the new position but when press start, the RP comes back to their first position.
-- ScenEdit_SetReferencePoint({side='BLUE', name='Point 1',latitude=1,longitude=-1, bearingtype=1})
Alternatively, you can use the AddReferencePoint method to create points referencing units. I suggest you using the GUID of the unit instead of the name.
Code: Select all
ScenEdit_AddReferencePoint( {side='BLUE', name='Point 1',latitude = 0, longitude=-1, relativeto="ship-guid-001", bearingtype=1} )
CaptainStephanie wrote: Wed May 17, 2023 12:58 am
Oh, one more question,
4. 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?
It is another way to enter the location of the reference points, instead of using latitude and longitude, you use the bearing and the distance (in nmi) to the reference unit.