I need some help

Hello,

Im 12 years old and im new to codea.
I want to make a simple rpg, but i dont know how to make a AI, and how to make my character moving can i have a little help?

Check this out. This project is still being worked on, but it will give you a jump start in creating your maps and characters.

http://twolivesleft.com/Codea/Talk/discussion/3058/

@Slashin8r thanks!!

@Slashin8r this is a good thing but it is quite complex

@Jessevanderheide, once I get it to version 1.0 I will start building a GUI similar to RPG Maker for version 2.0, but that may be a long ways away. In the meantime, if you plan to use my project, the only things you need to edit are the starting player variables in setup2() and the tables in the following tabs: images (for your own custom tilesheets, charasets, and facesets), characters, NPCs, events, objects, tiles (both tiles and aTiles tables), and maps.

If you don’t mind using the random tilesheets I tossed into the project for testing purposes, then the only tables you would need to edit would be: maps, characters, NPCs, and events.

The documentation at the top of each tab briefly describes what each variable does. I tried to be as straightforward as possible with most of my variable names.

Let me know if you have any questions, I’m happy to help out any fellow coder.

I will further document the tiles, aTiles, and objects tables so you know what tile each index represents (e.g. grass, desert, water, forest, mountain, etc.). I will include this in v0.6.8

Edit: updated the documentation.

@Slashin8r i have looked more into your project, and i understand the basics now

@Jessevanderheide - don’t be put off, every project looks complex after its been developed for a while. And I’m sure you can do it (you aren’t the youngest here!).

I suggest you start small and just get one little thing working at a time. Go through the tutorials and examples on the wiki and get to know the language. And before long, you will be impressing us with cool stuff.

@Ignatz thanks man, i am using other tilesheets now and i am totally redesigning it.
I am suprised that a lot of people are willing to help me, i was actually scared that people would’nt take me seriously because of my age.

Thanks alot!!

@Jessevanderheide, I recommend renaming your project and creating a new one called RPGenerator so that when any update goes through it won’t replace any of your current tile sheets and maps.

I will work on splitting the project into 2 projects, one with all the generate/draw functions and one to store the tables and images. This will prevent the overwrite in the future.

@Slashin8r yep thats a good idea, Thanks!

@Slashin8r another question :), how do i add another map?

@Jessevanderheide, copy one of the map tables and add it at the end. Each map table includes the tileWidth, tileHeight, floor, animated, objects, decor, and events variables. You will be copying a large chunk of code since 5 of the above variables are grid maps themselves.

Below is all one map:

        { tileWidth = 32, tileHeight = 32, -- map 1
        floor = { -- numbers indicate the tile sheet used in the tiles table
            {1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,2,1,2,2,2,1,1,1,1,1},
            {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
            {1,1,1,1,1,5,5,5,2,2,2,2,1,1,1,1,1,1,1},
            {1,1,1,1,5,5,5,5,2,2,2,2,2,1,1,1,1,1,1},
            {1,1,1,1,5,5,5,2,2,2,2,2,2,3,3,3,1,1,1},
            {1,1,1,1,1,1,5,2,2,1,2,2,3,3,3,3,3,1,1},
            {1,1,1,1,1,1,1,2,2,1,2,2,3,3,3,3,3,1,1},
            {1,1,1,1,1,1,1,1,1,1,2,3,3,3,3,3,1,1,1},
            {1,1,1,1,1,1,7,7,1,2,4,4,4,4,3,3,1,1,1},
            {1,1,1,1,1,6,6,6,1,2,4,4,4,3,3,1,1,1,1},
            {1,1,1,1,6,6,6,6,1,2,4,4,4,4,4,1,1,1,1},
            {1,1,1,1,1,6,6,6,1,2,1,1,4,4,1,1,1,1,1},
            {1,1,1,1,1,1,6,6,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,9,9,1,1,7,7,1,1,8,8,1,1,1,1,1,1,1},
            {1,1,9,9,9,7,7,7,7,8,8,8,8,1,1,1,1,1,1},
            {1,1,1,1,9,7,7,7,7,8,8,8,8,1,0,0,0,0,0},
            {0,1,1,1,1,1,7,7,1,1,8,8,1,1,0,0,0,0,0},
            {0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0}
        },
        animated = { -- numbers indicate the tile sheet used in the aTiles table
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {2,2,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1},
            {2,2,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1},
            {2,2,2,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1}
        },
        objects = { -- numbers indicate the tile sheet used in the objects table
            {17,17,17,17,17,17,17,17,17,0,0,0,0,17,17,17,17,17,17},
            {17,2,2,2,2,0,0,0,17,0,0,0,0,17,0,0,0,0,17},
            {17,2,2,2,2,2,0,0,17,0,0,0,0,17,0,0,0,0,17},
            {17,0,0,2,2,0,0,0,17,20,20,20,20,17,0,17,17,17,17},
            {1,0,0,0,0,0,0,0,0,20,20,20,20,0,0,1,17,17,17},
            {1,0,0,0,0,0,0,0,0,20,0,0,20,1,1,1,1,17,17},
            {1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,13,13,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,13,0,0,13,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,13,13,13,13,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,5,5,5,5,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,5,5,5,5,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,1},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0}
        },
        decor = { -- numbers indicate the object used in the decor table
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
        },
        events = { -- numbers indicate the event called from the events table
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
            {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
        }}

Also, I just did the update that splits the project in 2, feel free to install both projects and then copy your tables over the ones in the RPG project. The RPG project will not update and overwrite your variables, but the RPGenerator will continue to be worked on and updated regularly. Make sure to also add RPGenerator as a dependency in the RPG project.

@Slashin8r whats wrong with this?
It says that i need something to close { at line 8 but whei do that it still wont work

You might have missed placing a comma. Each map will need a comma to separate them. Locate the end of map1 and start of map2, verify there is a comma separating them, then do the same for any additional maps you added.

I think I may change the maps tables to make it easier to edit. I’m thinking of just putting every map on its own tab and then tossing them into the maps table by variable or function call. This will make the maps table much cleaner and easier to read.

I made the changes I mentioned above. I recommend installing my RPG project. To add new maps, you would go to map1 tab, select all and copy, create blank tab and paste, change variable name at the top (map3 for example), then add the new variable to the maps table on the maps tab.

Not sure if you figured this out already, but you can also change the map sizes. In each row, you can add more columns by adding more commas and numbers (tile values), and to add more rows, just copy a full row and paste it to the bottom making sure there is a comma to separate it from the row above it. Then, repeat for the other maps (animated, objects, decor, events), since they all must be the same size.

@Slashin8r thanks, i will look into it :slight_smile:

@Slashin8r i get a error it wont generate the maps :frowning: the error is on main line 78

Do you have RPGenerator set as a dependency? You can do this by tapping the + sign like you are adding a new tab, then you will see a list of projects you can add as dependencies. Make sure there is a check next to RPGenerator.