ScenEdit_HostUnitToParent allows for two different parameters:
- SelectedHostNameOrID - This teleports the designated unit to the specified port and assigns it as the new base port, and
- SelectedBaseNameOrID - This should assign the designated unit to the specified port without moving it there instantly.
Paste the below code into the LUA console and you'll see the error "SelectedHostNameOrID has not been defined!" which is rather odd seeing as I'm using "base" rather than "host".
Code: Select all
unit_ship1 = ScenEdit_GetUnit({side = "Side A", name = "Ship 1"})
guid_ship1 = unit_ship1.guid
base_portB = ScenEdit_GetUnit({side = "Side A", name = "Port B"})
guid_portB = base_portB.guid
rebase_Ship1 = ScenEdit_HostUnitToParent({HostedUnitNameOrID = ship1, SelectedBaseNameOrID = portB})
