Page 1 of 1

A more newcomer

Posted: Mon Jan 02, 2023 4:56 pm
by EricFr
Hello to all

I'm Eric, and new to this forum.
I was playing DM and CSB something like three decades ago.
I have been delighted to find DM for Windows (DOSBox version) and even more to discover CSBWin.
Big congrats to Paul for the tremendous job he did and for the pleasure he brought to us!

I might be asking a couple of silly questions, while trying to use CSBWin and CSBuild, so apologies in advance.
Apologies also for my English, not be native (I'm French).

Just before switching to CSBWin, after finishing legit DM, I played with encryption/CRC of dmsave.dat files.
After many trials, I could edit the file to set the experience at the level I wish.
When I was 15 y.o. it was not a problem to throw chests for two hours and get ninja levels.
Lacking of time, I needed to speed-up the leveling process a bit but did it only when I reached the rat generator level.

You most probably all have already high-level characters but happy to share my dmsave.dat edited file if someone needs it.

Using the encyclopedia, the interactive map and the walkthrough I completed CSB and am now fully exploring the dungeon.

Re: A more newcomer

Posted: Tue Jan 03, 2023 12:05 am
by ChristopheF
Welcome Eric!
You may edit champion stats from your PC DM saved game using DMute at http://dmweb.free.fr/?q=node/698

Re: A more newcomer

Posted: Thu Jan 05, 2023 9:06 pm
by EricFr
Thanks for the link for DMute. I did not know about it.
Anyway, it has been fun working on the encryption and CRC of saved game files.

Maybe one more question: is there any tool to import the new portraits of heroes in an existing CSBWin game?

Let me explain... I tried with v1.4 and v1.5 of DMute but it seems to be bugged.
I exported my existing portraits, import them again and the picture is completely messed up.
I tried the same with CSBuild and have exactly the same problem

Re: A more newcomer

Posted: Fri Jan 06, 2023 12:18 am
by ChristopheF
DMute portait support is indeed buggy.
CSBuild can export and import a BMP of champion portraits. The trick is to find a tool to edit the .bmp file that can keep the color palette unchanged.
Both Microsoft Paint and paint.net break the color palette (colors are renumbered/reordered which later breaks the import in CSBuild).
I don't know which tool you can use for that purpose, maybe "the gimp" could do it...

Re: A more newcomer

Posted: Sun Jan 15, 2023 11:07 am
by EricFr
I definitely want to play with the updated graphics!
So reading technical documentation, I'm working on developing a custom tool.
If it works, I'll share with you guys

Re: A more newcomer

Posted: Sun Jan 15, 2023 5:01 pm
by EricFr
And so it works!

It was in fact pretty easy.
Using CSBuild, you can export character data, which creates a 3200 byte long file named "CharacterData.bin"
This file contains the champions portraits.
With a Visual Basic script, you can replace the portraits by any of your choice, just by copying from a valid cmp file.

So you will find below the script I developped.
To have it work, you must have in the same folder:
- The script
- The CharacterData.bin file
- Four portraits files with the exact names "Portrait1.cmp", "Portrait2.cmp", "Portrait3.cmp" and "Portrait4.cmp"
Just run the script, import the CharacterData.bin with CSBuild in your game and it's done.
Be careful to take the version which corrects a bug on character import (see the forum)
You find all the cmp files you need in the PORTRAIT folder of DMute.

Below is the code of the script

'---------------------------------------------------------------'
' PortraitUpdator.vbs '
' Version 1.0 - Jan 15, 2022 '
' Written by EricFR '
' '
' Please visit The Dungeon Master & Chaos Strikes Back '
' Encyclopaedia at http://dmweb.free.fr/ for more information '
'---------------------------------------------------------------'

Dim objFileSystemObject
Dim objOutputFile
Dim objSourceFile
Dim objPortraitFile
Dim intSourceFileSize
Dim data(3200)
Dim portrait(508)
Dim i

Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")

Set objSourceFile = objFileSystemObject.OpenTextFile("CharacterData.bin",1)
For i=0 to 3199
data(i) = objSourceFile.Read(1)
Next

Set objPortraitFile= objFileSystemObject.OpenTextFile("Portrait1.cmp",1)
For i=0 to 507
portrait(i) = objPortraitFile.Read(1)
Next
For i=0 to 463
data(336+i)=portrait(44+i)
Next

Set objPortraitFile= objFileSystemObject.OpenTextFile("Portrait2.cmp",1)
For i=0 to 507
portrait(i) = objPortraitFile.Read(1)
Next
For i=0 to 463
data(800+336+i)=portrait(44+i)
Next

Set objPortraitFile= objFileSystemObject.OpenTextFile("Portrait3.cmp",1)
For i=0 to 507
portrait(i) = objPortraitFile.Read(1)
Next
For i=0 to 463
data(1600+336+i)=portrait(44+i)
Next


Set objPortraitFile= objFileSystemObject.OpenTextFile("Portrait4.cmp",1)
For i=0 to 507
portrait(i) = objPortraitFile.Read(1)
Next
For i=0 to 463
data(2400+336+i)=portrait(44+i)
Next

Set objOutputFile = objFileSystemObject.OpenTextFile("CharacterData.bin", 2, True)
For i=0 to 3199
objOutputFile.Write data(i)
Next
objOutputFile.Close