Cave Story Python save converter

Mar 25, 2010 at 2:07 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6210
Age: 38
Document the mac executable, give the documentation to Wistil so that he can support mac executables in Cave Editor, then port everything over by hand.
 
Apr 2, 2010 at 1:12 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Noxid said:
I was wondering if it would be possible for one to take a completed mod and convert it to something mac-friendly? Would it be a lot of work? How was Cave Story ported to the mac?
Kinda not really on topic but I didn't want to make a whole new thread and stuff so this seemed like the best place to put it.
You could, in principle, edit the scripts, levels, and npc.tbl using Cave Editor on Windows, then copy them over. The difficult part is altering the executable, which will almost certainly be necessary.

andwhyisit said:
Document the mac executable, give the documentation to Wistil so that he can support mac executables in Cave Editor, then port everything over by hand.
I still don't agree that it's necessary to document the entire Mac executable. Also, why would you have Cave Editor support Mac executables? That seems a little pointless.

Also, despite what Noxid said, this topic has literally nothing to do with the topic of this thread (the thread is about my save-game editor, which is nothing to do with modding). I'd rather have this discussion moved to a new thread.
 
Feb 6, 2011 at 2:52 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 6, 2011
Location:
Posts: 6
Sorry for the LARGE necro/bump, but I'm having a problem: I've got python 2.6.4, running it on a 10.4.11 tiger machine, and when I run the .py, I get this:

Code:
Ultra:~ joshua$ ./cavesaveconv.py
-bash: ./cavesaveconv.py: No such file or directory
Ultra:~ joshua$ /Users/joshua/Desktop/CSC\ v0.3\ beta/cavesaveconv.py 
File "/Users/joshua/Desktop/CSC v0.3 beta/cavesaveconv.py", line 388
print "Quote is in map", map, "at", '(' + `horz` + ',' + `vert` + ')', "facing", "right" if dir == 2 else "left"
^
SyntaxError: invalid syntax
 
Feb 8, 2011 at 3:03 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
I'll never complain about this thread being bumped. It may even remind me to get working on this again (there's an update I still have to release at some point).

Anyway, the syntax there is not invalid in my version of Python. I'd hazard a guess that it's new in 2.6.6, which is (I believe) what I had when I created this (though I have since upgraded to 2.7).

So basically, if you download the latest Python 2.7 from Python.org, it should work fine. Do not download Python 3.1, since it won't work with that version.
 
Feb 8, 2011 at 11:30 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 6, 2011
Location:
Posts: 6
Still getting it...

Code:
  File "./cavesaveconv.py", line 388
print "Quote is in map", map, "at", '(' + `horz` + ',' + `vert` + ')', "facing", if dir == 2: "right" else: "left"
^
SyntaxError: invalid syntax

Running 2.7.1...
 
Feb 14, 2011 at 4:47 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
It looks like you have been editing or something. Look up at the previous error, where the syntax is correct, and compare it with this error, where it has been changed to be incorrect. Just revert to the old line and it should work fine.
 
Feb 15, 2011 at 11:59 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 6, 2011
Location:
Posts: 6
I tried it on a fresh download, and I get that exact error.
 
Feb 21, 2011 at 6:22 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Uh, what? Was the first error also on a fresh download? Both can't be true, because the line generating the error is clearly different.

If you can't figure it out, just replace the line in the second error with the line from the first error, I guess.
 
Feb 26, 2011 at 2:37 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 6, 2011
Location:
Posts: 6
The very first error I got was a fresh download, so I tried editing the file to see if I could fix it. It didn't work, and I posted the resulting error. I then tried a fresh download, and got the same error as the very first error.

(If that makes sense).
 
Mar 4, 2011 at 2:36 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
No, it doesn't make sense, because it's impossible to get the second error in a fresh download, because if that line of code had existed in my source I would have gotten the error myself and fixed it before uploading.

Okay, just do this. Open up cavesaveconv.py, go to line 388, and replace it with this:
Code:
print "Quote is in map", map, "at", '(' + `horz` + ',' + `vert` + ')', "facing", "right" if dir == 2 else "left"
Make sure you preserve the indentation (tabs at the start of the line); if you don't, it'll break. Otherwise, it should be fixed.
 
Mar 5, 2011 at 4:04 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 6, 2011
Location:
Posts: 6
Code:
CSC v0.3 beta/cavesaveconv.py", line 388
print "Quote is in map", map, "at", '(' + `horz` + ',' + `vert` + ')', "facing", "right" if dir == 2 else "left"
^
SyntaxError: invalid syntax

I'm thinking something's probably REALLY screwed over with my python install if this isn't happening to anybody else....
 
Mar 7, 2011 at 4:07 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Alright, you said you installed python 2.7, right?

Try typing 'python --version' without the quotes. If it doesn't say 2.7, try 'python2.7 --version'. Then, assuming that doesn't give an error, type 'which python2.7' and copy the path it prints out. Open up cavesaveconv.py and replace the first line with that path (except keep the #! at the start).

Let me know if that helps.
 
Mar 17, 2011 at 12:49 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 6, 2011
Location:
Posts: 6
Tried that, the full path was:

/Library/Frameworks/Python.framework/Versions/2.7/bin /Library/Frameworks/Python.framework/Versions/2.6/bin /bin /sbin /usr/bin /usr/sbin

But it said it was version 2.7.1...

Anyway, now it gives me a 'permission denied' every time I try to run it.
 
Mar 23, 2011 at 1:59 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Either put "python" before the command name, or run the following in the script's folder:
Code:
chmod u+x ./cavesaveconv.py
 
Dec 28, 2011 at 9:16 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Dec 28, 2011
Location:
Posts: 2
Hello!

I'm not entirely sure what I"m doing wrong, but I run the script and it says
Sorry, but the prefs file cannot be found.
Perhaps Cave Story has not been installed or run on this account.
Enter the filename to extract the profile to:
Or type Q to cancel.

I have run cave story+ on this machine, does it only work for cave story? I looked in the rest of the thread but I couldn't find anything that mentioned this issue.

Thanks!
 
Dec 28, 2011 at 9:22 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
This was written before CS+ existed so it would probably be reasonable to assume it only works for original cave story, yes
 
Dec 29, 2011 at 10:43 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Dec 28, 2011
Location:
Posts: 2
alrighty, thanks! In the same vein, is there any way to just remove the reindeer/santa skin for the character in the .dat file, because for some reason there is no toggle in the options menu in the mac launcher.

Thanks!
 
Jan 16, 2012 at 3:16 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
I can't be certain since I haven't investigated CS+ yet, but if they store the profile the same way, in the .plist file, then all you'd have to do is locate that file and pass it as a command-line argument somehow... I don't recall the exact syntax to do this, but you should be able to find it in the readme file somewhere.

Perhaps once I obtain CS+ I will look into this.
 
Jan 30, 2012 at 9:36 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jan 30, 2012
Location: New Zealand
Posts: 2
I thought that this thread was fairly relevant, instead of making a new one, so here I am, ready to ask a question.

Basically, I've got Cave Story on my Mac but I've always just played it on Windows. I wanted to transfer my saved game over to my Mac, which SHOULD be no big deal. Except for one thing - I cannot, for the life of me, find the save file ANYWHERE on my Mac, and I'm going crazy trying to find it. I've looks in every damn Library and Applications folder that exists, I've used every search field imaginable to no avail, and I've manually searched through many folders, including the app package contents. There is no Profile.dat anywhere, nor is there a com.Nakiwo.Doukutsu.plist file. To make matters worse, in the app package contents is Info.plist which has, well, info, but there's one line that just annoys me:

<string>com.nakiwo.Doukutsu</string>

So that basically tells me that the .plist file exists. Kind of. Maybe. If I change that, the game won't be able to load the saved game. I tried changing it to "helloworld" (because... why not?) but once I save, it can load from that, and if I edit it back, I can access the old save file. But I can't find "helloworld" or "helloworld.plist" anywhere on the computer either, so I'm stumped.

If anyone can help me find the save file so that I can convert my Windows one and replace the Mac one, I'd REALLY appreciate it.

Oh, and if anyone knows where on earth the settings are (not including what is available in Finder when the game is open, because those are very minimalistic compared to the .exe (forgot its name) in Windows that controls the settings (although it is all in Japanese)), I'd appreciate that too. I want to make the game full-screen instead of a piddly little window, but no dice.
 
Top