Jump to content

LR2 Custom Car Unpacker


Quisoves Potoo
 Share

Recommended Posts

Quisoves Potoo

gallery_8294_414_191250.png

 

A few days ago, I was alerted, thanks to Firedude34, to a conspicuous, yet easily filled, gap in the LEGO Racers 2 tool library. It is thus that I present, for your entertainment and edification, the LEGO Racers 2 Custom Car Unpacker ("CCDU.")

 

Download

Instructions

  • Download and extract CCDU.zip
  • Locate your LEGO Racers 2 "SaveGame" file, which is normally situated in DocumentsGamesLEGO Racers 2Saved Games.
  • Drag the file to "CCDU.exe", and voila! All your custom cars (.CCD files) have been extracted. You will find them in the folder "[save-file name] Car Files"

Notes:

  • If an Adventure Mode car is present for a particular world, a duplicate exists (last among the car files for that world.) This is a peculiarity of LEGO Racers 2.
  • I deemed it most convenient for the program to overwrite any preexisting custom car files, should they share their names with those being extracted. Thus, if you intend to unpack your save-game once more, and want to save an already-unpacked car for later, you must either move it to another folder or change its file-name.
  • Program written in Python and compiled via Py2EXE.

 

And special thanks to Xiron, for listing the offsets of certain .CCD files, thus making the naming feature a synch.

  • Like 6
Link to comment
Share on other sites

Quisoves Potoo

I was waiting for a tool like this! Welp, time to link to here in >my tutorial topic.

 

Thanks for the tool Quis. :)

Glad to be of service!

And thank you for listing the offsets of some of the .CCD files, which made the naming feature a synch!

Link to comment
Share on other sites

Fluffy Cupcake

You're welcome. :)

Do you need me to find the remaining offsets, or was there some kind of pattern that you were able to pick out for the remainder that I never included?

Link to comment
Share on other sites

Quisoves Potoo

Do you need me to find the remaining offsets, or was there some kind of pattern that you were able to pick out for the remainder that I never included?

The latter. All of the cars are grouped according to their respective worlds.

Link to comment
Share on other sites

Fluffy Cupcake

Alright.

 

So then, how does CDDU = Custom Car Unpacker? I assume the D was taken from the CCD file format, and that the U stands for unpacker.

Link to comment
Share on other sites

Quisoves Potoo

So then, how does CDDU = Custom Car Unpacker? I assume the D was taken from the CCD file format, and that the U stands for unpacker.

Correct!
Link to comment
Share on other sites

Fluffy Cupcake

So then, how does CDDU = Custom Car Unpacker? I assume the D was taken from the CCD file format, and that the U stands for unpacker.

Correct!

Self-answering Xiron strikes again!
Link to comment
Share on other sites

Nice! Any chance you could release the Python source code?

 

I was going to ask the same thing, or better yet, host it on GitHub along with his other project(s). ;)

 

Good job, QP! I know you have trouble programming, so this has to make you glad. :D BTW, if you ever need Python help, and I mean ever, I'm here for you. Ask away. "Newbie" question, problems, techniques, "how to", style, just let me know. I want you to succeed in your programming, no matter the obstacles. :)

Link to comment
Share on other sites

Fluffy Cupcake

Can you make a way to inject .CCD files into the SaveGame as well, in case a car-change is wanted post-adventure?
 
The program would probably ask like so:

Which Vehicle Would You Like To Replace?
1. Sandy 1
2. Sandy 2
3  Sandy X (Until Finished)
4. Adventure 1
5. Adventure #

Etc.

Link to comment
Share on other sites

Thanks alot dude!

But i don't know what to do after this?

Yes i have the file now but what i do with it?

Sorry if im being rude but its really complicated im just 13!

I think i found out, for expample you just add rocket racer car and change name to Xalax1 for example im gonna try it!

If im doing wrong please make a list of how to do this!

Link to comment
Share on other sites

Oh, nicely done, QP! I didn't know you could make programs. :)

 

Thanks alot dude! But i don't know what to do after this? Yes i have the file now but what i do with it? Sorry if im being rude but its really complicated im just 13!

 

With that you can change the other racers' cars, and your Adventure Mode car from any world if you've already made one. Your age is no excuse.

  • Like 1
Link to comment
Share on other sites

Fluffy Cupcake

Yes but can you or someone make me a list what to do?

Um. Isn't that what the Instructions in the first post of this topic is? It is a list of what to do.

 

Also, what Shadowblaze said. Age is no excuse. Lack of experience on forums on the other hand...

Link to comment
Share on other sites

Fluffy Cupcake

Under game data, there is a folder that I believe is named CARS. [i could be off about the name, all I know from the top of my head is that it is among on of the top of folders in game data, provided you have them organized by name.] In this folder you will find folders named after the worlds, and in these worlds folders are the .CCD files that you can replace.

 

If you still can't find them, do a ".CCD" search in your game data folder.

Link to comment
Share on other sites

I found them and I replaced rocket racer car with sandy bay 1.CDD and it didn't work! All the NPCs had there own vehicle!

Please help me!

Link to comment
Share on other sites

Fluffy Cupcake

Try replacing something like the post van and race Mike The Postman? It should work.

Either that or your changes aren't getting saved, for obvious reasons.

Link to comment
Share on other sites

Ok now i replaced the post van with rocket racer and when i tried there were sitting on a arctic car with no bricks!

If you know this reply!

Link to comment
Share on other sites

Fluffy Cupcake

@Firedude34; I don't know sorry. Unless you replaced Rocket's car with an Arctic car earlier at a prior point and completely forgot about it, I really don't know what is going on. The problem you described sounds completely irrational otherwise.

When you race Rocket Racer in adventure mode, is his car that arctic chassis alone?


Can you make a way to inject .CCD files into the SaveGame as well, in case a car-change is wanted post-adventure?

I just thought of an obstacle in what I suggested earlier. Somewhere else prior I said something regarding the GameSave file, that being, whenever you make a change to any single byte in the file, even if you revert it by changing the byte back to what it originally was, the game doesn't like it and won't load the file for some odd reason, as if it is looking for a signature from the game or something.

  • Like 1
Link to comment
Share on other sites

Quisoves Potoo

Can you make a way to inject .CCD files into the SaveGame as well, in case a car-change is wanted post-adventure?

 

The program would probably ask like so:

Which Vehicle Would You Like To Replace?

1. Sandy 1

2. Sandy 2

3 Sandy X (Until Finished)

4. Adventure 1

5. Adventure #

Etc.

Ach! I'd quite forgotten that LR2 does not, unlike its predecessor, allow for copying of cars. I should hopefully be able to update the tool with such a feature soon.

 

Nice! Any chance you could release the Python source code?

I initially thought the code so slight as to be of no interest. But since it seems I was wrong, I shall do so, as soon as I'm done implementing the packing feature.

I just thought of an obstacle in what I suggested earlier. Somewhere else prior I said something regarding the GameSave file, that being, whenever you make a change to any single byte in the file, even if you revert it by changing the byte back to what it originally was, the game doesn't like it and won't load the file for some odd reason, as if it is looking for a signature from the game or something.

I seem to recall something similar with the TT save-game files. Those used time-stamps of some sort, I believe. I doubt it will be too much trouble, however. *Knock on wood.*

I was going to ask the same thing, or better yet, host it on GitHub along with his other project(s). ;) Good job, QP! I know you have trouble programming, so this has to make you glad. :D BTW, if you ever need Python help, and I mean ever, I'm here for you. Ask away. "Newbie" question, problems, techniques, "how to", style, just let me know. I want you to succeed in your programming, no matter the obstacles. :)

Thanks! Depending on the difficulty of my next project, I might be seeking your assistance frequently. And speaking of newbie questions, how does one enable a file-drag-and-drop onto a running module? sys.argv only seems to work when first opening the module, and simply dragging the file in as input runs afoul of the accursed "truncated UXXXXXXXX escape" error.

Oh, nicely done, QP! I didn't know you could make programs. :)

Thanks! My health, alas, has kept me away from coding for the past several years. But a gap year has its benefits.

Ok now i replaced the post van with rocket racer and when i tried there were sitting on a arctic car with no bricks!

If you know this reply!

Could you upload your save-game to Oresome by any chance? I'd like to examine it. What you're describing is rather odd, to say the least.

  • Like 1
Link to comment
Share on other sites

Quisoves Potoo

Here it is i have rocket racer car in the sandy bay file and replaced postman and as you said i have a file of it! http://oresome.rockr...om/download/197


Thanks!

 

I think I've figured out the problem. It's not file corruption. Your Rocket Racer.CCD works like charm.

gallery_8294_414_14001.png

 

Looking at your CAR BUILDSANDY folder, It seems that you don't grasp the concept of file-replacing. Simply deleting one file and putting another in the same folder will only prevent the computer from finding what it is looking for. LEGO Racers 2 has been told to find "POST VAN.CCD." It doesn't care tuppence-halfpenny for the number of .CCD files in the folder, it wants a file by that name. So, you could have a million .CCD files in the SANDY folder, and the program will only notice those with the right names, of which there can be no more than eight, in this case.

Here's a little tutorial:

  1. Find SANDY BAY 1.CCD in the "GameSave Car Files" folder.
  2. Copy it to the CAR BUILDERCARCRAZE folder.
  3. Rename the WARRIOR.CCD file. Simply adding a "-" to the end of its name should do.
  4. Now, rename "SANDY BAY 1.CCD" to "WARRIOR.CCD"
  5. Start a race on Xalax, and observe Warrior's car.
Link to comment
Share on other sites

Thanks! Depending on the difficulty of my next project, I might be seeking your assistance frequently. And speaking of newbie questions, how does one enable a file-drag-and-drop onto a running module? sys.argv only seems to work when first opening the module, and simply dragging the file in as input runs afoul of the accursed "truncated UXXXXXXXX escape" error.

You might have to explain your use case here. I'm scratching my head on this one. :P That error occurs when a string contains an escape character that does not work in that context and the character was not escaped. For example: \n creates a new line in a string. However, a new line does not make sense in a file path (C:\notworking). In that case, you need to escape the string. The quickest way to do that is inFile = inFile.replace("", os.path.sep). Hopefully you already  know about string escaping and replacement so I don't have to explain that. ;P

That being said, I was able to get such a use case (as I understand it) working using the following script (also on Python 3.4):

newFile = input().strip('"')
print("The new file is:", newFile)

with open(newFile, "rb") as f:
    print(f.readlines()[0])

The key is in .strip('"'). Dragging a file into an input prompt wraps it in a second pair of strings, creating an OSError. That line removes the double quotes input() wraps it in, thus making it valid.

I initially thought the code so slight as to be of no interest. But since it seems I was wrong, I shall do so, as soon as I'm done implementing the packing feature.

I completely respect and understand that, but in my quick testing I've uncovered three easily-fixable bugs (I know, I am so mean :P), and I'd like to provide a patch and advice on them so you don't hit them in the future. :) GitHub would make that very easy to do, but it's all up to you. ;)


EDIT

and simply dragging the file in as input runs afoul of the accursed "truncated UXXXXXXXX escape" error.

I totally missed that. -_-

Yea, you'll need to explain your use case for me here...

Edited by le717
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.