Mmmm. Always thought you could re-base a unit. I think all the times this was used, was around basing new units, rather than re-basing existing ones.
Shouldn't be too difficult to do so..probably add an option in the HostUnitToParent() to just change the base and not move, or jump as it does now. I think the default behavior will be as it is now with option to just change it.
Changed around....Simpler solution
The property .base will be able to be set to the unit object of the new base. Plus if set to 'nil', it will choose the closest base that can host it. e.g.
Code: Select all
local unit = ScenEdit_GetUnit({name='SS 583 Harushio', guid='3a5f2a57-36e2-48f6-9352-00b819789a18'})
unit.base = ScenEdit_GetUnit({name='Naval Station Yokosuka', guid='db7d4c0c-31e8-4563-8d43-9f2b467cf977'})
unit.base = nil