Jump to content


Photo

CSFFBS Script Decoder


  • Please log in to reply
7 replies to this topic

#1 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 608 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 18 October 2023 - 07:48 PM

Hi everyone!

 

I've finished my work on a small tool that will allow us to convert all the compressed scripts from CSF into readable text files. This should make the game much more moddable.

 

Before you can convert the files, you'll have to unpack the *.pak archives.

Use the Commandos Developing Toolkit for that: https://github.com/I...s/cmdt/releases

 

Attached File  CSFFBS_Decoder.zip   7.09KB   221 downloads (v1.1)

Here's the binary script decoder.

Like most of my tools, this one also requires Java.

You can simply drag & drop the files you want to convert onto the *.bat file.

Or double-click the .bat and enter the filename.

 

Attached File  CSF PAK Creator v0.1.zip   3.73KB   94 downloads

Use my PAK Creator to put all the files back into a *.pak archive.
 

I've also uploaded the tools here: https://retrogamesva.../downloads/csf/

And the source code here: https://github.com/herbert3000/CSFFBS-Decoder



#2 wyel2000

wyel2000
  • Members
  • 229 posts

Posted 18 October 2023 - 08:01 PM

Thanks for your share.  :thumbsupcool: 



#3 Samz

Samz
  • Members
  • 57 posts

Posted 18 October 2023 - 11:12 PM

Hi everyone!
 
I've finished my work on a small tool that will allow us to convert all the compressed scripts from CSF into readable text files. This should make the game much more moddable.
 
Before you can convert the files, you'll have to unpack the *.pak archives.
Use the Commandos Developing Toolkit for that: https://github.com/I...s/cmdt/releases
 
attachicon.gif CSFFBS_Decoder.zip
Here's the binary script decoder.
Like most of my tools, this one also requires Java.
You can simply drag & drop the files you want to convert onto the *.bat file.
Or double-click the .bat and enter the filename.
 
attachicon.gif CSF PAK Creator v0.1.zip
Use my PAK Creator to put all the files back into a *.pak archive.
 
I've also uploaded the tools (including the source code) here: https://retrogamesva.../downloads/csf/

Nice, I'll give it a look later.



#4 Samz

Samz
  • Members
  • 57 posts

Posted 19 October 2023 - 09:59 AM

I've installed Java from the official java website and I still get this error:

 

 

Exception in thread "main" java.lang.UnsupportedClassVersionError: Decoder has been complied by a more recent version of the Java Runtime (Class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0

 

The Java updater also says I'm on the most recent version. (I'm on Windows 8 if that matters, like if Java dropped support from it though I plan to upgrade to a newer PC soon.) 



#5 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 608 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 19 October 2023 - 07:12 PM

@Samz: is it possible that the newly installed version didn't update the PATH variable?I just sent to a PM.



#6 Samz

Samz
  • Members
  • 57 posts

Posted 19 October 2023 - 08:19 PM

@Samz: is it possible that the newly installed version didn't update the PATH variable?I just sent to a PM.

The version you sent me in that DM works!

 

 

I edited a few lines of code in Juego with notepad to see what happens:

 

.fFadeSpeed 111.5

 

.fFadeMuertos 100.0
 
 
Fadespeed isn't weapons as I hoped, instead it's just the actual screen fading in/out, making it longer just prevents you skipping cutscenes and forces you to start mission with a black screen that very slowly fades back to normal. (and same with fading out.)
 
CommXPC 2023-10-19 21-31-48-450.jpg
 
FadeMuretos (or FadeDead as google translate calls it) does work however!, Bodies will still go semi-transparent but they will take longer to fully fade away.
 
CommXPC 2023-10-19 21-33-55-161.jpg
 
EDIT EDIT: It seems this actually delays the "quickened" despawning when the Spy takes the uniform of an enemy, it's now possible for Spy to wear the uniform of an enemy that's currently dead and his clothed body will still be there.
 
I also found "DuracionMuertos" which is the actual timer until bodies start fading out and "DuracionObjetos"  which is the same for items. (So if you set Objectos to a high value, you'll never need to worry about weapons despawning on you.) 
 
I've also learned from this an oddity of at least how Cold Reception despawns bodies/weapons, it appears that for at least that level (maybe more?) CSF despawns items not by "deleting" them like most games I've seen but by just "speeding up" their despawn timers. 
 
Set DuracionMuertos and DuracionObjetos to a high value and the Spy can actually take dropped weapons/unifroms from dead enemies at the start of his section of Cold Reception as they'll still be around. 
 
Also you can edit score values and there's a score for "AlliedSaved" which seems to be unused? (presumably more score for saving allies/keeping more allies alive during a mission.) 
 
I also discovered it's possible to have all 3 Commando portraits on a loading screen, though I've had no luck so far with getting the Spy to spawn early. (my first and only so far attempt an admittingly basic thing of just copy/pasting his spawn data to just before the Sniper's spawn data to see what happens.) 
 
At the start of the .scn file for a level you'll see all 3 commandos named at the start, this is seemingly the data that tells the game what loading screen portraits to add. (.INICIO_COMMANDO 1 .INICIO_SNIPER 1 .INICIO_SPY 1) 
 
CommXPC 2023-10-19 22-40-51-159.jpg

Edited by Samz, 20 October 2023 - 12:38 PM.


#7 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 608 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 20 October 2023 - 10:52 PM

Here's how to edit the contents of a *.pak without having to recreate the archive each time you want to see the changes in the game.

Create a backup of your CSF folder (mine is C:\Games\Commandos Strike Force).

Decode config/Juego.cfg and open it in a text editor.
Search for .bUsePak 1 and change it to .bUsePak 0
Save the file.

Use PCKManager.exe to extract the content of GlobalES.pak into your CSF folder.

Extract the content of the map you want to edit (e.g. maps/Panzers.pak) into your CSF folder.

The game will still show you the other missions but it will only load the unpacked one(s).
I tried to unpack all maps at once but after that the game couldn't read the maps correctly. I think each pak has some files that are also present in other pak files so they'd overwrite each other. So better only work at one map at a time.

Keep track of the files you've edited.
If you are happy with your changes, extract the original pak again at a safe location, insert all your modified files and finally repack the .pak archive.

 

If you're annoyed by the intro videos:
Delete all *.bik files inside the Videos folder except for the ones that start with M_

 

Run the game in windowed mode:
Open JuegoPla.cfg and change the value after .bFullScreen from 1 to 0

 

Want nicer looking script files?

Import this "user defined language" into Notepad++

Attached File  csf_script.xml   4.67KB   38 downloads

npp.png

 

 

 

 



#8 chnickiz

chnickiz
  • New Members
  • 1 posts

Posted 28 October 2023 - 08:20 PM

Nice to see some CSF modding happening.

 

In the past I've been playing around with the RenderWare tools (the game uses that engine) to convert some model files (to .obj?) and import in 3D software like Blender for example. It's been a while ago, but I grabbed it from here:

https://archive.org/...uery=renderware

 

You'll see some different versions on that page, along with some games which are tagged with RenderWare but are no use for CSF modding. You'll have to try and see yourself which one works, because I can't remember correctly. There's also some interesting stuff on that website when you search for "Commandos Strike Force", like this PS2 prototype:

https://archive.org/...keForce20050128

 

No idea if it's useful in any way, but still interesting to have a look at.

 

In relation to decrypting the other game files, you might want to have a look at GitHub. Some other people have been trying their luck in the past as well:

https://github.com/s...pe=repositories






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users