Wierd problems creating a new campaign

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

Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design

Post Reply
DocMoriarty
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 7
Joined: Sun Oct 09, 2011 11:27 am

Wierd problems creating a new campaign

Post by DocMoriarty »

Questions to devs and/or campaign modders. I have some wierd problems creating a new campaign.

First off: I use JSGME, edit files in the MODS folder of JSGME inside Panzer Corps and disable/enable my mod after i made changes to activate changes, works so far.

First Problem: Doesn't find my campaign when i edit the campaign.pzdat file like this:

Replacing StartTutorial line in Entry Points section with my campaigns line:

Code: Select all

rm_Caruba	47	Lead s German task force in special operations during WW2.	0	0	954	1939 - Runenmeister Corps					
Adding my first scenario at the end of the campaign tree like this:

Code: Select all

rm_Caruba	rm_Caruba.pzbrf	rm_Caruba.pzscn	END_VICTORY	0	rm_Caruba_decisive.pzbrf	END	0	rm_Caruba_marginal.pzbrf	END	0	rm_Caruba_loss.pzbrf
The effect is that when i'm in game in the campaign start menu and click on the tutorial campaign it doesn't show a name and description of the campaign and starting it just throws me back to main menu. I cross checked this approach with the Red Dawn campaign and there it works as expected.

Now the wierd part:
I finally managed to find a work around so that i can actually start my campaign:
I renamed my label name rm_Caruba to StartTutorial in the entry section:

Code: Select all

StartTutorial	1	Lead s German task force in special operations during WW2.	0	0	954	1939 - Runenmeister Corps					
I commented the original StartTutorial line in the tree data and replaced it with my line just renaming the label to StartTutorial:

Code: Select all

StartTutorial	rm_Caruba.pzbrf	rm_Caruba.pzscn	END_VICTORY	0	rm_Caruba_decisive.pzbrf	END	0	rm_Caruba_marginal.pzbrf	END	0	rm_Caruba_loss.pzbrf
With this approach i can actually start my first campaign scenario BUT now the briefings are displayed with <b>Chinese</b> characters completely unreadable !!!

First question: Why can't i use my own label names ? It works for all other campaign files that i have checked
Second question: Why are my briefings shown in Chinese instead of Latin characters ?

I've spent many hours trying to solve the problems but they seem (compared to how simply it works with other campaigns) completely unlogic to me.
nikivdd
Panzer Corps Map Designer
Panzer Corps Map Designer
Posts: 4520
Joined: Fri Jun 24, 2011 1:21 pm
Location: Belgium
Contact:

Post by nikivdd »

Here are a few pointers that i had to learn the easy and the hard way.

If you start your campaign replacing the tutorials, you will not be able to chose the level of difficulty (probably some hard coded thing)

In my campaigns i start from the Barbarossa line.
In the entry point and the campaign tree (in campaign.pzdat), you cannot change the Barbarossa name (another hard coded thing), but the rest of the line you can change the briefings, prestige points and scenario names. The line afterwards in the campaign tree you can pick whatever name you like.

I also change the description in the strings.pzdat file which contain also the scenario ID lines aswell from the campaign.pzdat. I don't know if that is necessary, but i do it anyways.

I use wordpad to edit those files and to make the briefings and pzloc files.

Also remember to make a backup before trying out any changes.
https://www.facebook.com/NikivddPanzerCorps
https://www.youtube.com/channel/UCk2lyeEuH_hoA1s7tnTAEJQ
rezaf
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1487
Joined: Mon Aug 15, 2011 3:27 pm

Post by rezaf »

IIRC, if you want to use your own campaign line ID when starting a campaign, you'll have to edit the htm file containing the campaign selection logic in the UI folder of PzC.

As for the chinese characters, I learned the hard way that Panzer Corps is EXTREMELY picky about the encoding of the briefing files. In other words, the developers failed to take possible different encodings into consideration and hardcoded the character table, which means if you have a file that isn't using exactly the encoding the game expects, it'll be displaying a mess of unicode characters.

You wouldn't believe what a pain in the a.. it was to convert the briefing files from PGForever, which was - strangely enough - developed by the same guy, so it was very strange to encounter this behavior.

Anyway, if you don't have a ton of briefings already completed, the easiest way is to just open an existing briefing file, copy or type the text you have in and save-as a new briefing file. You have to use editor.exe or some editor that doesn't mess with the file encoding, though(!).

I ended up hacking together a little tool that re-encoded all PGForever briefings - after trying a number of free- and payware tools that all failed to do the job.
I think I ended up spending a day with this alone ... wish the developers wouldn't have been so short-sighted. *sigh*
_____
rezaf
El_Condoro
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 2119
Joined: Tue Jun 03, 2008 9:32 am

Post by El_Condoro »

It has been publicized elsewhere by Kerensky that changes are going to be made regarding custom campaigns, so I am hesitant to detail the changes that I made for Red Dawn, which does use the Tutorial slot on the campaigns screen. What has been said above is correct but if you want to have a look at the Red Dawn files here viewtopic.php?t=27451 even if you don't play it.

As for editing the pzbrf files I use Notepad++ which is free. Have a look at some pzbrf files in the data\briefings folder to get the idea.

<b>text</b> = bold etc
</br> = break
<p>text</p> = paragraph etc

Keep asking questions and someone will help. Cheers
DocMoriarty
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 7
Joined: Sun Oct 09, 2011 11:27 am

Post by DocMoriarty »

First thanks for all the answers, very appreciated.

El_Condoro:
I looked at your campaign files first and saw that you used the tutorial. I guess difficulty selection simply depends on the label name "StartTutorial" or so. Red Dawn gets with its custom label name a difficulty selection.

Custom Campaign Import:
I hope they make it like scenarios, simply a folder in the my documents area where custom campaign folders rebuilding the original file structure in panzer corps folder can be placed and superseede the respective files in the game folder as long as you play a certain custom campaign (kinda path logic when a file is opened in campaign mode). And a custom campaign selection like the custom scenario selection in the gamesetup.htm. And a little less "intelligent" encoding check for briefings. Maybe just an encoding setup file in the briefings folder.

Encodings:
I actually copied an original briefing file and just replaced the texts between the html codes but might have used a special character or something that pointed it towards Chinese (lol).

Editing Strings.pzdat
Not necessary to modify. Again Red Dawn files showed me that i don't need to use IDS_... names and strings.pzdat, just write the original text you want instead. The IDS_... key names pointing into strings.pzdat are just for later localization of the game, same as pzloc files in data folder. And it works well as long as i use StartTutorial as label name.

Thanks for pointing me towards the UI folder and the html files. That showed some more possibilities such as using images in briefings knowing that all the dialogs are html / css based.

Edit:
Encodings again:
I can't even get a briefing to display correct that only contains the string ABC and a linefeed edited with Notepad. If the briefing contains only an A without linefeed Panzer Corps hangs in an endless loop and needs to be terminated by task manager. If you add a linefeed to the A some default message is displayed saying the briefing will be added later.
Last edited by DocMoriarty on Mon Oct 10, 2011 12:29 pm, edited 1 time in total.
El_Condoro
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 2119
Joined: Tue Jun 03, 2008 9:32 am

Post by El_Condoro »

Yes, Red Dawn has the difficulty settings. The reason it can is because I edited the UI\gamesetup.htm file (with Notepad++) - lines 87 and 378 - so that it would recognise the first scenario, rather than the Tutorial. You worked that out anyway. :) Cheers
DocMoriarty
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 7
Joined: Sun Oct 09, 2011 11:27 am

Post by DocMoriarty »

Overriding StartTutorial:
I just replaced all strings "StartTutorial" in gamesetup.htm with my label name and it works perfect. I guess its actually the id="LabelName" tag in the button definition by which the program matches the entry point from campaign.pzdat with the button.

Encodings solution:
I always thought the files are simple 8-bit character text files. But actually they are 16-bit unicode character files. That explains why my 8-bit text files were displayed as unicode mess. There is no detection of encodings in panzer corps. It simply uses unicode text files.
nikivdd
Panzer Corps Map Designer
Panzer Corps Map Designer
Posts: 4520
Joined: Fri Jun 24, 2011 1:21 pm
Location: Belgium
Contact:

Post by nikivdd »

I've learned here a couple of things today. Thanks guys!
https://www.facebook.com/NikivddPanzerCorps
https://www.youtube.com/channel/UCk2lyeEuH_hoA1s7tnTAEJQ
DocMoriarty
Private First Class - Wehrmacht Inf
Private First Class - Wehrmacht Inf
Posts: 7
Joined: Sun Oct 09, 2011 11:27 am

Post by DocMoriarty »

Adding pictures to briefings:
Like i mentioned above this really works. Picture pathes must be relative to the UI folder in Panzer Corps.

Example:
Just made a quick test with an existing image in the game.
NOTE: replace the square brackets [] before and after the img-tag by usual html brackets <>, had to use [] here or message wouldnt display correct.

Code: Select all

<p><b>November 1st, 1939</b></p>
<p>[img src="gamesetup/2_selected.png" alt="rm_Runemeister_Logo" align=LEFT]First let me congratulate you to your new assignment as leader of the secret Runenmeister Corps. As a special task force you will receive orders that are too difficult for our regular troops.</p>
<p>After conquering the canal islands by our regular troops as protection of our future coastlines we discovered that on one of the islands is a heavily guarded base of the Royal Navy. It seems to be a research and development facility for naval equipment and operations.</p>
<p>Your first task will be to capture this base and secure all documents and equipment you can get your hands on. Dont let them too much time to destroy this important material. A swift blow is vital. Expect heavy resistance though, be prepared.</p>
<p>Good Luck</p>
Seems you can use all the nifty html stuff here, so guess you can tell stories in the briefings as background for your campaigns pretty well with images, tables etc.
rezaf
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1487
Joined: Mon Aug 15, 2011 3:27 pm

Post by rezaf »

I actually hadn't known that DocMoriarty - thanks for finding that out and reporting back.
I'm sure I'll find some use for this in the future.
_____
rezaf
Post Reply

Return to “Panzer Corps : Scenario Design”