placing planes
Posted: Sat Apr 03, 2021 1:57 pm
hi guys,
here another question: i am trying to place some planes in my scenario as reinforcement. I am able to place these planes but they become active 2 turns after i place them on the map (i placed a lot of infantries as well and they get activated the turn after they are placed). Is this normal?
here is the trigger i implemented
trigger name estate36
trigger condition cond_estate36
count =1
neworundaction
trigger effect effetto_estate36
here after the LUA code i implemented
-- conditional function
function cond_estate36()
return world.round == 1
end
-- placement function
function piazzamento(ex1, ex2, giocatore, unita, trasporto, forza, refund)
local esagono = {ex1,ex2} -- esagono di piazzamento
local playe = world:GetPlayer(giocatore) -- quale giocatore
local create_action = world:MakePurchaseAction(playe, unita, trasporto, forza)
create_action.auxiliary = false -- unità core
create_action.cost = 0 -- costo zero
world:Exec(create_action)
local unit = world:GetUnit(create_action.id)
local hex = world:GetHex(esagono)
if (hex:GetUnit(0) == nil) then -- se l'esagono è vuoto
deploy_action = world:MakeDeployAction(unit,esagono)
world:Exec(deploy_action)
if unit.type.kind == 0 then
unit.max_strength = 15
end
else
playe.prestige = playe.prestige + refund
end
end
-- effect function
function effetto_estate36()
piazzamento(19, 47, 0, "SM81", "Carrier", 0, 90)
piazzamento(19, 48, 0, "CR32", "Carrier", 0, 120)
end
here another question: i am trying to place some planes in my scenario as reinforcement. I am able to place these planes but they become active 2 turns after i place them on the map (i placed a lot of infantries as well and they get activated the turn after they are placed). Is this normal?
here is the trigger i implemented
trigger name estate36
trigger condition cond_estate36
count =1
neworundaction
trigger effect effetto_estate36
here after the LUA code i implemented
-- conditional function
function cond_estate36()
return world.round == 1
end
-- placement function
function piazzamento(ex1, ex2, giocatore, unita, trasporto, forza, refund)
local esagono = {ex1,ex2} -- esagono di piazzamento
local playe = world:GetPlayer(giocatore) -- quale giocatore
local create_action = world:MakePurchaseAction(playe, unita, trasporto, forza)
create_action.auxiliary = false -- unità core
create_action.cost = 0 -- costo zero
world:Exec(create_action)
local unit = world:GetUnit(create_action.id)
local hex = world:GetHex(esagono)
if (hex:GetUnit(0) == nil) then -- se l'esagono è vuoto
deploy_action = world:MakeDeployAction(unit,esagono)
world:Exec(deploy_action)
if unit.type.kind == 0 then
unit.max_strength = 15
end
else
playe.prestige = playe.prestige + refund
end
end
-- effect function
function effetto_estate36()
piazzamento(19, 47, 0, "SM81", "Carrier", 0, 90)
piazzamento(19, 48, 0, "CR32", "Carrier", 0, 120)
end