LUA questions

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

Moderator: Panzer Corps 2 Moderators

Post Reply
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 144
Joined: Thu Apr 30, 2020 11:52 pm

LUA questions

Post by FunPolice749 »

Hello, I'm currently dipping my toes into scenario design and LUA scripting. It's a bit of work but I have come to understand the basics of stuff like reinforcement waves, special hexes, and similar things. I got 2 questions currently:
1. I want to have my reinforcement waves come with specific names and possibly camouflage but I am haven't been able to find any scenario that does this. Is there some way to do this?
2. I want to have specific waves come on specific turns. Is there a way to do that without it being random in the normal waves/boss waves? Currently I haven't had luck in trying to make unique waves but it's entirely possible I'm messing something up.
asuser
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 628
Joined: Tue May 28, 2013 8:48 pm

Re: LUA questions

Post by asuser »

Some of your questions (name, skin) I answered here:

viewtopic.php?f=597&t=105069#p918261
FunPolice749
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 144
Joined: Thu Apr 30, 2020 11:52 pm

Re: LUA questions

Post by FunPolice749 »

asuser wrote: Sat Jan 22, 2022 11:28 am Some of your questions (name, skin) I answered here:

viewtopic.php?f=597&t=105069#p918261
Thank you for that it was exactly what I was looking for :D
Would you also know of like any guides or reference points on LUA scripting? I'm still having trouble reliably making stuff work and I can't really find anything that helps. Like for example I still am having trouble to reliably make reinforcement waves spawn because I don't know exactly what is needed. I copy stuff from official scenarios like the zones, waves content, the function WaveSpawn, and the OnNewRound action but then I go to load a scenario and it just doesn't work (and yes I do also include atrigger for the new round event). If there is any guide that explains this or if anyone could help with this it would be greatly appreciated.
asuser
Sergeant Major - SdKfz 234/2 8Rad
Sergeant Major - SdKfz 234/2 8Rad
Posts: 628
Joined: Tue May 28, 2013 8:48 pm

Re: LUA questions

Post by asuser »

The biggest problem with scenario design is that there are not many answers from the developers to most of the questions. Everything has to be painstakingly picked out of the DLC and then tried out for yourself.
That's why I asked for a real "Modding Guide" a long time ago.

There is only a rudimentary LUA manual on the LUA topic at
"Panzer Corps 2/Manuals... LUAscripting" and another separate document below
"Panzer Corps 2/Panzer Corps2/Content/Editor... properties".

A lot of existing LUA commands means a lot of functionality and variability for the game and the scenario design, but this is currently not fully exploited in the DLC.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1955
Joined: Mon Aug 04, 2014 10:07 pm

Re: LUA questions

Post by Grondel »

FunPolice749 wrote: Sat Jan 22, 2022 2:20 am 2. I want to have specific waves come on specific turns. Is there a way to do that without it being random in the normal waves/boss waves? Currently I haven't had luck in trying to make unique waves but it's entirely possible I'm messing something up.
if u have steam grab the mod "panzercorps 1" and check the Lua-file of scenario Battle Axe.

there are a lot of other scenarios that have specific waves on specific triggers in other scenarioys, too.
Panzermate
Corporal - 5 cm Pak 38
Corporal - 5 cm Pak 38
Posts: 30
Joined: Sun Feb 13, 2022 7:59 am
Location: Northwest Germany

Re: LUA questions

Post by Panzermate »

Howdy, folks.

Well I just a finished a quick explanation about Lua from a web Tut and now I know ....not a whole lot more than before. :oops:
Several issues, maybe some of you - who appearantly have a head start on this subject - can tell me where to find help to understand some basics so
I'll be able to copy and paste some already working stuff and tweak it to my liking.

I would like to:

Implement grahics(JPEG/PNG) into the header of the sceanrio briefings box.
That means store your selected graphics somewhere and then implement them via script into the briefing.
In the briefings section you select "Set Portait" but instead of an image/source it contains the function "gerhardt_panicked".
(3rd scenario "Brevity" of GCAfrikaCorps). But where can this be found ans waht exactly does ot do or how does it work?


Use this commendation event, but in a different way.

I don't want to award points the player can exchange for heroes or equipment, but rather want him to get promotions (in my campaign the player begins as a Major)
and/or awards/medals for fullfilling some secondary and bonus objectives in certain scenarios.
Means I want to use the in game black box notification once a certain level of achieved bonus/secondary missions is accomplished and hand out
the mentioned promotions/awards.
In fact eye candy only but it increases the llok and fell of the campaign!

Show some maps/start screens before the scenario using these:
Attachments
camp_path_sel_northafrica.jpg
camp_path_sel_northafrica.jpg (836.13 KiB) Viewed 980 times
Image

"Gentlemen, you have fought like lions but been led by donkeys"
ERWIN ROMMEL to captured British officers after finally conquering Tobruk
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1955
Joined: Mon Aug 04, 2014 10:07 pm

Re: LUA questions

Post by Grondel »

All u want to do is done in the mod i mentioned above. take a look at the luas and if u have specific questions feel free to ask.
Post Reply

Return to “Panzer Corps 2 Scenario Design”