Page 1 of 1
embark spawning unit on air transport
Posted: Mon Apr 05, 2021 9:19 pm
by Grondel
i just tried to spawn a unit of fallschirmjaeger in airtransport and noticed this is not as easy as i thought.
any ideas on how to do it?
same is for any other unit embarked on whatever. i can´t figure out the command to have the unit spawned embarked.
any help welcome.
seers,
thomas
Re: embark spawning unit on air transport
Posted: Tue Apr 06, 2021 11:27 am
by asuser
That works, example:
For Germany:
function F1()
local feld = {8,3} -- set into
local einheit = "Fallschirmjager"
local player = world:GetPlayer(0)
local create_action = world:MakePurchaseAction(player, einheit, "SharedJu52", 0)
create_action.auxiliary = true
create_action.cost = 0
world:Exec(create_action)
local unit = world:GetUnit(create_action.id)
local hex = world:GetHex(feld)
if (hex:GetUnit(0) == nil) then
deploy_action = world:MakeDeployAction(unit,feld)
world:Exec(deploy_action)
end
For Italy:
Fallschirmjager -> ITParatroopers
SharedJu52 -> ITJu52
!!! Don't be surprised, the paratroopers are displayed as having landed, but will be transported by plane the next time they move !!!
Re: embark spawning unit on air transport
Posted: Tue Apr 06, 2021 3:27 pm
by Grondel
asuser wrote: ↑Tue Apr 06, 2021 11:27 am
!!! Don't be surprised, the paratroopers are displayed as having landed, but will be transported by plane the next time they move !!!
OK

i gave up when i saw 3 infantrie swimming in the ocean and didn´t try to move them.
Re: embark spawning unit on air transport
Posted: Fri Jun 11, 2021 8:17 am
by bamboofats
Hi asuser
This method seems to have some issues as the Ju52 is now attached as an organic transport to the Fallschirmjager.
And they can use this air transport every single turn to move.
I also tried this method with LandingCraft with a unit spawned in water but the unit remains stuck after it gets onto the "organic" LandingCraft to move.
Is there an alternative way to embark the unit programmatically using LUA?