Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Utility: RPGenerator v0.7.23 - Build your own RPG in Codea

1246

Comments

  • edited July 2013 Posts: 391

    @Aalok, great suggestion. I didn't even think about weather effects. I will add it to the roadmap, but it will be the lowest priority for now, unless I become a shader pro after trying to get characters to walk through grass, forests, and water like mentioned above. If you come up with something that works before I do, I would love to implement it into the project.

    Edit: weather would also be perfect for cutscenes :D

  • IgnatzIgnatz Mod
    edited July 2013 Posts: 5,396
  • Posts: 391

    Ok, so I made a shader that turns the character into a ghost by adjusting the alpha. How do I get the same effect, but over just a part of the mesh?

  • edited July 2013 Posts: 60

    I have a rain effect running (using @Briarfox Paticular Particles) with your most recent code @slashin8r. My issue is I can't seem to draw it within the boundaries of the map. I am calling the draw for Rain in the generateMap tab.

    I will work on it a bit more and post what I have.

  • edited July 2013 Posts: 391

    Never mind, I figure that out. Just had to add an if statement. Now I have a new problem. Since I use the sprite sheet as the mesh and cut the sprite image from it, my shader is being applied to the sprite sheet instead of the sprite...

  • Posts: 391

    @Aalok, nice, working fast I see. I will try to patiently await your update, hehe.

  • Posts: 391

    Ok, got the shader working now. I just simply have it change the alpha in 4 locations instead of 1. So now the sprite sheet has transparent lines going across it and that works out perfectly.

  • IgnatzIgnatz Mod
    edited July 2013 Posts: 5,396

    @Slashin8r - I think the way to apply the shader to a part of the mesh is
    1. in the vertex shader, pass the current position to the fragment shader
    2. pass (from Codea), the coords of the image you want shaded, to the fragment shader, which can compare them with the pixel position and shade them if applicable

    I will have a go for you and report back soon

  • edited July 2013 Posts: 391

    @Ignatz, I got that part of it working. Now I can't seem to get my shader to toggle on and off. I added a uniform variable named toggle and the alpha is only changed if toggle is true. Now my testBelow function has been modified to return true if the tile below should trigger the shader and false if not. However, the toggle is being trigger, but the shader is not being turned off.

    Edit: never mind, got it working. I had to set toggle to false initially then it all worked.

  • IgnatzIgnatz Mod
    Posts: 5,396

    well, in the meantime I wrote it for you, here

    https://gist.github.com/dermotbalson/6017617

  • Posts: 391

    Since adding the new shader, I noticed a lot of unnecessary junk code in the testBelow function of mine. Was able to delete at least 10 iterations in a function that is called 13 times per frame (1 player and 12 NPCs). I just love using old code and slowing down my project, lol :P

  • IgnatzIgnatz Mod
    Posts: 5,396

    I just love refactoring ~X(

  • Posts: 391

    @Aalok, I just wanted to warn you that I pushed out an update. I suggest you copy your RPGenerator project before updating or you will lose your progress on your shader.

  • Posts: 391

    Oh snap! I forgot to add the code for my shader, lol. New update coming in a minute.

  • edited July 2013 Posts: 391

    Ok, now this update has the shader code. Go walk on some forest tiles to see the effect.

    Edit: now that I had a nice distraction from menu creation, tomorrow I will resume making the menus.

  • Jmv38Jmv38 Mod
    Posts: 3,297

    @Slashin8r to make ypur sprite 50% transparent: tint(255,255,255,128) before drawing it.

  • edited July 2013 Posts: 391

    @Jmv38, wow I completely forgot about tint. This is perfect for turning my sprites into ghosts. I currently have my ghost effect a part of my shader that makes just the bottom of the sprites transparent.

    Edit: never mind, looks like I need to stick with using my shader for ghosts as well since I am rendering everything with meshes and not using sprite functions. Sorry if I confused some of you by saying sprites too much, I'm so used to calling game character images sprites, lol.

  • Posts: 60

    @Slashin8r I got a couple rain effects created. One is using random lines drawn to simulate rain. The 2nd uses @Briarfox Particular Particles. I am not sure which one I prefer best. The particle one had a much higher FPS hit. The main thing I think all of these are missing are "splash" effects when it hits the group. I tried to implement a splash animation tile to the two you currently have but it just didn't scale like I wanted.

    If you can tell me how to export my project to Github I will send both there and link the changes here. I have an account, just haven't updated anything there yet.

  • Posts: 391

    @Aalok, I use @Briarfox's AutoGist. You can install it from here:

    http://twolivesleft.com/Codea/Talk/discussion/2744/autogist-v2-2-5-version-control-projects-push-pull-gists-and-create-installers/p1

    It is a very handy utility for uploading automatically to github and even syncing your updates with the gist it creates for you.

  • Posts: 60

    @slashin8r. Here is the link to the updated code to simulate rain with shaders and practical effect. Look at it and add it if you feel it's worthy. I still think splash effects on the ground and roof would set it off.

    https://gist.github.com/aalok74/6033649

  • Posts: 60

    Here is the 2nd rain effect. I may like this one best if I could get the animated puddles to look a bit more realistic.

    https://gist.github.com/aalok74/6033866

  • Posts: 1,976

    @Slashin8r Just read your post. »_«

  • edited July 2013 Posts: 391

    @Aalok, could you provide a link to your puddle animations? I checked out the first effect and it looks a bit more like snow, but that is still a good effect to have, especially since there are snow tiles.

  • Posts: 391

    @Aalok, wow, that 2nd effect is perfect! I will definitely add that in. Looking forward to seeing the puddles and splashes. I'm thinking a little modification to this rain effect would actually make for a better snow effect as well. Something simple like white ellipses of random sizes.

  • Posts: 391

    @Aalok, added a mass variable to your rain effect so now each line drawn can vary in strokeWidth.

  • Posts: 391

    @Aalok, I am loving this weather effect code. I changed some of the termination since I was able to adapt the code to work for snow. Changed all references to rain to weather, so instead of it being called RainAnimation it is now WeatherAnimation and so on. Snow and rain both look really good.

  • Posts: 60

    @slashin8r, I am pleased you like them. The changes you made defiantly makes it fit in better with your overall program. I can't wait to test out your next update.

    Here is the link to the rain_puddle.

    https://www.dropbox.com/s/007fjvqt9vbwa8w/rain_drop.png

    I am messing around with some fog effects and lightning flashes. If I have something to pass on, I will shoot it your way.

  • edited July 2013 Posts: 391

    AAAAAAAAAAAHHHH!!!! I've been reformatting a php website all week and for the past 3-4 hours I couldn't figure out why certain parts of the website weren't showing up. Then I notice it is 1 fricken line of JavaScript causing all the problems. Damn you JavaScript!! [-X

    Soon to be done with this website and work on RPGenerator will continue. Converting a multiple page php site into a single page php site is a pain in the arse. But... once it is done, I can use it as a template to easily make more websites of a similar fashion, woot! Easy money from then on. :D

  • edited July 2013 Posts: 391

    If I make the characters a class and player/NPCs another class that inherits from character, would it make the project more or less efficient? I know either way I would need to store all characters created in a table, and still reference the variables in the same manner. I could, however, then make the move, testBelow, animateMove functions as part of the class so I don't need to pass the first variable as the object. I'm debating whether or not it is even worth it to convert it this way, what are your thoughts?

    Edit: after such a frustration week, I've kinda lost motivation in these menus, so instead I'm going to start working on getting items into the game and then go back to menus so I have more content to help me test the menus, especially the inventory menu.

  • Posts: 391

    Updated to v0.7.6 and added CiderControls. I have included a download for the CiderControls project in the first post. You must set CiderControls as a dependency in RPG.

    Also, I updated the first post. Removed the screenshots as they took up a lot of space (will add links to new, more current screenshots). I also added an installation process.

  • Posts: 391

    Updated to v0.7.7 which adds a basic inventory menu. This menu is still not completed, but you can see that it lists items and is able to scroll up and down. Also updated RPG to add the inventory menu, please update both projects to get it to run properly. Don't forget you also need CiderControls as a dependency in RPG (download available in first post).

  • edited July 2013 Posts: 60

    Hey Slashin8r.

    I updated both projects but I get an error when running RPG.

    error: [string "-- Main..."]:53: attempt to call global 'WeatherAnimations' (a nil value)

    I then toggle WeatherRate to 0 to bypass the animation and then get.

    error: [string "-- Main..."]:154: attempt to call global 'drawMenu' (a nil value)

    EDIT

    Sorry, this was user error. I created a new RPG project and forgot the generator lol oops. :)

  • Posts: 391

    Updated both RPG and RPGenerator. I modified the inventory menu and now each item is touchable and returns their corresponding index for future use. Check it out.

  • Posts: 60

    Today was a good day for this project. You made some really nice updates. I like where the menu system is going. Wondering with anticipation on what the combat system may look like.

    A+ day slahin8r

  • Posts: 391

    @Aalok, I'm not really looking forward to making the combat system. I know it is going to be the hardest thing to accomplish since its a combination of menus and animations. Also I have a feeling it will lag out pretty hard since the current inventory menu causes FPS to drop to the 20s (not sure if this is CiderControls causing it to what).

    One step at a time and I'm sure I will have this project ready within the next month or two.

  • edited July 2013 Posts: 391

    Ok, I figured out the FPS problem. It drops dramatically because CiderControls makes everything with rounded edges. I commented out the code for the rounded edges and now FPS is back up to high 50s and low 60s. I am pushing through my updated version of CiderControls so please update it when you get a chance.

    Edit: I added autoUpdate to CiderControls. I didn't have it in there before since I didn't think I'd need to update it. So for this install, use the auto installer again, then every update after it will be automatic.

  • edited July 2013 Posts: 391

    Updated all 3 projects. Added a scroll bar to the inventory menu along with the swipe functionality to scroll through the menu. Due to this changed, I removed the up and down buttons. Simply swipe up or down anywhere on the screen (will change to just inside the item list in the future) to scroll through the inventory menu.

  • Posts: 391

    @Aalok, I've been messing around with your splash and puddles idea lately. I think I will be adding in a weather map table to store where puddles are created. This will allow for the rain to create puddles on the map, then if it tries to create a puddle where one already exists, it will do a splash effect instead. I can also test it against roof tiles and make sure no puddles appear on roofs, but splash effects occur instead.

    I think this would look awesome. I will start coding it in tomorrow (today since it is almost 2am here, lol) and hopefully have it implemented very soon.

  • edited July 2013 Posts: 391

    Got the functionality for adding in puddles to work. I am currently using ellipses to display them though. The puddles also work for snow. I will push out this update once I get it to render some actual sprites and once I finish the splash animations for rain.

    As for menus, my next goal is to get simple popup menus to appear when you touch an object that can do more than 1 thing. For example, in the inventory menu, each item can be used/equipped, inspected to display info, or thrown in the trash. A popup to contain these choices would be perfect. I can't think of more instances where this popup will be utilized, but I'm sure more will pop up (pun intended :P ) as I progress in creating the menus.

  • @Slashin8r the last update was really good! I cant wait when we can pickup weapons and fight! My goal with this project is just to costumize it to my liking

  • edited July 2013 Posts: 391

    Updated RPG and RPGenerator. I didn't finish the puddles completely, but I released what I have so far since I made some changes to the inventory menu.

    The inventory menu now displays 45 items and the icons and text is bigger. I also centered the item counts and made room for 3 digit counts, so item max count is now 999, up from 99.

    Puddles and snow piles will automatically generate and how quickly they generate is based off of weather spawnRate, so the heavier the storm the faster they generate. They will also remove themselves over time when the weather is turned off. There is also a toggle for the puddles so you can set them to not generate even when the weather is on (puddles must be toggled on with weather off for them to remove themselves).

  • edited July 2013 Posts: 391

    Added screenshots to the first post to show off some of the new features. Also updated installation instructions.

    Edit: Updated RPG just now to include output of downloaded images. Also outputs when all the images are finished to let you know when to restart Codea if it fails to continue after downloading.

  • Posts: 391

    Updated RPG, RPGenerator, and CiderControls.

  • BriarfoxBriarfox Mod
    Posts: 1,542

    @Slashin8r The snow effect puddles are reacting to touch. On touch they seem to change opacity.

  • Posts: 391

    Nice catch, I will look into it. Adding pushStyle and popStyle around where I draw the puddles made it so it doesn't change on touch now, but its not drawing the right color. Gonna check out every instance of the snow. Rain puddles work correctly, so it's very odd that snow doesn't.

  • edited July 2013 Posts: 391

    ROFL, I had this where the ellipses are drawn:

                    if WeatherType == 0 then
                        fill(60, 25, 255, 180)
                    elseif WeatherType == 0 then
                        fill(255, 255, 255, 255)
                    end
    

    Because of this it was using the fill color of the joystick of the joypad. The 2nd if needs to be WeatherType == 1, heh.

  • Posts: 391

    Updated both RPG and RPGenerator. Puddles and snow piles will now render correctly. Also stopped generated puddles from instantly switching to snow piles, and vice versa, when WeatherType is changed.

  • Posts: 391

    Updated all 3 projects. Added item sub menus to the inventory menu. Touching an item will select that item. Touching an item again will display the sub menu. Touching the item yet again will close the sub menu. When sub menu is being displayed, all other items, except the selected one, will be untouchable. This is to prevent a sub menu touch from triggering an item touch of the item the sub menu is being displayed over.

  • Posts: 391

    Updated all 3 projects again.

    Added a main menu and a game menu. Game menu can be opened via the new menu button in game. Most buttons are non-functional and will only return you to the game.

    Added a door decor object and new door variable which will be used in decor table. Door variable will allow the player to walk over the tile regardless of other objects on that tile. So you can now place walls and put a door on the walls and then be able to walk into the doorway.

Sign In or Register to comment.