Forum

> > CS2D > Mods > String - Manipulation
Forums overviewCS2D overview Mods overviewLog in to reply

English String - Manipulation

13 replies
To the start Previous 1 Next To the start

old String - Manipulation

TimeQuesT
User Off Offline

Quote
I'm aware that manipulating Cs2D Core files (CounterStrike2D.exe, etc.) is illegal, but I'm sure that DC does not mind if I / you just change some strings( / labels).

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
You're developing a standalone mod for Cs2D and want to implement your own weapons, but the standard names of your chosen template sucks?

Here's the solution. Just change the weapons name. But how?
It's simple. The name of the weapon is stored in the main executable(win). You just have to search for it and change it.

Using this technique you can do awesome stuff like that:
IMG:https://dafuqftp.bplaced.net/tutstr/tut01.png


What do I need?
At first you need a hex-editor. I'm using XVI32.
You can download it HERE.
Then you need the following list, which contains the location of all strings used by the executable.
CLICK HERE
(I generated it using a self written tool)

Getting started
First open Cs2D.exe in your Hex-Editor.
After that search for you chosen weapon in the given string list. In this example I'll use "Galil".

The line in the textfile where I found it tells me this:
1
1002[@2448276]=Galil
The only important thing you need is the number written in the brackets. It's the location of the string in the executable. In this case 2448276

Now switch back to your Hex-Editor. Open the Goto window.
IMG:https://dafuqftp.bplaced.net/tutstr/tut02.png

(Or just Ctrl+G)

Type the location of the string into the textbox and be sure that "decimal" & "absolute" are marked. Then hit ok.
IMG:https://dafuqftp.bplaced.net/tutstr/tut03.png


You should end up with the first letter of the weapons name selected.
IMG:https://dafuqftp.bplaced.net/tutstr/tut04.png


Now you have to face one problem. You can only rename it limited.
G A L I L --> 5 letters
That means your new name for it can only contain <=5 letters.
In this example I'll name it "SHOCK". The word is exactly 5 letters long.
IMG:https://dafuqftp.bplaced.net/tutstr/tut05.png


Now you just have to save your work.
(File->Save as)
I advice you to not overwrite the original file.

To make the gfx for your "new weapon" work, you also have to rename its gfx file.
IMG:https://dafuqftp.bplaced.net/tutstr/tut07.png


I ended up with this:
IMG:https://dafuqftp.bplaced.net/tutstr/tut06.png


I would be very thankfully if someone could send me a corrected version of this.(English)
And please help me finding a better title. This one is looks odd.

Here's just a small video demonstrating some experiments.
http://www.youtube.com/watch?v=ZueWwqruVh0

old Re: String - Manipulation

Pagyra
User Off Offline

Quote
We have already known about this method.
This method is prohibited - Violation of integrity of file.

old Re: String - Manipulation

DC
Admin Off Offline

Quote
It's a bad idea - and not allowed - to manipulate the EXE file. It's currently not implemented but future checks using check sums could come to the conclusion that your game is either damaged or a cheat client.

So just don't do it. And if you do it anyway: Don't complain if you get banned from servers or this website someday. You have been warned.

I might add the weapon and team names to the translation files some day. Not sure.
The current reason for not having them there is that they are used by the code in some cases. For example for some commands which expect weapon names as parameter. So changing these names would break some existing scripts.
Of course I could duplicate these values and still use the original names internally for script stuff. However I would probably add a shitload of bugs to the game when doing this.
To the start Previous 1 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview