Reinforcement question

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

Moderator: Panzer Corps 2 Moderators

Post Reply
bayern
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 15
Joined: Tue Jan 13, 2015 12:51 pm

Reinforcement question

Post 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
Last edited by bayern on Thu Jan 21, 2021 5:18 am, edited 1 time in total.
jeannot le lapin
1st Lieutenant - 15 cm sFH 18
1st Lieutenant - 15 cm sFH 18
Posts: 827
Joined: Sun Dec 10, 2017 3:29 pm

Re: Reinforcement question

Post by jeannot le lapin »

Do you know an official scenario with this kind of trigger?
bayern
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 15
Joined: Tue Jan 13, 2015 12:51 pm

Re: Reinforcement question

Post by bayern »

I've already looked, but unfortunately found nothing
jeannot le lapin
1st Lieutenant - 15 cm sFH 18
1st Lieutenant - 15 cm sFH 18
Posts: 827
Joined: Sun Dec 10, 2017 3:29 pm

Re: Reinforcement question

Post by jeannot le lapin »

bayern wrote: Wed Jan 20, 2021 1:03 pm I've already looked, but unfortunately found nothing
EarlyMadrid scenario ?
bayern
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 15
Joined: Tue Jan 13, 2015 12:51 pm

Re: Reinforcement question

Post 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
peterw
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 154
Joined: Fri Apr 25, 2014 7:08 am

Re: Reinforcement question

Post 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
My Italian Panzer Corps campaign Italia Victor!:
http://www.streitmacht.com/downloads.php?view=detail&df_id=53
jeannot le lapin
1st Lieutenant - 15 cm sFH 18
1st Lieutenant - 15 cm sFH 18
Posts: 827
Joined: Sun Dec 10, 2017 3:29 pm

Re: Reinforcement question

Post 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?
MagicAndre1981
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 41
Joined: Sat Aug 16, 2014 6:50 pm

Re: Reinforcement question

Post 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
dobrodukh
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 77
Joined: Sun May 01, 2011 7:48 am

Re: Reinforcement question

Post by dobrodukh »

It's all terrible. Now I understand why there are so few custom missions.
terminator
Field Marshal - Elefant
Field Marshal - Elefant
Posts: 5939
Joined: Mon Aug 15, 2011 12:48 pm
Location: the land of freedom

Re: Reinforcement question

Post 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 1532 times
Post Reply

Return to “Panzer Corps 2 Scenario Design”