"Hardcoding" Names

Post new mods and scenarios here.
Post Reply
utexgrad
Posts: 37
Joined: Wed Jun 27, 2007 2:52 pm

"Hardcoding" Names

Post by utexgrad »

Apologies if this has already been answered in another thread, but no search I ran revealed anything so here goes nothing....

Is there a way to force soldiers to have the names you want? Any help would be greatly appreciated.
User avatar
Senior Drill
Posts: 199
Joined: Tue Nov 20, 2007 11:16 pm
Location: Quantico

RE: "Hardcoding" Names

Post by Senior Drill »

In a single battle, there is not. The names are randomly selected from the applicable nation's names text files. This is a part of the executable that can not be influenced or hacked. In saved operations and campaigns you can hex edit the names, but it is time consuming and unless you are very careful to only replace bytes and never add a single byte which will corrupt that save it can be done for existing units. I do not believe that it will effect units that have yet to appear in the operation or campaign, but I have never experimented with those.

C'est magnifique, mais ce n'est pas la guerre.
utexgrad
Posts: 37
Joined: Wed Jun 27, 2007 2:52 pm

RE: "Hardcoding" Names

Post by utexgrad »

Thanks for the reply, SD. I guess if nothing else I could keep separate name text files for the battles with just the names I want and rotate them in and out.
User avatar
panzerlehr62
Posts: 314
Joined: Mon Feb 23, 2009 1:08 am
Contact:

RE: "Hardcoding" Names

Post by panzerlehr62 »

Hello,

I am sure you will get more helpfull advise then what I can give you. I used a hex editor program to change the names that were set by the computer once you create a game file (ie a grand campaign for example). I was told a good hex editor is "hackman hex editor", do a search for it, you will find its a free download. Matter of fact I just downloaded it and it looks far better then what I was using. One ive been using was Hexedit 4.3 by MiTec. As of today I will probably go with Hackman.

Basically what you will do then is a string search in that file for the name you want to change. Once you find the name you have to use hex code to change each letter. Sounds complicated, but it really isnt once you mess around with it. Hardest part is finding the right name if you are looking for a specific one. Because you will find the game uses the same names a lot. So if its a particular team you want to change, write down all the names in it then do a search for one of them. Once you see the rest of the men from that team above or below one you found then you know you are in the right spot of the game file.

*********** WARNING *****************

Beware of using a not so good hex editor, because it could mess up your game file. I found that out the hard way. Also practice on a test game file till you get it right. I'll post some pictures from using the hexeditor I used to "find" a name and add a "s" to the end as an example for you.

Good luck and have fun,
Gz..



Image
Attachments
UO0068.jpg
UO0068.jpg (172.26 KiB) Viewed 488 times
User avatar
panzerlehr62
Posts: 314
Joined: Mon Feb 23, 2009 1:08 am
Contact:

RE: "Hardcoding" Names

Post by panzerlehr62 »

Search for the name "Andrew"....

Image
Attachments
UO0069.jpg
UO0069.jpg (6.13 KiB) Viewed 487 times
User avatar
panzerlehr62
Posts: 314
Joined: Mon Feb 23, 2009 1:08 am
Contact:

RE: "Hardcoding" Names

Post by panzerlehr62 »

Screen now shows a hit. You will see the hex numbers to the left that make up each letter.

Image
Attachments
UO0070.jpg
UO0070.jpg (184.54 KiB) Viewed 487 times
User avatar
Senior Drill
Posts: 199
Joined: Tue Nov 20, 2007 11:16 pm
Location: Quantico

RE: "Hardcoding" Names

Post by Senior Drill »

ORIGINAL: utexgrad

Thanks for the reply, SD. I guess if nothing else I could keep separate name text files for the battles with just the names I want and rotate them in and out.

That will work, but you may run into a number of duplications as the selection is randomized.

One bright spot I can offer for you is that in the military CCMarines v6, it is possible to rename, re-rank and re-equip and fatigue\morale each soldier of every team in the battle maker editor. That version is only for single, one-off battles, but the capability has already been developed. Hopefully the coming CCVI will carry that capability through to operation and campaign units as well. Keep your fingers crossed that it is a feature and keep as many things as necessary crossed that it will indeed be made.
C'est magnifique, mais ce n'est pas la guerre.
User avatar
panzerlehr62
Posts: 314
Joined: Mon Feb 23, 2009 1:08 am
Contact:

RE: "Hardcoding" Names

Post by panzerlehr62 »

Now by entering "73" (changed the 00 to 73, I did NOT insert a new byte, as Drill points out if I follow him correctly, inserting a new byte will totally screw up the game file and I can see how that would) at the end of the name we add a "s" to the end of that name. Fairly simple once you get the hang of it. Again practice on files you don't care about till you get it down.

Gz...

Image
Attachments
UO0071.jpg
UO0071.jpg (185.05 KiB) Viewed 487 times
User avatar
Senior Drill
Posts: 199
Joined: Tue Nov 20, 2007 11:16 pm
Location: Quantico

RE: "Hardcoding" Names

Post by Senior Drill »

Sorry for the overlap there, pl62. I have Hackman as well as AEdHex and XVI32. All have some advantages over the others. UltraEdit32 is also great if you want to pay for the license.

Basic hex editing rules are:

1. If you try to hex edit the game .EXE and did not make a back up copy, you have only yourself to blame for the required re-install.

2. Never insert bytes! Only replace bytes. One single byte will change the callout location of later executable commands that will thrash and crash your editing at some point of the game. It may look good at first, but it will Gotch! somewhere if it doesn't upchuck right at the start.

3. Never try to go beyond a 01, a 02, or 03 in an editable area when changing bytes. Those are typical end of data markers and can not be moved or safely changed. You will only screw up the next callout location, which will sooner or later crash your game. If your change will not fit, just accept that your change will not fit and think of another text string to use.

4. Do not waste your time trying to hex edit the CCResourse.dll. Find any one of many freeware Resource Editors that cans edit and save a .DLL without altering absolute references.

5. Backup your files before editing. Backup your files before editing. Backup your files before editing. Backup your files before editing.







C'est magnifique, mais ce n'est pas la guerre.
User avatar
panzerlehr62
Posts: 314
Joined: Mon Feb 23, 2009 1:08 am
Contact:

RE: "Hardcoding" Names

Post by panzerlehr62 »

Sorry to Drill,

I was making the screen shots and starting to post at same time you were as it turned out and it took me awhile to get them all out here. The file I had that messed up earlier was due to the hexedit program I orginally used, only change made then was timer change to 20m. I then in boredom, put some of you guys into the game as fun and we have made a turn ok and all seems fine. Overall I think its kinda cool really to personalize somethg one will be playing for months, if not possibly a year at the rate my current GC is going.

Gz...
utexgrad
Posts: 37
Joined: Wed Jun 27, 2007 2:52 pm

RE: "Hardcoding" Names

Post by utexgrad »

Thanks very much for all the suggestions and the tutorial! That's going to go a long way towards either making me a CC hex editing genius, or I'll be reinstalling my game over and over again [:)] Either way y'all have done me a great service and I really appreciate it.
User avatar
CSO_Talorgan
Posts: 804
Joined: Sat Mar 10, 2007 5:53 pm

RE: "Hardcoding" Names

Post by CSO_Talorgan »

ORIGINAL: panzerlehr62

Because you will find the game uses the same names a lot.

Yes!

Why is that?
brent_2
Posts: 299
Joined: Tue Mar 27, 2001 5:00 pm
Location: Rheingau, Hesse, DE
Contact:

RE: "Hardcoding" Names

Post by brent_2 »

If I remember correctly you could increase the names in the names file and reduce the repetition, but it's been (quite) a few years since I messed with it.  I don't think that was a file that was size limited.
 
CSO_Brent
I'm essentially graphically and history oriented, unfortunately to connect the two I have to do maths. I hate maths.
CSO_Brent
Post Reply

Return to “Mods and Scenarios”