Page 1 of 1

Reinforcement question

Posted: Wed Jan 20, 2021 10:35 am
by bayern
can someone please help me with the reinforcement in the editor?

I would like to have a certain unit for the Axis arrive as reinforcement in round 5 .....
Hex 05,05

how can I set it, is it only possible with a LUA script?
unfortunately I don't know anything about it :-(

Thanks and greetings from Hamburg

Re: Reinforcement question

Posted: Wed Jan 20, 2021 10:49 am
by jeannot le lapin
Do you know an official scenario with this kind of trigger?

Re: Reinforcement question

Posted: Wed Jan 20, 2021 1:03 pm
by bayern
I've already looked, but unfortunately found nothing

Re: Reinforcement question

Posted: Thu Jan 21, 2021 7:38 am
by jeannot le lapin
bayern wrote: Wed Jan 20, 2021 1:03 pm I've already looked, but unfortunately found nothing
EarlyMadrid scenario ?

Re: Reinforcement question

Posted: Thu Jan 21, 2021 11:43 am
by bayern
I'll check it out tonight, Danke

Usually it is a bit easy to create a reinforcement for a scenario, but with Panzer Corps 2 there doesn't seem to be any function or script that helps

if someone else has an idea, it would be nice if you could help :-)

please excuse the translation, it was made with google

Re: Reinforcement question

Posted: Fri Jan 22, 2021 8:37 am
by peterw
You need LUA for this feature.
And you need to activate it in the Panzer Corps 2 Editor.

Example I used in my mod:

function B1() -- Bedingung im Editor: Trigger Rundenende
return world.round == 5 -- Runde 5 definieren
end

titel = "Warnung"
message1 = "Es wurden neue Feindflugzeuge im Westen gesichtet."

function F1() -- neue Einheit erzeugen und platzieren + Ausgabe Nachricht
local feld = {3,15} -- Ort
local einheit = "I16" -- ID der Einheit I-16, siehe erste Spalte in units.csv
local player = world:GetPlayer(1) -- welcher Spieler? (hier: 2.Spieler=Feind)
local create_action = world:MakePurchaseAction(player, einheit, "", 0) -- Einkauf welcher Einheit?
create_action.auxiliary = false -- Hilfs- oder Kerneinheit? (Kerneinheit)
create_action.cost = 0 -- Preis? 0
world:Exec(create_action) -- Kaufaktion!
local unit = world:GetUnit(create_action.id) -- welche Einheit?
local hex = world:GetHex(feld) -- welches Hex?
if (hex:GetUnit(0) == nil) then -- prüfen, ob Hex frei ist
deploy_action = world:MakeDeployAction(unit,feld) -- definieren, was wo platziert wird
world:Exec(deploy_action) -- Platzierung der Einheit!
end

local feld = {4,16}
local einheit = "TupolevSB"
local player = world:GetPlayer(1) -- welcher Spieler? (hier: 2.Spieler=Feind)
local create_action = world:MakePurchaseAction(player, einheit, "", 0) -- Einkauf welcher Einheit?
create_action.auxiliary = false -- Hilfs- oder Kerneinheit? (Kerneinheit)
create_action.cost = 0 -- Preis? 0
world:Exec(create_action) -- Kaufaktion!
local unit = world:GetUnit(create_action.id) -- welche Einheit?
local hex = world:GetHex(feld) -- welches Hex?
if (hex:GetUnit(0) == nil) then -- prüfen, ob Hex frei ist
deploy_action = world:MakeDeployAction(unit,feld) -- definieren, was wo platziert wird
world:Exec(deploy_action) -- Platzierung der Einheit!
end

MessageBox(titel, message1) -- Ausgabe Nachricht
end

Re: Reinforcement question

Posted: Fri Jan 22, 2021 10:58 pm
by jeannot le lapin
peterw wrote: Fri Jan 22, 2021 8:37 am You need LUA for this feature.
And you need to activate it in the Panzer Corps 2 Editor.

Example I used in my mod:
Thanks for sharing, I’ll try to test the script. What mod are you talking about?

Re: Reinforcement question

Posted: Sat Jan 23, 2021 3:09 pm
by MagicAndre1981
jeannot le lapin wrote: Fri Jan 22, 2021 10:58 pm What mod are you talking about?
his German Mods here:

http://www.streitmacht.com/viewforum.php?f=384

Re: Reinforcement question

Posted: Mon Feb 08, 2021 5:00 am
by dobrodukh
It's all terrible. Now I understand why there are so few custom missions.

Re: Reinforcement question

Posted: Tue Feb 09, 2021 7:32 pm
by terminator
dobrodukh wrote: Mon Feb 08, 2021 5:00 am It's all terrible. Now I understand why there are so few custom missions.
The presentation is much better with Notepad++

Capture d’écran 2021-02-09 203017.jpg
Capture d’écran 2021-02-09 203017.jpg (259.84 KiB) Viewed 1591 times