CaveEditor again (beta, maybe alpha)

Discussion in 'Modding Discussion' started by Wistil, Nov 11, 2007.

Old topic!
The last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.
  1. Nov 11, 2007
    Wistil
    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: 35
    CaveEditor again (beta) Zombied

    Well it took forever and a day but I finally have coded and Cave Story editor.

    It’s still in early, early beta (no adding maps or changing start event, starting health, etc.) It’s been quite an experience writing this thing with many bumps along the way. I eventually plan on releasing the code to this thing but first I’d like to clean up a few procedures and add come comments and hopefully everything its missing that’s no editor worth its salt is without (namely adding maps).

    There’s currently no real documentation for anything. A couple of notes to help those who dare try using this: double clicking on various lists will generally do something useful (open a map, edit a script, etc.) also I’ve added a few context menus in various places (right clicky) and gratuitous use of the mouse wheel.

    So with out any further delay here’s the link. It should work as is and I think I included all external files I referenced.

    Let me know what you think.

    PS - For those of you who don’t know who I am, I appeared on the boards about a year ago back in 2006 claiming this and then lurked on and off for a long time. Now I'm back from a very long hiatus and plan to be around for a while.

    The Editor (v0.99c)
    The Source Code
    Feel free to mess with the code and use it as you see fit so long as I'm credited in some way.
    ATTN: Currently there is an issue where the editor will kill npc.tbl. Please use an older version of CE for NPC.tbl editing. - Noxid
    LINK TO AN OLDER VERSION OF CE
    This is v0.99d; It should work too.


    Script Editor Standalone

    Edit (2007-11-12): Just updated the zip file to fix a few of the cosmetic issues Xaser brought up.
    Edit (2007-11-13): Added shift map and entity add, delete, and paste (select and entity first to delete or paste). Available through right click on map.
    Edit (2007-11-15): Added an options screen, changed tile type graphics, auto detect .pbm/.bmp extension in exe, better syntax detection in TSC editor plus some other minor bug fixes.

    Edit (2007-11-17):
    • Cleaned up the TSC editor.
    • Added Syntax check button to TSC editor. Syntax check should be complete now and it does save files now.
    • Cleaned up the Map editor window.
    • Fixed errors with Tileset editor.
    • Added various error messages when things don't work (like saving) to hopefully let you know why.
    • Changed the name back to CaveEditor (Too much nostalgia for it since its was named that for over a year)
    • Cleaned up Options window some (still needs some work)
    Edit (2007-11-25):
    • Cleaned up some of the code a bit.
    • Add map, delete map, and copy map now work!
    • Now reads Sue's Workshop file format
    • Sue's Workshop cannot read this CE file format. The format had to be changed to allow for resource importing without exe corruption on re-edit.
    Edit (2007-11-26): Pbm editor now supports 24-bit images. Also fixed the [Save and Test] menu item.

    Edit (2007-12-02): Added game settings window:
    • Can now edit starting health, facing, and starting script event
    • Can now change the "(C)Pixel" image data or remove it completely
    • Save game file name, pbm extension, and game window title are now editable
    • Fixed a major bug in script editing where tsc would be corrupted if file size decreased
    Edit (2009-06-28): Please forgive the 1.5 year gap...
    • Fixed background behavior bug causing changes to not appear in game
    • Added basic weapon stat modification but not weapon behavior
    • Fixed various NPC.tbl edit bugs (hurt sound, death sound, death animation, tile set)
    • Fixed crash caused when an entity type greater than 360 is typed into the map editor
    Edit (2009-06-29):
    • Fixed the random crash on save in the script editor
    • Fixed the 14,000 character limit in the script editor (the limit is now 500,000)
    • Fixed crash on editing a 24-bit color tileset
    Edit (2009-07-05): Added hotkeys to map editor

    Edit (2009-07-09):
    • Added support for reordering maps
    • Reworked Map add and delete code
    Edit (2009-07-11):
    • Added ability to adjust start location and map (Game Settings and Map Editor Windows)
    • Added ability to adjust the pre-title screen map and event (Game Settings Windows)
    • Total number of maps allowed is now more than 128
    Edit (2009-07-12):
    • Some code clean up
    • Minor misc bug fixes
    • You can now prevent CE from changing the read only attribute of files it saves in Options (this may resolve the issue with freezes in Vista on saving)
    • Changed the entity type selection to a dropdown making it easier to find what you're looking for
    • Fixed entity delete bug where selected entity wasn't the one deleted
    Edit (2009-07-14):
    • Fixed Script Editor minimize error
    • Fixed Add Map to a ***No Map*** error
    • Added ability to adjust the color depth used by CE until I find a way to detect it automatically
    Edit (2009-07-24):
    • Added Replace and Rectangle tool to map editor
    • Various code cleanup within Add/Delete Map functions
    • Fixed tile type display problem (I had switched the reference file to CE_Tiles.bmp a few updates back.
    Edit (2009-07-27):
    • CE now detects the color depth of your screen on startup
    • You can now display the NPC sprites in the map editor!
    • Partially fixed tile type display for non-32bit color depths
    • Fixed mouse icon changes in map editor
    Edit (2009-08-08):
    • Fixed tile set type selector error
    • Added ability to turn on Entity Description
    • Fixed some entity sprite sheet references
    • The map editor no longer steals focus from everything
    • Changes to map name now changes filenames as well
    Edit (2009-07-18): Added undo and redo commands to map editor

    Edit (2010-02-06):
    • Added sorting ability to the entity list in the map editor
    • Sprites now update whenever their type is updated
    • A Delete all Entities button has been added
    • Sprites are now visible in the npc.tbl editor to the best of my ability
    Edit (2010-10-01): (Just missed posting before the forum move)
    • Various bug fixes
    • Fixed major bug with script editor
    • Re-haul of config files. Nearly everything is configurable now in a single master file.
    Edit (2010-10-05):
    • Various bug fixes
    • CE now checks exe directory for config before the CE directory so you can use different configs for each project and only 1 copy of CE.
    • Extra script info now displayed for TSC commands in script.
    Edit (2010-10-17):
    • Ctrl+S now saves in Script editor
    • You can now import/export map exe info to a separate file (helps somewhat in copying maps form one exe to another)
    • Added ability to copy/paste map tiles.
     
  2. Nov 12, 2007
    Xaser
    Senior Member
    "Huzzah!"
    Join Date: Jun 1, 2007
    Location: In Space
    Posts: 191
    Whoa. I like this. In fact, I think you may be giving Sue's Workshop a run for its money. :D

    So, I haven't had the chance to test it too thoroughly just yet. There's a few things I need to look for, and I haven't actually had the chance to edit anything with it just yet (for reasons described below, it doesn't work on my mod yet). While it is still missina a few features, for a beta this is *very* well-done and polished, hehe. (on a seperate note, can you add entities just yet?)

    So, just after a quick runthrough, I'll point out a few things that impressed me:

    -Zoom in/out! It helps like crazy when managing really big maps. :D
    -TSC script highlighting! Thank goodness, I can make sense out of my own scripts now! :D
    -Foreground/Background tile display toggles... as well as the tile type overlay. *very* useful for those hard-to-reach secret areas that use identical-looking-yet-passable tiles. :D


    Although it's still an early beta, here's a few random suggestions for us weirdos out here (really small ones at the moment) with some bug reports thrown in here and there:

    -Not every mod uses Doukutsu.exe as a filename. I had to type Schism.exe in manually to load my mod, though that worked just fine in that aspect. :p

    -For ease of use and simplicity (ie. Paint Shop Pro assumes anything with extension .pbm is not a standard bitmap and I can't convince it otherwise), I've hacked my mod's .exe to use the .bmp extension instead. Would you mind adding a quick and painless option (or perhaps check the .exe itself on loading) to use the .bmp extension instead, for those mods that use it? I'm sure I'm not the only one out there who does it like this, and I'm thinking it wouldn't take long to implement. I hope. :p

    -Some values such as level name, background, etc. (I *think* those are the right ones* are stored in the game executable itself, as you most certainly know. However, Sue's Workshop assumes these values start in the same place, so when I change the game's music (stored in the .exe itself) and use Sue's to edit it again, it assumes the level data is in the same place as usual (which it's not, since the music changes the .exe's filesize) and all of a sudden... *WHAM*, corruption. It's a huge pain to not be able to edit maps after adding the music, so I'm stuck listening to the original tunes in the wrong places. What I'm getting to is, is there any way your editor could perhaps search for where these data values start, so things won't get overwritten? Kind of a long explanation for a minor thing, and for all I know your editor might already do this (Can't test on mine since I use .bmp extensions), but hey, why not ask? ;P

    -A system similar to Sue's "npc.ini" would be very useful for us modders -- a way to re-name and re-arrange entities to fit our mod. Otherwise, It's tough to remember that "Jack" stands for "Travis" in my mod, and even harder to remember that both "Booster" and "Doctor" correspond to the same character. Again, a cosmetic-ish thing, but it would be very user-friendly.

    -Perhaps some extended editing functions? Copy+Paste for both tiles and entities would make things muuuch easier (especially between maps), and would an undo function be out of the question? I've got an unsteady hand, and deleting important entities sucks, especially when one forgets what they were for. XD

    -Minor, but I noticed no "Shift map" function like Sue's Workshop has. That one might be useful later for those of us who overshoot dimensions and need to scroll the map a bit to the left. :p

    [Bugs and Glitches and Typos and Stuff plus Things and Junk:]

    -When you open a map, that window is always shown on top of the initial window. I really like how everything's in its own little window, but I can see a bit of irritation in the future if the main menu is always obscured. :p

    -"You you want to save your changes?" Hehe... made me laugh the first time I I saw it. :p

    -Selecting "Edit Tileset" or "Edit Spriteset" without first selecting a tileset in the above list will crash the program. "Edit Background" doesn't seem to work at all, though it's no big loss at the moment. :p

    And a few suggestions for the TSC command descriptions:
     
  3. Nov 12, 2007
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 5628
    Age: 29
    Definitely not an alpha.

    http://www.cavestory.org/forums/threads/172/
     
  4. Nov 12, 2007
    Wistil
    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: 35
    Wow, thanks a lot. I must say, that’s a lot of info I need to absorb. Many of those bug you found would have been there for ever. I never really read my own popup messages.

    Hehe I had to check again but no not yet. I need to add that, probably through context menu. Along with copy and paste with [Ctrl]+C and [Ctrl]+V

    Good point. I’ll add that one right away. *.exe.

    Another good point. I didn’t even think of this one. I’ll have to do a little digging to make sure I read that info out of the exe correctly.

    I’ve actually already thought of this one. :D Right now I’m just reading the number of maps and the data location from hard-coded values. Eventually I plan on changing this so that the editor actually adds another data block for the map data (listed in the exe header) which the program will read to see where and how many maps there are. This is probably the most important thing to implement but also the hardest to do right.

    Actually I sort of stole that from Sue Workshop. I think I even called it npc.ini. By using the [Edit NPC Table] button you can change all table data on the entity plus that extra data that gets displayed on the maps.

    Undo is probably the last thing I’ll implement. Second to last will be copy and paste. You have to store SO much data for undo it’s crazy. It was hard enough just getting that stupid Save message to only appear is you changed something.

    This should be easy. With all the extra commands I need for maps I’ll probably be adding a standard menu.

    This one’s a mystery to me. Believe it or not this is my first graphic intensive (yeah that’s right graphic intensive) program I’ve written. Also the first with multiple windows. Right now I’m not sure what I’m doing wrong that lets you select the main window but keep the map window on top. I gave up trying to figure that out months ago.

    I’ll I’ll fix it! Like I said I never read those stupid popups :p

    Oops. I got this on the maps but not here…

     
  5. Nov 12, 2007
    Xaser
    Senior Member
    "Huzzah!"
    Join Date: Jun 1, 2007
    Location: In Space
    Posts: 191
    Yowza! *headslap*, I never even noticed... and it edits npc.tbl too, I see. Hehe, now *that's* a great feature, I see! Woohoo!

    So, it looks like this neat little gem will grow into one heck of an editor. Thanks for reading my silly little suggestions and responding and the like. I'm looking forward to seeing how this all turns out!
     
  6. Nov 12, 2007
    Atravir
    Guy with Sword
    Bobomb says: "I need a hug!"
    Join Date: Jul 1, 2007
    Location: Middle of Texas
    Posts: 777
    Age: 23
    I must admit, that is awesome. Kudos to you. I can't wait for the real thing. :D
     
  7. Nov 12, 2007
    S. P. Gardebiter
    Ex-Admin
    "Life begins and ends with Nu."
    Join Date: Dec 30, 2005
    Location: Germany
    Posts: 3202
    OMG please let me help you with this, I have alot of offsets... NO! Actually I have a shitload of offsets... PM me or something, mail me, add me in your ICQ, MSN, AIM, whatever :D I'm just better to explain it directly to you rather than just posting it here.

    Edit: This is so fucking awesome, that you enable NPC.TBL support, I could kiss ya!

    Edit edit:

    I've made some FAQ's:

    For Tileset.ini check this: http://spgardebiter.sp.funpic.de/CaveStory/FAQ/OptionTB.txt

    For editing titlescreen colours e.t.c. check this:
    http://spgardebiter.sp.funpic.de/CaveStory/FAQ/OptionC.txt

    I have some info from posts here about Sound editing:
    http://spgardebiter.sp.funpic.de/CaveStory/FAQ/SoundHacking.txt

    As well as hints for simple weapon editing:
    http://spgardebiter.sp.funpic.de/CaveStory/FAQ/Weapon Edit.txt

    And advanced NPC editing:
    http://spgardebiter.sp.funpic.de/CaveStory/FAQ/Advanced NPC.txt

    Most recent TSC:
    http://spgardebiter.sp.funpic.de/CaveStory/FAQ/TSC.txt

    Edit Edit Edit: It should be able to convert palette sizes to 2 colour as well as 16 and 256 colours. Also it should could have "no palette" support that means full 16 million colour bitmaps.

    And I get some crashes "TODO: causes a Problem" :p
    It's when I click on the edit button of npc or tilesets edit but I haven't selected one before.

    Edit Edit Edit Edit: Maybe you could build in Drag&Drop TSC support something simular like this (But well, a bit easier looking perhaps):

    [​IMG]

    You know, select the icon on the right side and drop it in the left one.

    It was already planned in Sue's Workshop that's why I have already made some Icons.

    Link: http://filespace.org/ShInInG_PhAnToM/Drag_Drop.ZIP

    And it needs a zoom function, for maps and really for editing images!

    Also import music would be nice.
     
  8. Nov 12, 2007
    xristosx
    Starbound
    "Life begins and ends with Nu."
    Join Date: Jan 7, 2007
    Location:
    Posts: 2586
    Age: 25
    sounds great cant wait till its fully functional XD
     
  9. Nov 12, 2007
    X-Calibar
    gigantic immortal cat
    "Man, if only I had an apple..."
    Join Date: Apr 18, 2006
    Location: Forever wandering the tower...!
    Posts: 1478
    Can't wait...

    bookmarked to favorites!! Glad to see you've stuck with it! and I mean the extremely happy kind of glad. :D

    Will be checking back often~
     
  10. Nov 12, 2007
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 5628
    Age: 29
    "SP is excited" would be an understatement. :D

    EDIT: 1001 posts! (I missed my 1000th post)
     
  11. Nov 12, 2007
    Metalogz
    WTFhappenedTOthef0rum5..?
    "Bleep, Bloop, Bleep, Bloop"
    Join Date: Oct 6, 2007
    Location: Insert location here
    Posts: 1576
    Age: 20
    OMFG AWESOME!!! I LOVE YOU :D:D:D (would putmore smilies but 3's the limit =S)

    But... I feel you should include instructions on how to use the different functions... I don't understand how to use the NpcTable editor and I don't even know what its for =/

    Pleasee :p
     
  12. Nov 12, 2007
    Wistil
    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: 35
    Thanks again for all the feedback guys.

    Xaser - I just fix a few of those cosmetic issues you mentioned this morning.

    S. P. Gardebiter - Wow. That's a lot of data you added recently. I'll have to read through it all. I do like the icon idea for the TSC as well as drag and drop support. Right now though I have to go to work unfortunately. I should be available later today to discuss things however.
     
  13. Nov 12, 2007
    S. P. Gardebiter
    Ex-Admin
    "Life begins and ends with Nu."
    Join Date: Dec 30, 2005
    Location: Germany
    Posts: 3202
    The icons are acutally for the drag and drop :D They are small pictures who are next to the numbers/TSC function names.

    There are much things I want to tell you, just tell me when you're ready.

    Edit: Testing tilesets doesn't work in npc.tbl hacking window.
     
  14. Nov 12, 2007
    Wistil
    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: 35
    The displaying NPC idea I had was novel but it will be a while before that happens.

    The two things I wanted most in an editor were a better TSC editor and the ability to display NPC graphics on maps and the like but it looks like the NPC data is hard coded into the exe with no standard format so it will be much longer than I thought to get that working.

    I'll disable that dropdown next build so people aren't confused.
     
  15. Nov 12, 2007
    andwhyisit
    Administrator
    "Life begins and ends with Nu."
    Join Date: Jul 15, 2007
    Location: Australia
    Posts: 5628
    Age: 29
    4 is the limit actually, use this:
    [​IMG]
    it's one big image.
     
  16. Nov 13, 2007
    Wistil
    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: 35
    New minor update. See first post for details and link.
    Also updated profile a little.

    Just a warning, I probably won't get anything more done until Thurday or Friday due to stuff and things.
     
  17. Nov 14, 2007
    jcys810
    Justin-chan
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Oct 15, 2007
    Location: Nowhere
    Posts: 1921
    Age: 21
    I can't edit maps. Everytime I double-click on a map, the program closes.
     
  18. Nov 14, 2007
    S. P. Gardebiter
    Ex-Admin
    "Life begins and ends with Nu."
    Join Date: Dec 30, 2005
    Location: Germany
    Posts: 3202
    Just for the info: I added you in my ICQ Wistil (AIM and ICQ are compatible) my nick will be displayed as my ICQ number I guess: 333426564. But my real nick is 'S. P. Gardebiter', you can rename me there if you like. Good that you have AIM. (Actually I forgot the password for my AIM :/)

    Oh and, you didn't answered there :D
     
  19. Nov 14, 2007
    jcys810
    Justin-chan
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Oct 15, 2007
    Location: Nowhere
    Posts: 1921
    Age: 21
    This isn't happening to anyone else except me is it?
     
  20. Nov 14, 2007
    Wistil
    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: 35
    hmmm... That's odd.
    Are you using a copy of Cave Story that's been modifed with Sue's Workshop? I haven't made any checks yet to see if the maps have been moved in the exe so if they have you'll get errors opening maps.

    S.P. - I'm not a fan of AIM myself but I've forgotten my ICQ#... It's been so long since I used it. Not since playing Total Annihilation (an RTS).

    Edit: By the way, has anyone here done mult-window program programming before? I'm taking a look and the map edit window always on top problem and I've sort of fixed it but now the Script edit window is always on top of the map edit window when both are open. :D