This is something I should have made a long time ago. You know, back when I still made caves and it'd actually be useful to me. Anyway, I posted the link a little below, and I'd appreciate it if you all'd download it, play around with it, and tell me what you think. I don't want you guys to mention any potential new features just yet, I just want to know if you can find any bugs, or anything that doesn't function in the way that you would perhaps expect it to.
Due to a forum bug, you'll probably have to copy that and paste it into your address bar.
To run that, you'll first have to extract that all into the same folder. If you can't extract zip files, download WinRAR: http://www.win-rar.com/download.html
You'll also need to make sure you have the latest version of Java: http://www.java.com
Inside, there's a file named cavemaker.bat, which you will double-click on the run the program. A cmd window will pop up and hang around with you the whole time as you use the cavemaker. Close it, and you close the cavemaker with it, so, just ignore it for now. If it comes up and then just goes away, then you (probably) have not, either, followed these steps properly, or you do not have the latest version of java on your computer. I'm working on a way to make it stand-alone, but for now this will suffice. Also, you can make a short-cut of the .bat file (right-click create shortcut, probably) and then you can paste that into wherever you'd like to be able to open the cavemaker from. Also note that, since this was coded in java, it should be able to run on systems other than Windows. I haven't seen fungus in a while, but if you see him, direct him here so I can get that straightened out. We might have to jump through a few hoops, but it should be able to run on his mac. Update: The cavemaker program is now in a jar file. You should be able to run it by double clicking but, if not, set java as the default program from opening jar files. The .bat is still there if needed.
I'm going to attempt to list some of the changes that I've made from the Neopets version. Here's what I could think of, in no particular order:
Spoiler:''List of Changes from the Neopets Version''
1 - You may open multiple caves at the same time within the same cavemaker window. This was done mainly done to help with copy/pasting between two caves, which, in the old cavemaker, was an absolute pain. I haven't done anything to prevent you from opening infinite windows just yet, and doing so will likely crash the program before too long. I did a test, and under the worst possible situation (1x8000 caves using all of their undo stack -- more on that in a sec), 10 open caves would function properly, but when you tried doing it to an 11th, boom! it explodes in an out-of-memory-error for the ages. Under normal situations, you will likely not see this occur (and if it does, let me know).
2 - The level properties were moved into their own separate window in the file menu. I mainly did this because, honestly, how often do you change the title, terrain, and water types? Like, once a cave, usually, right? It was just taking up space that could have been used to give you a larger grid. (BTW, I know the window is ugly.) I also moved width and height to this window. Width and Height get changed more often, and I hope people aren't too upset about this change. Ctrl+L brings up the level properties, if you need a shortcut.
3 - On the subject of changing dimensions, you can now make caves with dimensions larger than 1000. I didn't want to limit the size of a cave that you could make. Unfortunately, having an 8000x8000 grid is an insta-crash. So, I've made it so that, if you try to make a grid with more than 8000 tiles, it just won't go through. I can't see this being a problem, since 8000 tiles is bigger than you can upload anyway. Also as a consequence of this change, something likely less welcome -- stuff that you cut out of the cave in a dimension change will not be saved, and subsequently enlarging the cave will reveal only emptiness where cave used to be. It was necessary in order to allow very tall or skinny caves to be made. Also unfortunate, there's no easy way to change the dimensions to a specific size to combat the usual dimension changing guess-work, so I've both added a tooltip (where you hover your mouse for a bit and text shows up) showing the mouse's position in the grid (it goes row, column, and is zero-based, so add 1 to get the smallest width/height that will still include a certain tile), and I've made dimension changes undo-able. That paragraph verged on babble, so I hope you caught the gist of it.
4 - You can no longer set the background type. YAY!
5 - Multi-undo. You can now undo up to thirty times! I'd allow, say, infinite undo, but then, even under fairly normal conditions, you could crash the program in around 2500 edits (which isn't unreasonable for an 8000-tile cave).
6 - Support for Select All (ctrl-a), has been added.
7 - Save As!
8 - If you have modified the cave, you will be asked if you wish to save before closing!
9 - Water flow has been removed. Tutorial arrows' pictures have been fixed, and the code for water tap crates and water crates has been straightened out.
10 - New Tiles, clone and shockwave error, have been added. I'd suggest not using the latter particularly often, lol.
11 - You can now put multiple gems, hearts, and doors, and they will upload properly. You can also, however, put multiple water levels (still) and starting positions. I plan on making changes to this system later (noticed the greyed-out "options" menu?), but I've yet to decide what to do. How many settings should there be? Allow multiple gems/hearts/doors/water levels/starting positions, allow multiple gems/hearts/doors, allow multiple gems/hearts, and disallow multiples? Those could all have their uses, but I'd rather not make all of them. Maybe a separate "allow multiple" option for each tile would be best? Anyway, remember that, if you change the starting position, you have to go back and remove the old one.
12 - A border of terrain is not added by the view-text window. This is planned to be part of the options menu as well. There's a lot of things like this that are definitely things I'd like to include in the future, but put on hold until after I released it with at least the core-features intact.
13 - Not really a change, but I've yet to code allowing for caves that are too small or lack doors and starting positions. If you try to load such caves you will be told that the cavemaker doesn't yet support "ragged" caves (caves with different amounts of text on each line). Also, if you load a cave that has lines that are of different lengths, it will not be loaded. I'll also mention that I haven't added any checking to ensure that your cave will be accepted by the uploader, but I may add this in the future.
14 - There may also be some other, more subtle changes to the way that the interface works, that I hope you'll be able to get used to. If you can't, I may consider fixing them, but for now I think they're live-withable. For example, in the Neopet's cavemaker, pressing arrows keys will move you away from the anchor point, but in mine, you move from the lead (where you last ended your selection). Lots of "little" things like that.
15 - Stalagmite is now spelled correctly! WAHOO!
So yeah, try it out, and if there's anything that gets on your nerves, let me know I'll try making changes to it. I'll work on adding new features at an unspecified point in the future. For now, I'd like to ensure that this is working properly and there's nothing about it that people just hate to death.
Spoiler:''Changes in Update 1''
- Changing dimensions would cause the grid to disappear until you move the frame.
- Saving a cave would not flag the cave as saved or modified. Meaning, if you tried to close the cave just after saving, it'd tell you it was modified when it wasn't, and, clicking save (not save as), after already saving the file, would one again bring up a save dialog.
- Clicking the x on an internal frame after modifying a cave, clicking cancel when asked to save, and then closing all windows (or the whole cavemaker, which closes all windows) would cause only one internal frame to be closed.
- Opening the level properties window and clicking OK after not changing any properties will no longer flag the cave as modified.
Spoiler:''Changes in Update 2''
- After opening a level, subsequently undoing the very first edit no longer causes to default cave to appear, rather than the cave you loaded.
- The background behind the internal frames was darkened at acce's request.
- Loading/Saving caves was not properly closing the file stream, meaning you wouldn't be able to edit/delete the file that you loaded/saved until closing the cavemaker.
- Caves with a width of 0 could be loaded, even though the level properties window does not permit this. I disallowed it, but size 0 caves don't seem to crash... I may reallow it. The real bug was loading large caves, which was also still allowed. Yeah, I forgot the check the dimensions. You could probably cause an out of memory error pretty quick with this.
- The file chooser now asks you to confirm before saving over an existing file.
- You can no longer use enter to set tiles . There may be an alternative way of doing this soon.
- You can now choose whether or not to allow yourself to set multiple copies of gems, hearts, starting positions, doors, and water levels. Multiple Gems and Hearts are allowed by default, and, also unlike in the original cavemaker, having multiple water levels is disabled by default. Multiple doors does have it's purposes (I used it in Cherries Rock!, if you look closely), but it's disabled by default. Starting positions were included just because everything else needed to be.
- You can now choose to add a border around your cave when viewing the text. This and all other text-formatting options are not saved into the text file. To upload them, you'll have to view it through the cavemaker. Enabled by default.
- You can now choose to append additional text to the bottom of caves that would be too small to upload normally. I might not have the minimum set right just yet (I have to look it up in the manual, lol -- Acce, are you SURE you got the minimum and maximum right?), but it seems to be working. Enabled by default.
- You can now choose to append Doors and/or Starting Positions to the bottom of caves that do not contain them in order to get past the uploader. Enabled by default. This and other options do not save and will need to be reset upon each load of the cavemaker. I will likely change this in the future.
- The loader now ignores lines that aren't the same length as the first. If you save after loading a cave like this, those lines will be lost. The only purpose of lines of different lengths is to get caves past the uploader that the new options now account for.
- Black background behind some tiles has been removed. You can now tell the platforms apart! Well, unless they're in the black grid, in which case, you'll have to highlight to see.
- The previous function of enter has been moved to insert (or shift insert, if you prefer).
- Forgot/didn't know to remove JTable's default function for SHIFT+ENTER.
Spoiler:''Changes in Update 3''
- You can now press alt+character to set any tile except for empty tiles. Alt+Space conflicts with a combination used by all windows. It's not too bad, 'cause you can already use backspace or delete, and other of those are easier than alt+space. I also had to take away mnemonics for the menus, since, say, Alt+W would bring up the window menu instead of setting a spike.
- Fixed major bug with undo/redo where it wouldn't work if the width was smaller than the height.
- Pressing Enter from anywhere in the level properties window now acts the same as pressing the OK button.
Spoiler:''Changes in Update 4''
- The cavemaker now saves the directory where you last opened/saved a cave. Next time you open the cavemaker, open and save will default to the location.
- The cavemaker also saves the file paths of every open cave with an associated file path. Next time you open the cavemaker, the cavemaker will attempt to open all of these cave.
- Options can now be set individually for each cave. Currently, openning a new cave gives you the default options, and there is still no way to change what these defaults are.
- The options are now saved along with the file paths to the open caves. This means that, as long as you don't close the cave's window inside the cavemaker, the options will be retained for as long as needed.
- I have added tooltips to the tile select bar that tell you the key-combination that would result in those tiles being set.
- I have expanded the memory afforded to my program, and I'm now allowing 10 open caves with 100 undos. Let me know if your computer has problems handling this amount of memory.
- I added a new feature called "Load From Username". If you're connected to the internet, you just type in a username, and the level currently uploaded to that account is loaded directly into the cavemaker. Neat! You'll wonder how you ever lived without it.
- In a similar vein, "Load From Gallery". Type in the gallery ID number (check the end of the URL when viewing the cave in the gallery) to have the cave, once again, loaded directly into the cavemaker. WOAH!
- Fixed a minor bug that would prevent strange, but still valid, water/terrain/background types from being accepted.
- The scroller should stay in place now, when undoing and changing dimensions. Let me know if anything weird happens with the scroller, particularly when making the dimensions smaller while viewing the farther reaches of the cave.
Spoiler:''Changes in Update 5''
- Fixed a bug where pasting between different terrain types were messing up.
- Fixed a bug where caves opened automatically when loading the cavemaker weren't having their frames initially focused. This also fixed bugs (but I fixed it another way too, so it can't happen again) where you could do strange things with the options before bringing a frame into focus.
- The code is now included, so you can take a look at it and barf at its disgusting.
Spoiler:''Changes in Update 6''
- Fixed a bug where saving using a save-as dialog wouldn't probably set the current directory for the next time that you loaded the cavemaker and used a load/save dialog.
- Fixed a bug where the program wouldn't load on anything but pretty-much Windows.
- Fixed a bug where, even with its "allow multiple" unchecked, you could set multiples by setting a rectangle's-worth of them instead of just a single tile.
- Livio just made a bunch of changes to the level galleries, and as such, the "load from gallery" option is now broken. This has been fixed, and as well, it has been renamed to "load from user-level database", with the mnemonic changed from "g" to "d".
- When you save a cave, the title of the cave, plus ".txt" is now defaulted into the box, as long as the cave hasn't been saved already. I mainly did this so that, when I add "Save All", you'll know (or at least have a better chance of knowing -- hopefully you don't have a bunch of open caves with the same name) what cave you are saving?
- Apparently, clicking the x on the dialog that asks you if you want to save when you cave was modified, is the same as clicking no? I changed that, anyway, so now it's the same as clicking cancel. Also, clicking the x on the dialog that asks you if you want to overwrite a file in the save-as dialog, was the same a clicking yes, so I changed that to be the same as clicking no. I -thought- I'd tested this, but I guess I was wrong...
- Fixed a bug where terrain types would revert to what you originally set them as, when doing dimension changes.
- It should now no longer be possible to set disallowed multiples using copy/pasting, as it was in the original cavemaker. To get multiples, allow it in the "Allow Muliples" menu. If copy/pasting multiple disallowed multiples, the first one that's pasted, in reading order, will be the only one to remain.
- Added a Save All feature, which attempts to save all open caves. If a cave does not have a filepath, you will be presented with a save dialog.
- Because of the weird behaviour that could arise when combined with Save All, it is no longer possible to save over a file that is currently open in the cavemaker.
- Related, you may no longer open a second copy of the same file, when it is already open in the cavemaker. If you try to, you will be informed of this, and the currently-open version will be brought into focus.
- A mangled error message that occurred when opening real but non-txt files (you have to manually type in the path for this to happen) has been corrected. With all these changes to how saving works, I highly suggest exercising caution when using this update. I know I accidentally erased several files (like my back-up copy of "Trapped in the dark") while I was first testing the save all feature.
- Added an "Allow Multiple" for the ghost enemy, since at most one will ever appear in the level. Defaulted to disallowed, I guess. It is useless, but it could throw people off who don't know only one can ever appear.
- Fixed a bug where it was possible to add tiles to a cave while it was minimized.
- When redoing/undoing/changing dimensions, the currently-selected area's anchor point remains selected. When it is dimension-changed offscreen, the anchor point is moved to the position closest to where it used to be. This is also what happens in the Neopet's cavemaker. The main reason it was added was so that, after you redo/undo/change dimensions, and then if you pressed the arrow keys to move around, you don't get warped to the upper-left corner.
- The cavemaker now remembers if it was maximized the last time it was closed and sets it to continue to be maximized when opened again. I decided against going through the hassle to also remember unmaximized size, screen position, as well as all of this properties of the internal frames.
- Fixed a bug where, in the level properties window, pressing enter to select a terrain/water type is the same as pressing OK on the whole window, and not just the terrain/water type selection.
Spoiler:''Changes in Update 7''
- I completely forgot to disable/enable the save all button. It shouldn't matter too much, since, if there's no caves open (which is when it'd be disabled), there's nothing it can do anyway.
- Fixed a bug where the close all button would disable if all the open windows were minimized.
- Slightly changed the way the view text window is created. With that change, I am now able to manually set the font type, without causing any layout problems. Now, people who's textareas didn't use a mono-space font, by default, should now see the cavecode in mono-space.
- At last, the terrain type combo box displays (almost) correctly! You have no idea how long this has alluded me...
- I removed the restrictions that limited the size of the cave that you were allowed to make. Every time you attempt to load or create a cave larger than 8000 tiles (or increase the size of an already opened cave that is above that limit) you will be asked to confirm before doing so. The warning (that there could be slow performance or that you could get an out of memory error, which could result in the loss of data) is to be heeded.
- Attempted to improve the performance of the cave saving and view map as text operations. I don't think there are any problems but you might want to back up caves that you save in this version until you feel comfortable that there aren't. View map as Text is very prone to out of memory errors with larger caves and can still take a semi-long time to appear -- with especially large caves I recommend saving and opening the text file, as saving is nearly instantaneous and shouldn't crash the program.
- Fixed a couple typos with the word "Openning".
Spoiler:''Changes in Update 8''
- I'm using something called a .jar file. It should hopefully be double-click runnable but, if it's not, I've changed the .bat so that should be able to run the jar file. If it doesn't double-click run, it should be possible for you to set it up so that it does, but when I tried just setting Java as the default program for a .jar, I couldn't get it to work for some reason? Anyway, now the cmd window won't be hanging around in the background. It should double-click run on other systems too, maybe? So test that out and let me know if the .jar is giving you any problems. I moved the .java file with the code into the .jar file too just so there's less files floating around.
- I added zoom. 100%, 75%, 50%, 37.5%, and 25% options. I put zoom in and zoom out options too so you can use the keyboard shortcuts for those. I caused some memory leak or something with the images so I had to add something to manually clear those out. It was a bit buggy at first, so let me know if you get any weird problems.
- I had to change the text-based images over to a single letter so that you could still read them while zoomed out. It might take some adjusting to get used to seeing "S" instead of "secretsecretsecretsecret". The rest of the text images are single letters now too.
- I changed the way the cavemaker displays clone objects. They now appear as what they will appear as in-game, only transparent. If you highlight them they will just show up as clone objects. Maybe that might be a little weird but at least how you can easily tell what your fake crates are doing. If you place one in the top left it'll show up as a shockwave error instead.
Spoiler:''Changes in Update 9 (Current Version)''
- I'm clearly not going to make some weird hybrid pirate/ice cavemaker, so I've decided to just leave them separate, but from now on they'll at least be zipped up together. Also, I moved the images inside the .jar files so that's one less folder floating around.
- Undo/Redo now flags the cave as modified.
- The zoom level in the options menu could sometimes display an incorrect level of zoom when switching between open caves.
- The Cavemaker mistakenly believed that Air Pockets could be cloned.
- Fixed an oversight where a clone in the top-left showed a shockwave error instead of terrain if Add Terrain Border is selected.
- Fixed bug where open/save wasn't defaulting to the caves folder at first.
- The words "terrain", "water", and "background" are actually not required to be spelled correctly by the game, so I decided to allow them to load. (Quick aside, in HATPC, invalid water types can sometimes function if used in a certain way, but I've opted not to support this. It's a quick manual edit if you need it.)
- K and V are now capitalized in the cave text, to increase compatibility with Neopets' Cavemaker. The first instance of L and G will also be capitalized from now on.
- Added Ctrl+0 shortcut for 100% zoom. Added a couple minor menu shortcuts you won't notice.
- Got rid of the 20-character limit for titles. (Uploader might complain if you go for it.)
- (HATPC Only) I got rid of some outdated code that put an apostrophe for your title in if you didn't put one in yourself. That trick stopped working ages ago. It defaults to "Untitled" from now on.
- I decided to move all of the enemies to the bottom of the tile list so that, when I add tutorial messages in HATPC, all of those Shockwave Error tiles won't get in the way as much. Applied that change to HATIC for no real reason.
- (HATPC Only) Added Tutorial Message capability.
-- That ugly level properties window is even worse now that there are 10 more textboxes in it. I decided to just let you save tutorial messages even if the cave isn't a tutorial.
-- There's a box where you can set how many tutorial messages your cave has. This was my way of telling the difference between having tutorial messages with nothing in them, and tutorial messages that crash the game. Who am I to tell you that shockwave errors that pop up if you get too close isn't legitimate gameplay? The textboxes will enable and disable based on that number. Any text in disabled boxes will be cleared if you hit OK. It defaults to 10 but if your cave isn't a tutorial and you don't bother to fill in any messages, the number will be ignored and taken as 0.
-- The tile select bar and the tiles in your cave update to reflect whether or not the title contains the string "tutorial" (case insensitive) and how many tutorial messages your cave is set to have. If you have messages configured, it'll write them into the tile selector so you don't have to constantly check which message is which.
-- To add tutorial messages to cavecode, you must put a ? at the start of any line. From then on, as long as the line for the tutorial message exists, you won't get a shockwave error. For the message itself, the first string of non-whitespace characters until the next whitespace on each line is removed (similar to what is done for the words "terrain", "background", and "water"), and what's left is trimmed of whitespace to become your tutorial message.
-- I mean I had to adjust a few more things to get the messages to work properly but it's not worth listing every minor thing.
- (HATIC Only) If a ? is encountered at the start of a line when loading a cave, all remaining text is ignored.
- Changes made to tutorial messages, but also the title, terrain type, and water type now go onto the undo stack and can be undone/redone.
but according to my research, there are different character counts. remember my crazy manual equations? 0.o I hope I didn't make a horrible mistake.
I think ", a ladder, takes up two characters instead of one. I think it has to do with the coding issues. But all the regular letters and numbers should take up only 1 character.
And remember, Accel, that every new line takes up 2 extra characters.
but also remember that they don't count the first 4 lines when counting text. and I took all of that into account. maybe you should do some tests of your own
I have done tests. They conclude that there is a minimum of exactly 256 characters, a maximum of exactly 8000, x's, #'s and d's all count as 1 character, and that each new line takes up two extra characters.
"csd, could you please add the horizontal wheel scroll thing?"
Bug in Java. Can't be fixed through any conventional means. Not feasible.
"and I still want to press Enter in the level props window."
I'll see to it that this is included in the next update.
"but when you open CaveMaker, there's a default "new level" window, and if you open a level, instead of making a new one, then you should make it automatically close that "new level"."
I'll take a look into doing that. I doubt there's any "nice" way of getting this to work. I can do it though.
"Error while trying to undo adding a second starting point so that the old one will get replaced."
At first this sounded like something obvious that I overlooked, but now I can't figure how you got that error. I'm not getting it. I tried various combinations of undo/redo and allow/disallow multiples, and I could not get this error. Could you get it to occur again, this time, detail exactly every step you took to get it to happen.
"you said the "view map as text" is just hidden when not displayed?"
That's partly true. The window is always there, but the contents of said window are not generated until you click the view-text button. Now, I could still likely make a button to do this, but I'd honestly rather not. I just, don't like the idea of having a shortcut to replace your clipboard. You might accidentally copy over the top of something important... /rationalization.
I'm officially NOT going to make an attempt to get the exact minimum and maximum for the cave size. It's just a lot of work for something that I really couldn't care less about. The uploader is fickle, and I feel I've already made a reasonable effort to accommodate it.
what? new lines are TWO characters? I have to check this out. that's just a bad coding idea on Neopets' side...
csd, I actually can't undo at all. the whole feature is broken for me. I'm gonna try deleting everything I have and redownloading it and see if anything changes. redownloading Java didn't help...
ok I'm still getting the undo errors. It works fine in new files, but when I try it in files that I have opened, I get this:
Code:
H:\Livio\caves\cavemaker>java Cavemaker
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException:
55
at Cavemaker$Cave.undoChange(Cavemaker.java:2135)
at Cavemaker$Cave.access$1600(Cavemaker.java:1109)
at Cavemaker.actionPerformed(Cavemaker.java:748)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Actions.actionPerformed(Unknow
n Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Sour
ce)
at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Sour
ce)
at javax.swing.JMenuBar.processBindingForKeyStrokeRecursive(Unknown Sour
ce)
at javax.swing.JMenuBar.processKeyBinding(Unknown Source)
at javax.swing.KeyboardManager.fireBinding(Unknown Source)
at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Sou
rce)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Sour
ce)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Sour
ce)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I know that, in order to get new lines in text files, I have to append two characters, a /r and a /n, so it makes sense that they would count for two.
Is there a possibility that you're using class files from multiple version of the cavemaker? It's probably best if you replace all the files everytime I release a new update, just to be safe. You know, I keep hearing from you that you can't undo at all, but nobody else appears to be getting this problem... I wonder what the cause could possibly be? I mean, if you've got everything downloaded properly, that error message would be a hard one to fake. I mean, array index out of bounds in undo()? If you get something like that, there's a very good chance undo will be broken until you open a new level. Do you get a message like that often? Could you please detail the exact steps you take? When, exactly, does the message appear in the cmd window? I wish I could recreate your problem.
Ack. Recent changes (alt+character) have greatly influenced the line numbers... It's making if very hard to find exactly which line went wrong... And I still haven't even managed to recreate this myself... Please detail every button click!
it just doesn't work for me csd. it's that simple.
I open cavemaker and there's the new level. I do changes to it, and undo works fine. But then I want to work on a level that I already made, so I open a level (i've tried different files too) and when i do a change, Undo does not work. I do it, and simply nothing happens. I don't remember if it still worked in that new level, but I don't think it did anymore. I think I already deleted everything and redownloaded it, but now I'm not sure if I did that. I'll do that again another time. but now I'm gonna judge the comp....
Well... I just can't imagine what the problem is. Maybe, if you use something other than the default terrain type? MAYBE that would cause the problem. If it happens again, post the cave you are using.
I deleted and redownloaded it again. It works on the new level as usual, but then I decided to try something. I changed the width of the level to 5. I undoed, and it worked! I redoed, and the undo system crashed and undos weren't working for me again no matter what I was trying to undo.
I close and reopen cavemaker. undo is working again. I open LDII (lol, why do I have this saved?). I make a big random chunk of steel crates across the cave. I press Undo. Nothing happens, and I have I have that big error message on the command prompt. The Undo system has crashed again.
but wait, instead of restarting cavemaker, I close the cave I had open, and I click on new level. Undo works again! If anything, I think you're forgetting to make it record a new undo-log for when you open levels. try that.
Ok, so I FINALLY got this bug to happen on my computer. I opened it up in mah IDE, it highlighted the line that caused the bug, and solution was readily apparent. I fixed it with a grand total of 3 characters. At the moment, undo will NOT WORK in ANY cave that is taller than it is wide. LOL!
I guess I'll upload an update tomorrow. You still won't be able to press enter in the level properties, but this needs to be fixed ASAP.
EDIT: Ok, so make that 6 characters. I just noticed that redo was basically copied from undo, so it had the same bug.
That glitch was caused by an inner loop that was using the height of the cave instead of the width as it's stopping point, so if you width is smaller than the height, you try to access tiles that don't exist, thus, an out-of-bounds exception.
Isa, I might as well ask some questions to make sure this isn't something stupid.
- Did you undo before trying to redo?
- Did you make a change since the last undo?
- Did the change you undid actually have an affect on the cave? I mean, if you, for example, undid a change that cleared and already cleared selection (like if you, say, double-clicked the clear selection button), then redo might not do anything.
If it's none of those, check around and see if you can figure out what might cause the problem. Try different combinations of anything you can think of. Anyway, when this occurs, is there an error in the cmd window? Paste for me, if so. If it only occurs in a specific cave, can I get a copy of the cave? Also, keep in mind that fixing the bug I fixed today might possibly fix this as well (who knows if there'd be any problems with caves with larger widths -- I couldn't find anything, but it could still be possible).
Okay...I open up the CaveMaker, add a piece of terrain and undo it.
To start off, every time I undo, the 'anchor point' or whatever it was called (basically, the tile selected) is moved to the top left corner. However, the undo effect is taking place.
I then ROFL, because I pressed Ctrl+Y all the time instead of Ctrl+Shift+Z. Lol, my bad.
But the undo thing is annoying. Nothing is written in the cmd prompt.
Lol, I'm always hitting ctrl+shift+z instead of ctrl+y.
That anchor point thing is partly because you can undo dimension changes. I could make code to put you somewhere nearby, I guess, but I didn't really wanna take the time to do it. But it's not only the anchor point, though, the scrollbars also reset, so I'd have to come up with some equation to keep you view on the same place, if possible. It'd be a headache, but it wouldn't be impossible to add.
So wait, you add terrain, undo, then redo, and it doesn't work? Just like that? OK, so that makes absolutely no sense. Just, wait until I upload the new version and we'll see if it continues to occur.
Sorry, I was being unclear. The main problem was that when I hit Ctrl+Y, nothing happened, so I assumed that the Redo function was broken (when it was not). When I press Ctrl+Shift+Z everything works as it should.