Page 1 of 1

Critical, Need to Know, Information on modding

Posted: Fri Dec 11, 2020 12:22 pm
by Kerensky
https://www.youtube.com/watch?v=7QvhCDsFkk0

You can create a mod which changes such files by simple copying them (including the full directory tree under PanzerCorps2/Content dir) to an empty folder. This folder now contains your mod. Feel free to modify the files inside in any way, add more files etc.
This sentence in the sticky just does not explain the set up far enough. Mod set up has to be ultra precise (and if you mess it up and need to redo it, it can cause the game to CRASH ON LAUNCH (fixed by deleting your options.json file))

Here is a FULL visual example to explain the precise configuration needed.

The example I have created for this demonstration is a mod of the Spanish Civil War campaign that turns it into a sandbox that allows you to buy 10 nations worth of equipment from every year of WWII.
So that means my mod started by copying the contents of the Spanish Civil War campaign into a new location and editing those files in that new location as I saw fit to mod them.



Image

Extra note:
In Step 2 where you create a folder of ANY NAME OF YOUR CHOOSING... each folder is a separate 'Mod'. So I have one folder here because I only have one mod. If I make another mod, such as 1940Sandbox, that will be another folder in the same Step 2 location.

Assuming you have done that right, you will now see your mod appear HERE:

Image

And it is clearly working as evidenced in game when starting a new SCW campaign!

Image



So if you want to mod something different like the equipment file, the whole process and directory folders needs to adapt to the new location of the original file being modded!!!
For example, the master unit list is a file called "Units.csv" and is located in
PzC2_Shared\Build\PanzerCorps2\Content\Data

Re: Critical, Need to Know, Information on modding

Posted: Fri Dec 11, 2020 12:30 pm
by Kerensky
Note this entire process is just to set up your personal mod correctly... We'll see if the 'upload to Steam' part requires extra explanations.

Re: Critical, Need to Know, Information on modding

Posted: Fri Dec 11, 2020 5:26 pm
by dalfrede
This appears to be the best place to post this:

I have made a mod to add 3 units:
Dragoons - Switchable Motorcycle Infantry
StuH42ARTR - 3 range switch for the StuH42
French Paratroops

In my Steam install I placed the edited equip file and created a new units.csv file. The Dragoons showed up in Sicily 1943 purchase menu.

I made my Mods directory and added the files for the mod.
I can not get my Siltherline install to see it.
There are several copies of files/directories as for debugging I relabeled instead of deleting.

An additional mystery is a second FrPara 'Valona' appeared in the units list.
Mods.zip
(210.91 KiB) Downloaded 86 times
Any help?
My goal was to make a simple mod as a demo, that any one could drop in and see how it works, and copy it.
As examples are easy to follow.

Re: Critical, Need to Know, Information on modding

Posted: Fri Dec 11, 2020 6:38 pm
by Rudankort
dalfrede wrote: Fri Dec 11, 2020 5:26 pm Any help?
My goal was to make a simple mod as a demo, that any one could drop in and see how it works, and copy it.
As examples are easy to follow.
I've tried your mod, and it did not show up in Mod Manager because some quote symbols in uplugin file were wrong. After those were fixed, it did show up in Mod Manager, and I could enable it. However, after that the units still did not show up, and this seems to be due to some issues in our own code, which will require an update. I hope that the next patch will come out next week, and we'll make sure that your mod works with it.

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 8:03 am
by Kerensky
Section on uploading didn't pan out either.

It's missing the fact you seem to need to extract the SteamCMD stuff in the same directory as where you put metadata.vdf and publish.bat

but even after that discovery, it's still not properly uploading the simple SCW global nation availability mod.

It either uploads nothing at all to workshop, or uploads a mod with no image preview and no actual content (file size 0.000MB)

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 11:44 am
by SineMora
I tried making a simple change to the SCW campaign script, but am not having much luck getting the game to recognise it. What mystifies me is that the mod does show up if I subscribe to one of the mods on the workshop (and disappears again if I unsubscribe), so it doesn't seem like I screwed up with the folder structure or code.

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 1:55 pm
by Rudankort
SineMora wrote: Sat Dec 12, 2020 11:44 am I tried making a simple change to the SCW campaign script, but am not having much luck getting the game to recognise it. What mystifies me is that the mod does show up if I subscribe to one of the mods on the workshop (and disappears again if I unsubscribe), so it doesn't seem like I screwed up with the folder structure or code.
Can you post the content of your mod folder here, I'll take a look?

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 2:08 pm
by SineMora
Rudankort wrote: Sat Dec 12, 2020 1:55 pm Can you post the content of your mod folder here, I'll take a look?
Here we go.

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 2:53 pm
by Rudankort
SineMora wrote: Sat Dec 12, 2020 2:08 pm Here we go.
Well the good news is that your mod is perfectly correct, congratulations. :) Good idea for the mod as well.

The bad news is, I'm not sure why it does not work on your end. It worked for me. I did the following steps:
- Placed the mod folder in [Documents]/My Games/Panzer Corps 2/Mods folder
- Launched the game
- Opened MODS -> MOD MANAGER and saw the mod in the list. Ticked the checkbox next to the mod name and pressed APPLY
- Returned to the main menu and launched SCW campaign
(I actually modified your campaign script slightly, so that it was instantly clear that the game used modded script instead of the default one, but I doubt this could affect anything)

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 3:25 pm
by SineMora
Rudankort wrote: Sat Dec 12, 2020 2:53 pm Well the good news is that your mod is perfectly correct, congratulations. :) Good idea for the mod as well.

The bad news is, I'm not sure why it does not work on your end. It worked for me. I did the following steps:
- Placed the mod folder in [Documents]/My Games/Panzer Corps 2/Mods folder
- Launched the game
- Opened MODS -> MOD MANAGER and saw the mod in the list. Ticked the checkbox next to the mod name and pressed APPLY
- Returned to the main menu and launched SCW campaign
(I actually modified your campaign script slightly, so that it was instantly clear that the game used modded script instead of the default one, but I doubt this could affect anything)
Odd. It does show up for me if I subscribe to a workshop mod, but not otherwise. Just to be clear, did it work for you w/o any other mods (especially workshop ones) installed?

This is what I get w/o a workshop mod installed:

Image

And this is what I get with one:

Image

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 3:57 pm
by Rudankort
SineMora wrote: Sat Dec 12, 2020 3:25 pm Odd. It does show up for me if I subscribe to a workshop mod, but not otherwise. Just to be clear, did it work for you w/o any other mods (especially workshop ones) installed?
Ah ok, you are right. I did not take my test far enough. If I remove all Steam items in a Steam version of the game, then local items are not shown either. The bug in mod manager which will be fixed in the next update. In the mean time, you can upload your mod to Steam workshop, it should work from there. :)

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 4:07 pm
by SineMora
Rudankort wrote: Sat Dec 12, 2020 3:57 pm Ah ok, you are right. I did not take my test far enough. If I remove all Steam items in a Steam version of the game, then local items are not shown either. The bug in mod manager which will be fixed in the next update. In the mean time, you can upload your mod to Steam workshop, it should work from there. :)
All right, mystery solved. I suppose I'll try publishing it (although it feels a bit odd publishing a mod that literally changes a single value in one file :wink: )

Re: Critical, Need to Know, Information on modding

Posted: Sat Dec 12, 2020 5:20 pm
by SineMora
After some tinkering I got it to work (SteamCMD doesn't seem to like spaces, so no using the standard PzC2 mod path -- it couldn't read the My Games folder), although I had to remove the original mod to avoid having them both show up in the manager.
Kerensky wrote: Sat Dec 12, 2020 8:03 am Section on uploading didn't pan out either.

It's missing the fact you seem to need to extract the SteamCMD stuff in the same directory as where you put metadata.vdf and publish.bat

but even after that discovery, it's still not properly uploading the simple SCW global nation availability mod.

It either uploads nothing at all to workshop, or uploads a mod with no image preview and no actual content (file size 0.000MB)
You shouldn't need to have either in the same directory, but that does mean you have to change the path accordingly (although TBH I don't remember how to trigger an .exe in a different folder, so I put the batch file there). I put the metadata.vdf in the mod folder, though, as I expect it would otherwise get messy quickly if you have multiple mods...

You'll run into the same problem with multiple batch files, but I guess you can keep those in the mod folders too and just copy them across to the SteamCMD folder whenever you wish to run it. Easier than memorizing the command line so you can type it out every time.

Re: Critical, Need to Know, Information on modding

Posted: Wed Dec 16, 2020 7:39 pm
by Rudankort
SineMora wrote: Sat Dec 12, 2020 4:07 pm All right, mystery solved. I suppose I'll try publishing it (although it feels a bit odd publishing a mod that literally changes a single value in one file :wink: )
This issue should be resolved in 1.1.15.
dalfrede wrote: Fri Dec 11, 2020 5:26 pm Any help?
My goal was to make a simple mod as a demo, that any one could drop in and see how it works, and copy it.
As examples are easy to follow.
This mod should also work with today's update.

Re: Critical, Need to Know, Information on modding

Posted: Thu Dec 31, 2020 12:23 pm
by panzeh
The modding system doesn't seem to be catching my rules changes. I can do campaign changes just fine, but this doesn't seem to work. Attached is the mod folder in mods.