Yep, I just tested and that is the error for project name mismatch. Change the variable in the auto installer to match the project name you are trying to use.
I updated and ended up with errors and a blank screen. A codea restart fixed it. It seems that codea does not always read my tabs and it takes reloading the project to fix it. Nice update!
@Briarfox, were the errors related to the new image downloads? As for the blank screen, I have noticed that it takes about 30-60 seconds for the 4 images to download.
Next major update will include animated auto-tiles such as water or lava. Also going to try placing an NPC on the map so I can move the dialogue event out of map events.
@ignatz, for this project I will be sticking to 2D with the tiny hint of 3D as you can go behind objects that are taller than the tile height. Here is an example of what a finished map will look like when I get all the algorithms completed:
@slashin8r I'm not sure on the errors. I saw them, tried to reload so I could read the errors. Codea crashed then upon a restart it all worked. I'll delete the images and try it again.
edit: After deleting images I get this error:
GenerateMap :103 attempt to index field 'sheet'
Characters :24 attempt to index field sheet
I cant seem to get past it this time. I've let the program hang for a minute.
edit: Images appear to have been download into dropbox folder but I'm still getting the errors.
There is something odd happening with images. My code to auto download images was working fine before, but now it's not. I'm wondering if the recent changes to sprites changed something.
I had the same problem as Briarfox, it works now. The code (yesterday's version) needs some debugging, though.
I'll check it out and see if I can fix it. It looks like a fresh install works fine (no current project, no images), but when updating from a previous version these issues are occurring.
So it is downloading the images correctly. It is waiting to call the draw function correctly. When it tries to generate the map, Codea is not recognizing the newly downloaded images. So far, the only fix, like you guys said, is to restart Codea completely.
All the code looks pretty air tight, the images are just returning a nil value when newly downloaded, not sure why.
I just changed the name of my project to RPGenerator. Something went wrong when I tried to update the name in the AutoGist so I just remade the auto installer. New links are in the first post.
By the way, what do you all think of the new name RPGenerator?
1: RPGenerator sounds awesome.
2: When I start it up, I get a black screen or a few seconds, if I exit Codea crashes, if I wait it gives me an error in GenerateMap:36 attempt to index field sheet.
3: Looks awesome, though...
@SkyTheCoder, yep that's the issue I just submitted to the issue tracker. On first load, let the project run until you get the generateMap error. Then, close Codea completely and restart it, then the project will run correctly.
Weird, I could have sworn I closed Codea completely and it still crashed, but now it works, and I have something to point out: the controls are way too sensitive. I finally was able to move the little guy right next to a hedge and see it said "Popup example: Move left to teleport." Also, diagonal movement please?
@SkyTheCoder, I most likely won't be doing diagonal movement since all the charasets only have left, right, up and down movements. As for the controls, I am planning to make them slower and smoother. Right now the animations are rendered on the fly and in the future I will have set functions for each movement.
I cleaned up a lot of the code and released v0.4.6 just now. You will notice many areas are much easier to read and the tiles/objects tables have been rewritten to make it easier to import your own tilesheets.
I am now working on animated tiles for v0.5.0 and also the addition of NPCs for v0.6.0. Versions may swap as I am assuming it will be easier to finish animated tiles than to add NPCs and all their functionality (dialogue, shops, etc.).
Added a Roadmap to the first post so everyone can see how far I plan on taking this project. When finished, it is my hope that anyone will be able to create a full-fledged classic style RPG. To make such an RPG will still require hundreds of hours worth of coding even while utilizing the RPGenerator. This project will not write your RPG storyline for you :P
Ideas for NPCs have been popping into my head more than for animated tiles, so it's looking like walking and talking NPCs will be done first.
I have run into a problem, however. The NPC dialogue is solid, the NPC movement is pretty solid (except the animation), but the NPC is not being redrawn over passable objects. I am using the same checks as I do with the player and the player is working as expected, but the NPC is never redrawn. I have updated the current version to v0.4.7 so you all can grab the new code and toss me some ideas about this issue.
Currently, the NPC only moves down so that it goes over that single patch of forest with its first move.
ROFL, I forgot to include the 2nd instance of drawing the NPC inside the push matrix so it translates with the map. Got it fixed and now we are officially on v0.5.0, yay!
What is the best way to animate something on a grid map? Currently I am changing its position then creating an offset variable that slowly decreases or increases (depending on the direction the character moved). This works very well for animating the player and the offset variables (moveX and moveY) are making it so the map slowly translates into position instead of instantly. Now I need to do the same with the NPCs, however I can't use more offset variables on the translation of the map, so I'm thinking of adding individual offset variables per NPC and slowly animate them as they move. Is there a better way to accomplish this using the tween function?
As of now I got the animations working for both the player and the NPCs without using tweens. The offset variables are working well. Have not seen FPS drop below 55 so I am ok with it for now. Gonna add a ton of NPCs onto a map and see if it lags out.
Now I have 12 NPCs all walking around on the map at a quick rate. After about 5 minutes of letting the project run, it crashes. Trying to figure out what is going wrong. I have limited my calls to sprites and meshes by tossing everything generated into tables and reusing those meshes when appropriate. There is definitely a memory leak somewhere, and it most likely has to do with how I animate the player and NPCs. Tossing my current code into v0.5.5, if someone could check it out and toss me some ideas it would be greatly appreciated.
@Briarfox, I added new images, it may be caused by that. Try a restart of Codea and see if it resolves the error.
I now realized what I did wrong there, I needed to move line 100 down a line. I put it before the imageStatus check. Feel free to do it manually for now. I will be sending out an update soon, but currently in the middle of coding animated tiles.
Updated to v0.6.0 with some sweet additions. Added facesets so we don't have to talk to planet cute characters, hehe. Added an animated tilesheet and setup the functionality for it. At the bottom right corner of map 1, you will notice the animated water. Fixed the error that @Briarfox mentioned above.
Still not sure why the game crashes after 5 mins or so.
WOW, I am an idiot, lol! I said I readded gCharacters table to store generated characters into it, but I never actually stored the meshes in it ~X( , so it was creating a new mesh every time the player or an NPC moved. No wonder why it would crash, hehe. Now in v0.6.1 I am correctly utilizing gCharacters table and I let it run for 20 minutes and didn't crash, not even a lag spike and FPS was solid above 55.
Now on v0.6.3 as I noticed some problems with characters rendering in front of objects they should be behind or vice versa due to the new animated tiles map. I now check for animated tiles below the character in the testBelow function and this has resolved the issue. Also the walking animation had the same rendering problems, and this has been solved by adding a variable to characters to let us know whether or not the character is behind an object. Behind variable only changes after walking animation is completed.
Now after adding the behind variable, the player works as expected, but NPCs are always showing up behind objects. Fix one thing just to break another, lol. I don't get it, they use the exact same function to determine whether or not it is behind an object...
I hope no one updated in the last 6 minutes, I had to move the npcimgs[i]:clear() yet again, but this time I was only 1 line off. I got an error when changing maps cause it tried to clear an NPC image that didn't exist on map 2.
If you already updated to v0.6.4 and you are getting an error when it teleports to map 2, then make this small edit:
Swap lines 218 and 219 on the main tab. The clear should be called inside that if statement.
Just tried out Air Code for the first time and.... OMFG, this is awesome!!! I can edit while testing, sweeeeet. What more can a coder ask for? Don't answer that, cause there's plenty to ask for, hehe.
For the next hour or so I am going to stress test the current project. I will let it run for an hour or so, or until it crashes. Hopefully it just keeps on keepin on.
Ran the project for well over an hour and no crash, woot! I did, however, notice that the NPCs may start to render on top of objects that they shouldn't. I have no clue why this is happening. I will continue to test to see if I can reproduce the issue. I think it may have something to do with one NPC changing the behind variable of another. Not sure how this is even possible.
Ok, fixed that issue by making the gCharacters table a 2D table since NPCs are able to share the same sprite image (e.g. Guards, Priests, etc.). Because I had them sharing the mesh stored in gCharacters only one was able to be behind something at any given time.
@JakAttak, I made the joystick a bit less sensitive. You can adjust the speed of the character now by changing the speed variable in the player table under setup2(). You can also do the same to each NPC. Soon I will be replacing the joypad with a d-pad instead since the only movements are left, right, up and down.
Also, with the new animations, each move waits for the previous move to finish, which is based off of speed of the character (this is how I made the joypad "less sensitive"). Previously, each move was instantaneous, which made it hard to stop on the tile you want.
@SkyTheCoder, just a random charaset I tossed in (its a frog from Chrono Trigger, hehe), I wanted to try a non-humanoid NPC to see how it looked. Then I noticed the frog has the images in the wrong order in the charaset so when the frog is standing still it is floating in the air, lol.
Edit: 100th comment wins free RPGenerator updates for life :P lol
Comments
Yep, I just tested and that is the error for project name mismatch. Change the variable in the auto installer to match the project name you are trying to use.
I updated and ended up with errors and a blank screen. A codea restart fixed it. It seems that codea does not always read my tabs and it takes reloading the project to fix it. Nice update!
@Briarfox, were the errors related to the new image downloads? As for the blank screen, I have noticed that it takes about 30-60 seconds for the 4 images to download.
Next major update will include animated auto-tiles such as water or lava. Also going to try placing an NPC on the map so I can move the dialogue event out of map events.
Changing the title of this discussion as I am about to progress well beyond just a 2D map generator.
Changed to RPG Maker Clone for now, but I think that would probably be copyright infringement so it will probably change again soon, lol.
@Slashin8r - I will try again and let you know
If you are going 3D, I wrote a lot of stuff about that, including roofs, overlapping images, tiling large areas etc
http://coolcodea.wordpress.com/2013/05/page/2/
http://coolcodea.wordpress.com/2013/05/
@ignatz, for this project I will be sticking to 2D with the tiny hint of 3D as you can go behind objects that are taller than the tile height. Here is an example of what a finished map will look like when I get all the algorithms completed:

@slashin8r I'm not sure on the errors. I saw them, tried to reload so I could read the errors. Codea crashed then upon a restart it all worked. I'll delete the images and try it again.
edit: After deleting images I get this error:
GenerateMap :103 attempt to index field 'sheet'
Characters :24 attempt to index field sheet
I cant seem to get past it this time. I've let the program hang for a minute.
edit: Images appear to have been download into dropbox folder but I'm still getting the errors.
Ok If I clear codea out of memory and reload then it works.
There is something odd happening with images. My code to auto download images was working fine before, but now it's not. I'm wondering if the recent changes to sprites changed something.
I had the same problem as Briarfox, it works now. The code (yesterday's version) needs some debugging, though.
I'll check it out and see if I can fix it. It looks like a fresh install works fine (no current project, no images), but when updating from a previous version these issues are occurring.
Hmmm, with the latest update it is even throwing errors on fresh installs, I'll keep on looking into this.
So it is downloading the images correctly. It is waiting to call the draw function correctly. When it tries to generate the map, Codea is not recognizing the newly downloaded images. So far, the only fix, like you guys said, is to restart Codea completely.
All the code looks pretty air tight, the images are just returning a nil value when newly downloaded, not sure why.
Log it as a possible bug, I suggest
I just changed the name of my project to RPGenerator. Something went wrong when I tried to update the name in the AutoGist so I just remade the auto installer. New links are in the first post.
By the way, what do you all think of the new name RPGenerator?
1: RPGenerator sounds awesome.
2: When I start it up, I get a black screen or a few seconds, if I exit Codea crashes, if I wait it gives me an error in GenerateMap:36 attempt to index field sheet.
3: Looks awesome, though...
@SkyTheCoder, yep that's the issue I just submitted to the issue tracker. On first load, let the project run until you get the generateMap error. Then, close Codea completely and restart it, then the project will run correctly.
Weird, I could have sworn I closed Codea completely and it still crashed, but now it works, and I have something to point out: the controls are way too sensitive. I finally was able to move the little guy right next to a hedge and see it said "Popup example: Move left to teleport." Also, diagonal movement please?
@SkyTheCoder, I most likely won't be doing diagonal movement since all the charasets only have left, right, up and down movements. As for the controls, I am planning to make them slower and smoother. Right now the animations are rendered on the fly and in the future I will have set functions for each movement.
I'm having the same image loading problems on my own project, using the auto-downloading code. We'll see what the tech boys say about the problem...
I cleaned up a lot of the code and released v0.4.6 just now. You will notice many areas are much easier to read and the tiles/objects tables have been rewritten to make it easier to import your own tilesheets.
I am now working on animated tiles for v0.5.0 and also the addition of NPCs for v0.6.0. Versions may swap as I am assuming it will be easier to finish animated tiles than to add NPCs and all their functionality (dialogue, shops, etc.).
Added a Roadmap to the first post so everyone can see how far I plan on taking this project. When finished, it is my hope that anyone will be able to create a full-fledged classic style RPG. To make such an RPG will still require hundreds of hours worth of coding even while utilizing the RPGenerator. This project will not write your RPG storyline for you :P
Ideas for NPCs have been popping into my head more than for animated tiles, so it's looking like walking and talking NPCs will be done first.
I have run into a problem, however. The NPC dialogue is solid, the NPC movement is pretty solid (except the animation), but the NPC is not being redrawn over passable objects. I am using the same checks as I do with the player and the player is working as expected, but the NPC is never redrawn. I have updated the current version to v0.4.7 so you all can grab the new code and toss me some ideas about this issue.
Currently, the NPC only moves down so that it goes over that single patch of forest with its first move.
ROFL, I forgot to include the 2nd instance of drawing the NPC inside the push matrix so it translates with the map. Got it fixed and now we are officially on v0.5.0, yay!
Just noticed that NPCs are being drawn on every map, so I added a map variable to the NPCs table to fix this.
What is the best way to animate something on a grid map? Currently I am changing its position then creating an offset variable that slowly decreases or increases (depending on the direction the character moved). This works very well for animating the player and the offset variables (moveX and moveY) are making it so the map slowly translates into position instead of instantly. Now I need to do the same with the NPCs, however I can't use more offset variables on the translation of the map, so I'm thinking of adding individual offset variables per NPC and slowly animate them as they move. Is there a better way to accomplish this using the tween function?
As of now I got the animations working for both the player and the NPCs without using tweens. The offset variables are working well. Have not seen FPS drop below 55 so I am ok with it for now. Gonna add a ton of NPCs onto a map and see if it lags out.
Now I have 12 NPCs all walking around on the map at a quick rate. After about 5 minutes of letting the project run, it crashes. Trying to figure out what is going wrong. I have limited my calls to sprites and meshes by tossing everything generated into tables and reusing those meshes when appropriate. There is definitely a memory leak somewhere, and it most likely has to do with how I animate the player and NPCs. Tossing my current code into v0.5.5, if someone could check it out and toss me some ideas it would be greatly appreciated.
I'll take a look at it.
edit: in 0.5.5 I'm getting a maps is a nil value error, main.lua line 100.
@Briarfox, I added new images, it may be caused by that. Try a restart of Codea and see if it resolves the error.
I now realized what I did wrong there, I needed to move line 100 down a line. I put it before the imageStatus check. Feel free to do it manually for now. I will be sending out an update soon, but currently in the middle of coding animated tiles.
Updated to v0.6.0 with some sweet additions. Added facesets so we don't have to talk to planet cute characters, hehe. Added an animated tilesheet and setup the functionality for it. At the bottom right corner of map 1, you will notice the animated water. Fixed the error that @Briarfox mentioned above.
Still not sure why the game crashes after 5 mins or so.
WOW, I am an idiot, lol! I said I readded gCharacters table to store generated characters into it, but I never actually stored the meshes in it ~X( , so it was creating a new mesh every time the player or an NPC moved. No wonder why it would crash, hehe. Now in v0.6.1 I am correctly utilizing gCharacters table and I let it run for 20 minutes and didn't crash, not even a lag spike and FPS was solid above 55.
Looking good! However I'm missing the bottom right tiles. They are just white squares. Is this where you added animated tiles? I don't see any
Let me double check that I provided the correct download link to the new tilesheet.
Edit: It should be working. The link looks correct. You should have Tilesheet-004 in your Dropbox. Here is a direct link as well: https://dl.dropboxusercontent.com/s/te3hr49tka856gp/Tilesheet-004.png
Every time new images are downloaded make sure to completely restart Codea as well.
Now on v0.6.3 as I noticed some problems with characters rendering in front of objects they should be behind or vice versa due to the new animated tiles map. I now check for animated tiles below the character in the testBelow function and this has resolved the issue. Also the walking animation had the same rendering problems, and this has been solved by adding a variable to characters to let us know whether or not the character is behind an object. Behind variable only changes after walking animation is completed.
I keep forgetting to try restarting codea before reporting that it's not working
that fixed it.
Now after adding the behind variable, the player works as expected, but NPCs are always showing up behind objects. Fix one thing just to break another, lol. I don't get it, they use the exact same function to determine whether or not it is behind an object...
Argh, another stupid mistake. I was clearing the character meshes in the wrong spot, now everything works again. Updated to v0.6.4
I hope no one updated in the last 6 minutes, I had to move the npcimgs[i]:clear() yet again, but this time I was only 1 line off. I got an error when changing maps cause it tried to clear an NPC image that didn't exist on map 2.
If you already updated to v0.6.4 and you are getting an error when it teleports to map 2, then make this small edit:
Swap lines 218 and 219 on the main tab. The clear should be called inside that if statement.
Just tried out Air Code for the first time and.... OMFG, this is awesome!!! I can edit while testing, sweeeeet. What more can a coder ask for? Don't answer that, cause there's plenty to ask for, hehe.
For the next hour or so I am going to stress test the current project. I will let it run for an hour or so, or until it crashes. Hopefully it just keeps on keepin on.
Just updated, and I have to say the animated tiles, NPCs, and new character movements are awesome. Keep up the good work.
Ran the project for well over an hour and no crash, woot! I did, however, notice that the NPCs may start to render on top of objects that they shouldn't. I have no clue why this is happening. I will continue to test to see if I can reproduce the issue. I think it may have something to do with one NPC changing the behind variable of another. Not sure how this is even possible.
Ok, fixed that issue by making the gCharacters table a 2D table since NPCs are able to share the same sprite image (e.g. Guards, Priests, etc.). Because I had them sharing the mesh stored in gCharacters only one was able to be behind something at any given time.
Edit: it works, my only note is that the joystick doesn't seem to work as well as before
I just ran auto update and works here. @JakAttak Did you restart codea? You will need to after update.
@JakAttak, I made the joystick a bit less sensitive. You can adjust the speed of the character now by changing the speed variable in the player table under setup2(). You can also do the same to each NPC. Soon I will be replacing the joypad with a d-pad instead since the only movements are left, right, up and down.
Also, with the new animations, each move waits for the previous move to finish, which is based off of speed of the character (this is how I made the joypad "less sensitive"). Previously, each move was instantaneous, which made it hard to stop on the tile you want.
What's up with test NPC 3? His chatting image looks normal, but in-game he looks like Kermit the Frog with his guts coming out of his stomach.
Edit: Woo, 100th comment! What do I win? :P
@SkyTheCoder, just a random charaset I tossed in (its a frog from Chrono Trigger, hehe), I wanted to try a non-humanoid NPC to see how it looked. Then I noticed the frog has the images in the wrong order in the charaset so when the frog is standing still it is floating in the air, lol.
Edit: 100th comment wins free RPGenerator updates for life :P lol