placing planes

A forum to discuss custom scenarios, campaigns and modding in general.

Moderator: Panzer Corps 2 Moderators

Post Reply
cicciopastic
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 173
Joined: Mon Oct 26, 2015 9:01 pm

placing planes

Post by cicciopastic »

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
Grondel
Brigadier-General - Elite Grenadier
Brigadier-General - Elite Grenadier
Posts: 2009
Joined: Mon Aug 04, 2014 10:07 pm

Re: placing planes

Post by Grondel »

on the turn planes are placed they have no move and no attack, so they sit prone. on 2nd turn they move to the next airfield, if their deploy hex is not next to/above an airfield.
asuser
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 628
Joined: Tue May 28, 2013 8:48 pm

Re: placing planes

Post by asuser »

Confirmation with my test play.

I try to set a fighter with a deploy function and activated with a "AllySetOrder" command from the SCW DLC LUA script. The fighter unit makes some noise only after another round as I pushed the button "Attack".
Post Reply

Return to “Panzer Corps 2 Scenario Design”