CaveEditor again (beta, maybe alpha)

Jul 5, 2009 at 5:13 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
Ok minor update (first post). Hotkeys have been added to the map editor window.
Insert - Add entity
Delete - Delete entity
Ctrl+C - Copy entity
Ctrl+V - Paste entity
etc.
The menus say whether or not a hotkey exists. Updated source has been updated too.
 
Jul 7, 2009 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
Wistil said:
I'm currently doing everything with Windows GDI which is pretty slow and clunky. It was the easiest to pick up and learn for me, however.
I recommend wxWidgets – it seems fairly simple to use. Then again, converting your current code to use it would probably be a lot of work...

Wistil said:
I'd love to use OpenGL for the graphics, and add some keyboard shortcuts but I'm still figuring all that out.
I think OpenGL wouldn't be such a good choice for the graphics, actually, since it's more for 3D stuff. SDL is good for 2D stuff, but for this I think it's better to use widget toolkits that support drawing directly in windows (which you're already doing, of course :D).

Wistil said:
-Wow a 30,000 character script. That's crazy. I thought I read somewhere that there was a 14,000 character limit, oh well. I'm still working on that right now. It'll open the script from WTF story now but it won't allow any additional characters to be added. I need to figure out why.
But why do you even need a limit? Just use a std::string. Or if for some reason you don't want to (I notice you're not using the standard library at all) you can seek to the end of the file, check the file position, and allocate that much memory.
 
Jul 9, 2009 at 12:39 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
With all the graphic problems some people are having with CE I've gone ahead and, with a little prodding from Boots, uploaded the CE script editor as a standalone program (first post). That way those who do not like the editor or those that can't get the editor to work can still use the script portion for their mods.

Celtic Minstrel said:
I recommend wxWidgets – it seems fairly simple to use. Then again, converting your current code to use it would probably be a lot of work...
Thanks for the suggestion. I'll check it out but you're right it would be a lot of work.

Celtic Minstrel said:
I think OpenGL wouldn't be such a good choice for the graphics, actually, since it's more for 3D stuff. SDL is good for 2D stuff, but for this I think it's better to use widget toolkits that support drawing directly in windows (which you're already doing, of course :D).
True OpenGL is way more than is needed for this since it's basically just bitmap stretching and masking but I want to learn it anyways. Plus the current method used doesn't seem to work properly for all people. I haven't heard of SDL before but again this would require a lot of rework of code to use.

Celtic Minstrel said:
But why do you even need a limit? Just use a std::string. Or if for some reason you don't want to (I notice you're not using the standard library at all) you can seek to the end of the file, check the file position, and allocate that much memory.
The limit I was referring to is actually built into Cave Story itself. Of course, dynamically allocating the appropriate memory would be easy but why allow scripts of any size when Cave Story won't read them correctly? Currently I've just adjusted the script buffer size in Cave Story up to 500,000 characters but dynamically changing this would be far more complicated than it would be worth for the scope of this editor.
 
Jul 9, 2009 at 1:04 AM
andwhyisit Online
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6212
Age: 38
Considering that this is now v0.95.6.3 (0.95f3) I am wondering... when will you hit v0.96? :D
 
Jul 9, 2009 at 1:10 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
As soon as the sprite hit and display boxes appear in the map editor. :D

I guess I could have upped it to v0.96 with the addition of hot keys... I just don't want to hit v1.0 before it does everything I plan on making it do.
 
Jul 9, 2009 at 1:35 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Wistil said:
I haven't heard of SDL before but again this would require a lot of rework of code to use.
SDL is a lot more low-level, probably even compared to the Windows native interface (whatever that is). I've used both SDL and Quickdraw (a Mac native interface) for drawing, and SDL provides less operations – in fact, it only provides a straight blit, with neither scaling nor cropping (though it wouldn't be difficult to crop simply by adjusting rectangles). Quickdraw on the other hand scales automatically and provides a host of ways of combining two images. This could still be done with the SDL, though, because it allows you to directly access the pixels of an image.

Using SDL is portable, but this program is inherently non-portable anyway so I don't know if there'd be an advantage to using it.
 
Jul 9, 2009 at 4:25 AM
Cold Agony of Resolute Vacuum
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jan 1, 2008
Location: Elsewhere
Posts: 1973
Wistil said:
With all the graphic problems some people are having with CE I've gone ahead and, with a little prodding from Boots, uploaded the CE script editor as a standalone program (first post). That way those who do not like the editor or those that can't get the editor to work can still use the script portion for their mods.

*Puts away his cattle prod*
OSM.
*Downloads*

Best of ruck figuring out the reasoning behind the lack of graphics. I'll keep poking around my comp for whatever I can find.

EDIT: I'm sorry. You have just exceeded my awesome quota for the year. Please standby for epic huggery.
...
...
...
*Epic huggery*
Epic huggery complete.
Commence head explode...
...
...
...
*Head explodes*
 
Jul 9, 2009 at 8:58 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
hey wistil, do you have the offset for the map max? you might wanna change that too.
 
Jul 10, 2009 at 12:05 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Maybe even set it to the total number of maps.
 
Jul 10, 2009 at 1:50 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
Nope sorry there's no silver bullet for setting the total map number. This might help explain what Cave Story does when loading a map:

Say you you want to load map X (Quote just walked through a door)

Cave Story will load the map info data from inside the exe at position X like it would any array of data.
mapInfo[X]
If X is beyond the last entry in the array Cave Story doesn't care. It'll load what ever data is there (probably an ORG) and force it into the map info format. When it tries to load the map data from the <insert junk name here>.pxa, .pxe, .pxm, etc. it crashes.

Even though I make additional room in the exe as new maps are created you can still reference a map beyond that and cause a crash. Cave Story simply has no out of bounds checks.

I just uploaded a revised CE, version 0.96 (there you go andwhyisit). I fixed something that occurred to me when map reordering was suggested. Previously if you deleted a map it shifted all the others maps to fill in the gap. That would break a lot of scripts so now I use the same method as SW there. CE is still not compatible with SW however.
 
Jul 10, 2009 at 6:47 AM
andwhyisit Online
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6212
Age: 38
Wistil said:
I just uploaded a revised CE, version 0.96 (there you go andwhyisit).
Yay! :)
 
Jul 10, 2009 at 1:02 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
Nope sorry there's no silver bullet for setting the total map number
actually, there is. at 414b23, the engine pushes some free space onto the stack, and for some reason unbenknownst to me (I haven't really looked into it much), each map only takes up one bit of space, but if you overflow this boundary (have more then 108 maps) it starts writing into the other code. changing 414b23 to a number higher or lower then 80 changes tha amount of maps you can use. I've tested it.
 
Jul 11, 2009 at 12:42 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
actually, there is. at 414b23

Well I stand corrected. I guess I should be updating that number on map additions then.
Apparently I've missed a lot in my year and a half hiatus from the modding forums.

Lace, I bow to your Cave Story skills. You are far more knowledgeable about the inner workings of Cave Story than I.

It's strange though, I looked at the code segment and can't for the life of me figure out why that's even needed for the maps to work properly. Very curious...
 
Jul 12, 2009 at 5:33 AM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
OK update time.

I found the title screen map and event offsets so you can now change the title screen map and events if you so chose. Also, I noticed CE didn't have the ability to adjust the start location or map for the game either so I've added that.

Also, I think I figured out why the map size is referenced at 0x414b23. I believe this is where the map flags are kept. Its the only thing that makes sense to be only 1 byte in size per map and it would have the ability to crash the game if there were more maps than space for map flags. Either way I'm now updating this number on changes in the total map count.

New links in the first post.
 
Jul 12, 2009 at 5:57 AM
Banned
"Bleep, Bloop, Bleep, Bloop"
Join Date: Mar 1, 2009
Location:
Posts: 1586
Age: 28
CE freezes whenever I try to edit script in Grasstown...
 
Jul 12, 2009 at 1:55 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
@Fire
Is the script you're trying to open a modified one?
Did it open fine before?
Are other scripts opening fine?
If its not the original, can you send me a copy to test?

I can't really tell what the problem is from your post.
 
Jul 12, 2009 at 3:07 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
Oops, looks like a swapped the X and Y values around for the start location...

I've uploaded a fixed zip file.
 
Jul 12, 2009 at 6:52 PM
The Bucket Fairy
"..."
Join Date: Jul 8, 2009
Location: Genesis City, Nowhere
Posts: 374
Maps can be resized bigger but not smaller
p19858-0-chinfish.gif

Why is that?
 
Jul 12, 2009 at 7:11 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 4, 2006
Location: Florida
Posts: 115
Age: 44
What?

*checks to see if maps and be resized to be smaller*

um... It seems to work just fine. What's the old size and new size you're changing it to?
 
Jul 12, 2009 at 7:18 PM
The Bucket Fairy
"..."
Join Date: Jul 8, 2009
Location: Genesis City, Nowhere
Posts: 374
The map was First Cave, 60x45, and I was trying to resize the Y axis to 20.
It just didn't resize.
Also attempting to add a new map causes it to complain about the map not existing
p19858-0-chinfish.gif
 
Top