Heroes dying chance ...

A new story begins...
The sequel to a real classic: Panzer Corps is back!

Moderator: Panzer Corps 2 Moderators

o_t_d_x
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 232
Joined: Mon Mar 23, 2020 2:39 pm

Re: Heroes dying chance ...

Post by o_t_d_x »

Great news. :D

I am looking forward to check, if your random unit placing approach brings as much fun as mine did in pc1.

If you define better as can do more, then the new editor is better.

If you define better as: can do more and is easier to use, so a much broader basis of modders can contribute, then this editor is a severe step back. Both is right.
o_t_d_x
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 232
Joined: Mon Mar 23, 2020 2:39 pm

Re: Heroes dying chance ...

Post by o_t_d_x »

Grondel wrote: Mon Jan 09, 2023 10:42 pm
o_t_d_x wrote: Mon Jan 09, 2023 12:16 pm I think it can be done in pc2.

You need to define drop zones and link them to certain weapon groups. Then you define more drop hexes then units and you need code for randomization of the drops.

I fear that it will be a lot of code and dramatically more work then with the old and much better editor of pc1. (everytime i poste ideas modder of pc2 say: no thats not possible or i dont know how to do it - i am still angry that the company claimed the new editor to be better then the pc1 editor)
was easier than i thought it would be. 45 lines of code, easy to copy/paste and use for diff scenarios. I'll use it when redoing the maps of GC1939 an onwards.

thx for the idea o_t_d_x.

if anyone wants the script just contact me via pm.

sers,
Thomas
I am sure its easy and fast for one or few hexes.

But if you have hundreds of relative drop hexes, you will have hundreds of times to enter the map coordinates. With the old editor it was a klick. Very fast and always right, no errors. In that regard, the old editor is highly superior.

You will make errors and then you will have to check the coordinates again. Which means: even more work. :(
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1940
Joined: Mon Aug 04, 2014 10:07 pm

Re: Heroes dying chance ...

Post by Grondel »

o_t_d_x wrote: Tue Jan 10, 2023 12:35 pm I am sure its easy and fast for one or few hexes.

But if you have hundreds of relative drop hexes, you will have hundreds of times to enter the map coordinates. With the old editor it was a klick. Very fast and always right, no errors. In that regard, the old editor is highly superior.

You will make errors and then you will have to check the coordinates again. Which means: even more work. :(
the way i scripted it is very easy to handle.
1. place the units somewhere u have place on the map
2. select all units, then copy paste unit IDs into LUA script
3. select target hexes, then copy paste hex coordinates into LUA script

the hard part was creating the script that puts the units on the target hexes and shuffles the hexes randomly evrytime.
sadly i have no acces to os.time in PC2-LUA so restarting the scenario will ceate the same positions. u need to go back to main menu and start or load a save from the previous map to get diff positions.

sers,
Thomas
o_t_d_x
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 232
Joined: Mon Mar 23, 2020 2:39 pm

Re: Heroes dying chance ...

Post by o_t_d_x »

Grondel wrote: Tue Jan 10, 2023 1:08 pm
o_t_d_x wrote: Tue Jan 10, 2023 12:35 pm I am sure its easy and fast for one or few hexes.

But if you have hundreds of relative drop hexes, you will have hundreds of times to enter the map coordinates. With the old editor it was a klick. Very fast and always right, no errors. In that regard, the old editor is highly superior.

You will make errors and then you will have to check the coordinates again. Which means: even more work. :(
the way i scripted it is very easy to handle.
1. place the units somewhere u have place on the map
2. select all units, then copy paste unit IDs into LUA script
3. select target hexes, then copy paste hex coordinates into LUA script

the hard part was creating the script that puts the units on the target hexes and shuffles the hexes randomly evrytime.
sadly i have no acces to os.time in PC2-LUA so restarting the scenario will ceate the same positions. u need to go back to main menu and start or load a save from the previous map to get diff positions.

sers,
Thomas
3. How do you "select" the target hexes ? With mouse klicks ?

Reverse engineering the lua scripts sounds good, might return to modding and start with pc2. My own mod endsieg bases on the grand campaign AND it has many completly new maps. (attacking and capturing the french fleet in ... mers el kebir f. ex. ... i think was the name... because without french fleet ... how shall germany deal with the royal navy sucessfully in an alt. scen ? battle for odessa, battle for leningrad 42, murmansk etc....)

Regarding LUA: I just will use the scripts of the game and mods. Maybe i will buy myself a book for lua basics.

"sadly i have no acces to os.time in PC2-LUA so restarting the scenario will ceate the same positions. u need to go back to main menu and start or load a save from the previous map to get diff positions."

I dont see that as a problem, because newly positioned relative units for every new campaign playthrough is enough. Would be strange, that the relative units would change their positions with every reload. At least for me.

By the way: This relativ design approach shouldnt be only for unit dropping. I used it everywhere in the mod where it made sence: Scripts for exampel: A script that triggers everytime in the same round or when you enter the same hex is super boring. It works ONCE then its just exploiting for the player. Of course this relativ design approach has some "traps". Maps that have a super hard time limit arent possible that way. Because if the enemy attack might start 2 rounds later, you cannot force a hard time limit. If you force the player to use guards to defend small counter attacks at the end of the scenario, you have to give him the ressources to do so. So your giving nearly no prestige at all approach in your mod, might be a problem in that regard.

Everything thats relative improves replayability. I hate absolute triggers, positioning and scripts if they arent necessary.

At last allow me a personal question: This "sers" at the end does it stand for "servas" ? Are you an austrian like me ? Writing in german would be soooo much better. :)

When i ve got the pc2 modding basics, maybe we could combine our work to one big pc2 mod. Because i have many other ideas for the mod and most of them already done in pc one.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1940
Joined: Mon Aug 04, 2014 10:07 pm

Re: Heroes dying chance ...

Post by Grondel »

o_t_d_x wrote: Wed Jan 11, 2023 9:08 am 3. How do you "select" the target hexes ? With mouse klicks ?
u can select them by left clicking, yes. you can hold click and drag to target an area. shift + leftclick will add a hex to the selection.
o_t_d_x wrote: Wed Jan 11, 2023 9:08 am Regarding LUA: I just will use the scripts of the game and mods. Maybe i will buy myself a book for lua basics.
Theres like a gazillion LUA - courses free on the net. just look for something with basic in it and u probably will be good to get started. If u alrdy know a programming language that is probably not even necessary. i myself had no clue about LUA 2 years ago when i started modding PC2.
o_t_d_x wrote: Wed Jan 11, 2023 9:08 am At last allow me a personal question: This "sers" at the end does it stand for "servas" ? Are you an austrian like me ? Writing in german would be soooo much better. :)
I am German yes, but when writing public i would rather stick to english. If u prefer german just send PMs.
o_t_d_x wrote: Wed Jan 11, 2023 9:08 am When i ve got the pc2 modding basics, maybe we could combine our work to one big pc2 mod. Because i have many other ideas for the mod and most of them already done in pc one.
Ideas are always welcome.

sers,
Thomas
dalfrede
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1493
Joined: Wed Mar 15, 2017 7:48 pm

Re: Heroes dying chance ...

Post by dalfrede »

o_t_d_x wrote: Wed Jan 11, 2023 9:08 am Regarding LUA: I just will use the scripts of the game and mods. Maybe i will buy myself a book for lua basics.
The Reference manual for LUA is available online at the LUA website for free. [.pdf]

The LUA files used in the game are mainly Subroutine Calls of PzC2 specific scripts, so 'learning' LUA isn't necessary.

PzC2 includes a LUA manual with the PzC2 scripts. I don't think that it has been updated since Game release, so all the new scripts in the AO DLCs are not included.

Kerensky just reuses scripts to create the AO scenarios so it should be workable for anyone else.
He does have direct access to the software Devs for help, which makes it easier though.
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
Grondel
Brigadier-General - 15 cm Nblwf 41
Brigadier-General - 15 cm Nblwf 41
Posts: 1940
Joined: Mon Aug 04, 2014 10:07 pm

Re: Heroes dying chance ...

Post by Grondel »

dalfrede wrote: Wed Jan 11, 2023 5:43 pm Kerensky just reuses scripts to create the AO scenarios so it should be workable for anyone else.
He does have direct access to the software Devs for help, which makes it easier though.
The scripts from the AO are....way inferior to the ones from the base game.

From my point of view 2 different coders, with the base game having either more acces to info or scripting skill.

Since I started modding PC2 I created several new scripts/features that have not been seen before(Like units spawning with heros attached).

To create scenarios copy paste with a basic understanding of what is happening is surely enough. But when u want to create more/new things u will need more.

Main hurddle imo is the structure the Mod needs to have to be able to be recognized by the game.
Less than a month ago i learned that the *.uplugin off the mod needs to have the same name as the Mod folder to enable PC2 to find the image folder coming along with the mod, enabling custom hero portraits.
Some guide/walkthrough on this process would surely be more helpfull than any lua scripting guide.

Concernig the LUA a more fleshed-out properties.txt would really help. there is still a huge bunch of blackboxes i wasn't able to figure out, like the unit.orders, just to name one example.

sers,
Thomas
dalfrede
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1493
Joined: Wed Mar 15, 2017 7:48 pm

Re: Heroes dying chance ...

Post by dalfrede »

Grondel wrote: Wed Jan 11, 2023 6:07 pm From my point of view 2 different coders, with the base game having either more acces to info or scripting skill.
The Base game scenarios have two authors: Uran21 and Rudankort.
Rudankort is the software guy behind PzC1, PzC2, and PFG so he would have the best handle on the code.
Uran21 did most of the scenarios and kept the unit list. I believe he is a software coder but don't know.
They are the PcC campaign team. Which suggests a big script/modding update coming with PcC.

Kerensky is an 'externally contracted designer', not part of the 'PzC2 Development Team'.

A side note: One of PzC1s best modders [nikivdd] does not like the PzC2 modding kit and refuses [so far] to mod for PzC2.
He designed the USCorps DLCs for PzC1 under contract.
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
o_t_d_x
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 232
Joined: Mon Mar 23, 2020 2:39 pm

Re: Heroes dying chance ...

Post by o_t_d_x »

"A side note: One of PzC1s best modders [nikivdd] does not like the PzC2 modding kit and refuses [so far] to mod for PzC2.
He designed the USCorps DLCs for PzC1 under contract
."

I really understand him, because if the editor would have the same capabilities like the old one (zones and scripts over pulldownmenues) i could work 100% and transfer all i have to pc2 fast. So i have to waste lotz of time, with learning things again, that i already could do faster with the old editor.

I hate it when my tools change if its not abs. necessary. It takes a long time to become really good and experienced with a tool, so changing it looks more like an artificial barrier.

They could have released a better variant of the old editor, including free lua programming etc... so all sides would be happy.
My hands still havent fully recovered from my pc1 endsieg modding desaster, (i was map design addicted, worked 10 hours without break every day and ruined my hands, i didnt knew, how important stretching hands is if you work a lot with em, i knew it regarding sports, but working is a different story, its much more harmful, onesided movement that can make you disabled for life in worst case, so dont underestimate this: every programmer, musicians (drums, guitar) etc. are endangered...), so maybe i just give you my stuff.

On the other hand i have sooooooo much time and at the moment i have some kind of "gaming depression". (not a single game is fun) I will think about it. But sharing of ideas is guaranteed, because it helps us all.
Post Reply

Return to “Panzer Corps 2”