CaveShark

Aug 23, 2006 at 3:00 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
I wasn't sure if this should go in the ROM Editing/Hacking subforum as it's not really hacking the EXE itself, so I'm posting this here.

NOTE: It was in the general CS forum. It got moved. lol

I have finally put most of the finishing touches on a CaveStory profile editor I call CaveShark, written in C++ using the OpenGL libraries.

I'll eventually put it up for download, but not right now as I still need to put an about box or copyright of some sort within the program. wouldn't want someone claiming my work as theirs ^^

CaveShark allows you to modify your HP, weapons and their stats, and your items, all within an interface that I made to imitate the inventory window EXACTLY how it is in the game, all the way down to the blinking rectangle around selections, and weapon/item names and descriptions displayed. Except for the little differences added for the profile editing part, of course.

The entire program is navigated by keyboard in order to keep the interface as similar to CaveStory as possible.

Here's a screenshot.

EDIT: I just realized in the screenshot it says the polar star is lvl 1 with MAX. Thought that was a bug at first. But not really. It's because I had the exp set to 10 in that save file while still at lvl 1. At 10 exp it levels up to 2 in the game, so it hit my code saying the bar is full, but I didn't code it to automatically 'level up' if that happens.

EDIT2: Released! Link will never change, I overwrite the older version when I upload a new one, but I'll keep the version information up to date on this post to make it easier to check back for updates.

Latest version: 9/07/06 - CaveShark 1.21
 
Aug 23, 2006 at 3:03 AM
Senior Member
"Fly, Fly, Fly!"
Join Date: May 19, 2006
Location: Irvine, CA.
Posts: 142
Age: 34
The screenshot definitly looks promising. :D
This could be really helpful with creating new mods.
 
Aug 23, 2006 at 3:24 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
Daniel G said:
The screenshot definitly looks promising. :D
This could be really helpful with creating new mods.

Erm... Mods weren't exactly my initiative in coding it. The way it's coded, if you use a modified ArmsItem.tsc, or even the unedited japanese ArmsItem.tsc, it's liable to blow up in your face or have some really WEIRD stuff going on with the text. Actually it'll LITERALLY blow up in your face right now if you don't put it in your cave story folder with a profile.dat present. That's one thing I need to change. It has no error handling if it can't find profile.dat or data\ArmsItem.tsc. It just blows up with an illegal op.
 
Aug 23, 2006 at 6:32 AM
Been here way too long...
"The Ultimate Sword of Extraordinary Magnitude"
Join Date: Jun 14, 2006
Location:
Posts: 299
Age: 34
This isn't that useful to me, I just edit profile.dat or add the necessary TSC actions to give me items if I need to work out a kink in the script.
BTW, the maximum the HP bar can resise is 232, if the HP is set above that, the bar "spills" out of its container, so to speak.
 
Aug 23, 2006 at 2:15 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: May 19, 2006
Location: Irvine, CA.
Posts: 142
Age: 34
So this can just handle the basic mods like editing the amount of ammo you have and such?
 
Aug 23, 2006 at 7:19 PM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 39
It's hardly a mod - like he said, it's to edit profile.dat saved games, not Cave Story itself. Although I suppose you could distribute a profile.dat file with, say, 10 health at the beginning and all health capsule flags set to on, making it a forced low-hp game.

@ChimuKun:
Out of curiousity, why not just check the return values when attempting to open a file instead of crashing? It's common practice to check return values for operations that can fail, otherwise your code is likely to be unsafe. It shouldn't take more than a few lines of code to handle that (if(!retVal) { MessageBox(hWnd, "o noez crash", "crash!! bye bye!", null); PostQuitMessage(0); } else { (the rest of the code) })

It looks very nice. Assuming the code is written in a safer way, it could be a very promising profile editor. :)
 
Aug 23, 2006 at 7:38 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: May 19, 2006
Location: Irvine, CA.
Posts: 142
Age: 34
Sorry, I was using the word mod to mean a modification.
It isn't a full game mod, but it does allow you to edit the basic profile and weapons(such as limiting the ammo for the snake.) Right?
 
Aug 23, 2006 at 7:38 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
Nator said:
This isn't that useful to me, I just edit profile.dat or add the necessary TSC actions to give me items if I need to work out a kink in the script.
BTW, the maximum the HP bar can resise is 232, if the HP is set above that, the bar "spills" out of its container, so to speak.

Daniel G said:
So this can just handle the basic mods like editing the amount of ammo you have and such?

Uhm. This would be why I said I put it here because I wasn't sure whether it would fit in the subforums.

This isn't for 'modding', so to speak, it's for cheating. It's literally named to be a GameShark 'cheat device' for CaveStory. On the original english translated Cavestory. It was also a foray for me into OpenGL to see what I could do with it.

I'm eventually going to work on another program, that will be a frontend for CaveStory, also using graphics from the game. What I intend to do with this frontend is create a single executable to simplify common tasks. The main goal will be a profile switcher. I'll have to look at any other profile switchers that are out there first, see how they work, so I don't make something highly inferior.

On top of that, an integrated config menu instead of DoConfig. My idea here is to create a frontend that creates an easy way to switch profiles, and other stuff, without having to do anything in the Windows shell other than launching a single executable. While also making it look like a PART of CaveStory, instead of a generic win32 window that screams, "I don't belong here."
 
Aug 23, 2006 at 7:40 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: May 19, 2006
Location: Irvine, CA.
Posts: 142
Age: 34
Heh we posted at the same time.
I understand now. :)

I like the idea of the profile switcher. :)
I'll definately give it a try when you're ready to release it.
 
Aug 23, 2006 at 7:47 PM
Been here way too long...
"..."
Join Date: Jun 25, 2005
Location:
Posts: 372
If there is any possible way to edit the keys to something else on the keyboard and you do it, your frontend will become the ultimate. :)
 
Aug 23, 2006 at 8:29 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
RuneLancer said:
@ChimuKun:
Out of curiousity, why not just check the return values when attempting to open a file instead of crashing? It's common practice to check return values for operations that can fail, otherwise your code is likely to be unsafe. It shouldn't take more than a few lines of code to handle that (if(!retVal) { MessageBox(hWnd, "o noez crash", "crash!! bye bye!", null); PostQuitMessage(0); } else { (the rest of the code) })

It looks very nice. Assuming the code is written in a safer way, it could be a very promising profile editor. :)

yeesh, took me so long to write my last post that I missed some replies.

I'm still learning C++, I took a college class last semester but it only covered dos prompt stuff, which I absolutely hate. But I also took an OpenGL class last semester, so I was able to combine the knowledge.

And yes, that's why I said "That's one thing I need to change." It crashed like that because I FORGOT to handle the errors. Anyways, they're handled now, but not in the way you just mentioned. I was SEARCHING for a function like that but couldn't find one. Is there a specific file I need to header file I need to #include? my current error boxes created using OpenGL look way too unprofessional, even if they were 10 times harder to code than just using MessageBox.

I was about to post the link to the program, but now it's gonna have to wait. :)

EDIT: I got MessageBox to work. Link up soon.

About the only thing still not 'safe' is how it reads ArmsItem.tsc. It uses a pointer table of byte offsets for where each message starts, and then will read them in until it hits a '<'. This works fine so long as you use the English translated copy of the file. But any other ArmsItem.tsc file, and any item/weapon names and descriptions will more than likely be wrong in every way shape and form. Other than that, it wouldn't actually CRASH unless the file is a different size.

EDIT: Complete! I also told it to auto quit with a message box if ArmsItem.tsc is even a single byte more or less than the program expects.

Here's the link.

Oh, and as for the life capsule flags, Those aren't modifiable with CaveShark. I might add the feature in a later version.

And anybody know a good FREE icon editor? the one thing CaveShark lacks is an icon. I looked at the ones included in CaveStory Deluxe, and not only would one of those be unoriginal, but none of them quite fit the program's content.
 
Aug 24, 2006 at 3:05 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
Didn't want to double post, but since nobody posted a reply after my initial release, I pretty much have to in order for anyone who downloaded it to notice and read this important update. My initial release was, sadly, broken. I hadn't tested it as thoroughly as I should have, and when I actually went to use it earlier this morning, found that I had overlooked the fact that it wasn't saving changes to the weapons to the copy of profile.dat that CaveShark not only stores in active memory, but also saves back to the file on disk when you save. This caused it to APPEAR to make the changes, but it didn't
save them to disk. It is now fixed.

CaveShark 1.01

I would have kept it as CaveShark 1.00, since the previous 1.00's features weren't COMPLETE like they should have been. But I also changed the code a bit to display "Infinite" for Maximum Ammo on the Weapon Stats editing screen when max ammo is 0. Because some people may be using this program without reading up on how to do it with a hex editor, thus, they wouldn't know that a max ammo value of 0 is treated as infinite.
 
Aug 24, 2006 at 5:10 PM
Been here way too long...
"The Ultimate Sword of Extraordinary Magnitude"
Join Date: Jun 14, 2006
Location:
Posts: 299
Age: 34
"Developed using the Dev-C++ IDE" has encountered a problem and needs to close.
We are sorry for the inconvenience.

It doesn't even start up for me in Windows XP, and I indeed put it in the Cavestory folder w/GLUT32.DLL.
 
Aug 24, 2006 at 5:23 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: May 19, 2006
Location: Irvine, CA.
Posts: 142
Age: 34
It works great here!
Definitely a nice program, though just using the keyboard was a bit confusing at first.
 
Aug 24, 2006 at 6:08 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
Nator said:
"Developed using the Dev-C++ IDE" has encountered a problem and needs to close.
We are sorry for the inconvenience.

It doesn't even start up for me in Windows XP, and I indeed put it in the Cavestory folder w/GLUT32.DLL.

That's odd. I should have handled any errors that popped up. That's WinXP's illegal operation error, which means it's an error that I didn't account for.

What version of CaveStory are you using it on? I've only tested it on 1.0.0.6. It's possible that 1.0.0.5 or lower creates an incompatible profile.dat. And CaveShark WILL NOT work on the original Japanese version, just Aeon Genesis's Translation. But if it is the japanese version, it should come up with an error message *I* created

I don't know where you would download 1.0.0.5 though, so I can't test to see if that's the problem.
 
Aug 28, 2006 at 9:11 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
making it play the sounds for moving the selection over weapons and items, just because I can, and it will help the whole 'part of CaveStory' feel. I could easily do it with the wav files I've converted from the ptones, but just because I want to embed the wav files in the exe and play them from there, I'm running into problems. What good are the contents of .rc files when you can't even access the resources contained within from your code without huge modifications? >.<
 
Sep 7, 2006 at 4:21 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
Somewhat major update. CaveShark 1.2

CaveShark now has Sounds! Although, I wish I could store the sound in the exe instead of adding a folder to your CaveStory directory. Also, a big bug I overlooked has been fixed. The code that kept it from going past the 'no item' following your last item in the list. Given certain conditions (including no items at all), you could move the item cursor past that 'no item' slot. This, while relatively harmless, was bad. If you entered hacking mode for a slot past the 'no item' slot, not only is CaveShark programmed to ignore it, but so is CaveStory. This is assuming entering hack mode on any of those slots didn't cause the program to enter a condition that didn't match anything in the keyboard routines, thus causing the program to get 'stuck', but not frozen.
 
Sep 7, 2006 at 4:34 PM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 39
It gets worse. By writing data past the reserved space for CS's items, you're going to leak into other memory, potentially causing heavy problems (or very interesting results.) Glad you go that fixed. ;)
 
Sep 7, 2006 at 4:44 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Aug 23, 2006
Location:
Posts: 29
Age: 40
RuneLancer said:
It gets worse. By writing data past the reserved space for CS's items, you're going to leak into other memory, potentially causing heavy problems (or very interesting results.) Glad you go that fixed. ;)

No no no, it wasn't passed the reserved space or I would have specifically stated 'off the array'. If I ever have a problem like that, it's rare, because I'm not stupid. ;P

The array is fixed to Cavestory's maximum item slots, and CaveShark was already programmed NOT to go off the array. It's just also programmed to not even allow you to SELECT an item slot past the one that says 'No Item.' This is now fixed.

Ok, say you have 5 items. That means the 6th slot says 'No Item.' CaveShark will allow you to select the 6th slot so you can edit it and add an item, but it's NOT supposed to allow you to go to slot 7 until you put an item in slot 6. This was not working correctly, and depending on how many items were in the list, it would let you go past it. You weren't going off into other memory, You were just going to a part of the reserved memory that you weren't supposed to have access to yet.

Although you couldn't see the cursor, it was still behaving WITHIN the array given the restrictions that WERE working.

Oh, also, although the zip file is bigger, it's due to the fmod dll file and the wav files. the exe is actually SMALLER this time. I accidentally released the debug version for the last one.
 
Sep 7, 2006 at 6:05 PM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 39
Hehe, glad to see you got FMOD working after all. Have you started working on a wrapper class (for reuse in future projects) or is it all directly integrated in your source for the time being? Not that either way is any better, once compiled, but it's worth the time to try to modularize code. Just some advice from an idiot who spent many projects copy-pasting bits and pieces from his Win32 GUI management routines in his younger years. ;)
 
Top