RPG Problem

0 favourites
  • 11 posts
From the Asset Store
Over 1700 16x16 pixel art RPG icons for item and skills
  • Hello.

    I've looked around on the forums and tutorials for an RPG inventory system or tutorial and I've found a number of drag & drops. None of them seems to really be what I'm looking for, and are a bit daunting to pick through as a Construct n00b. . . I like Weishaupt's tutorial, but having looked at his capx it's not exactly what I was envisioning. I love the appearance and function of Yann's example as well, but his seems to rely on the mentality of "this item goes in this slot" when generating the inventory. . .

    I can get the drag and drop mechanics to work by following Weishaupt's tutorial (since I have the plugins installed), but I'm a little more curious how to populate the inventory when new items are acquired. Unfortunately I can't afford the standard license yet, blame the economy. I'm in the process of waiting on a meeting with a manager, it all sounds good so far, but I need to actually get the job and a few paychecks before I can buy it. For that reason, I'm limited in exactly how complex I can play around. . .

    So far I have a stat and level-up system working with an acceptable UI, but it took almost a third of my allowed events. Yann's prebuilt would put me over 90, and I wouldn't know where to begin on modifying it, lol. <img src="smileys/smiley36.gif" border="0" align="middle" />

    The layout I have, in case I can't get a picture to work, has 45 inventory slots available per page. I haven't tried to implement the page changes yet, but that's partially because I'm still trying to wrap my mind around Weishaupt's tutorial to get other parts of the inventory working properly. <img src="smileys/smiley24.gif" border="0" align="middle" />

    I also have the following equipment slots:

    Head, Neck, Arms, Chest, Legs, Left Wrist, Right Wrist, Left Hand, Right Hand, Left Foot, Right Foot, Left Ring, Right Ring. (I'm explaining because I've never successfully previewed on this forum, always get "nothing to preview" error) Not only do I need to get the item slot to work properly, it also has to read the character and see if they can wear it. Gary can wear the Plate Helm, but Stu can only wear Leather or Chain, yeah?

    I think it's great seeing people jump forward with capx files to demonstrate their idea instead of just giving a short 1-2 paragraph explanation, but I don't learn much from having the work done for me. . . I'll happily accept and look over demonstrations, but expect me to ask about how parts were done, why, and how they interconnect after. I'm a pain like that. <img src="smileys/smiley23.gif" border="0" align="middle" />

    Image linking attempt. . .

    <img src="http://dl.dropbox.com/u/59065013/Construct%20Issues%20Screenies/Sample%20Image.png" border="0" />

    Aaand. . . summary? Yes, summary is good. I'll get on one right away.

    What I'm trying to achieve is a system that looks at the items it has and places them in order on the inventory grid (3r x 15c) even if that means onto a hidden page. If it has 32 items, for example, it will fill the first two entire rows of the first page, and two columns of the third row. If it has 47 items, however, it will fill the entire first page and two slots of the second page. Then, when the item is to be used, it need to compare not only the slot the player is trying to put it in, but the character who they're trying to equip it on.

    I don't need drag & drop, if that makes it easier to explain how. Little "Equip" buttons are plenty easy for me to add in and remove. My issue is the inventory population and slot/character verification algorithms(??). Please, someone teach me to fish. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I think it's easier if you just create a new project real quick with just the basic stuff that you want to accomplish / find an algorithm for, and post a specific question. It's hard to understand what you mean, at least for me (disclaimer: I haven't read the RPG tutorials).

    PS: the image link doesn't work for me even with copy/paste; just google imageshack, dropbox, mediafire... if you want to share stuff.

  • That's a pretty vaste question indeed. For something like that to work fine, you have first to think about data.

    The system you want to build is based on lists of things (list of object, list of attributs per object, list of available character, list of attributs per character, etc.)

    So first you have to think how you will put that together.

    In my inventory, I don't take the character into account at all. (That wasn't asked).

    But I have a list of object system with a list of attributs per object.

    You can read my capx again knowing that :

    1/ The list of object is just formed by all the animation frame of the 'item' sprite.

    2/ The list of attributs per object is contained in a "coma separated values" (CSV) string I parse. The string follow the same format for all kind of object ("type,price,attack,defense,power").

    3/ The association between each line of the string and each object in te 'item' sprite is implicit. It's just in the same order.

    4/ I load these attribute in instances variable of each 'item' on creation. This way you can easily make them evolve. The list in the string is basically just the default values.

    You pretty much can use the same system for characters.

    Same sprite for all your character but you can build different animation for each one like : "Geo_Idle, Geo_Walk, DarkS_Idle, DarkS_Walk"

    You can then have an instance variable called 'name' that identify each instance and always call animation like that:

    Character.name&"_Idle"

    Character.name&"_Walk"

    The same way as items you can have a string with a list of default attributes like "job" or "race" and some items will be available depending on these attributes.

    In the end, you can also use my slot system to check if an item is allowed in some slot or not. You just have to add some other condition check by looking at your characters attributes like I just said.

    Anyway plan things beforehand. The thing to avoid in this kind of project is code repetition. When you find yourself copypasting same exact stuff for many different object, it means you didn't plan things well, and you probably should group these object in the same sprite or at least the same family (now that we have that).

    I know that my explanation might not be enough but as I said it's a pretty vaste subject that revolve around UI programming and data handling and I can't really do it for you. (:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok, I'll do the dropbox thing since it's the popular way to share capx files and the like.

    Sorry if I rambled and made it hard to understand, I have a tangential method of speaking. ^^; That's why I added the summary at the end. I'll likely have to make a new project for everything I want to accomplish until I can afford the software, due to event limitations.

    I've started a new project for the inventory, but my problem is finding what I want to accomplish in example form. There are things that might work, like Yann's example, but I have no clue how to edit them due to the complexity.

    I'm thinking that the best system would be one in which the inventory is populated, then when you click on an item it highlights that slot and spawns a few buttons. Equip, Destroy, etc. If the character can't equip the item, the Equip button isn't created, or it is created but on a different frame to add a little "No" symbol so the player sees they can't equip it. The concept I have pretty solid in my head, but I don't know all the little code snippets necessary to actually turn concept into reality.

    That's why I was hoping someone would be available to gradually learn this particular bit from. Once I learn that, I should be able to create a shop without much help, if any.

    <center>-=*****Response to Yann*****=-</center>

    How would you recommend I structure it? For example, say I want to test it by creating a sword, a bow, and a couple pieces of armor. What's the order in which you would recommend structuring the development? I like your method of using a single default "Item" as the placeholder for all. Would it work well if I structured the development in this order?

    1: Set up the different variables on the item such as type, character, attack, defense, cost, etc.

    2: Figure out how to spawn random items (to verify stats are called/applied correctly).

    3: Work on inventory placement and applicability (whether conditions are met to equip).

    I feel that's not really enough steps since I need to learn some of the stuff, not just implement it. . . hard part is, I don't know what I need to learn in order to put it in the steps. I have some knowledge of Python code, but it's far from extensive. Some of the things you did in your example aren't things I know of, such as "tokenat" or "loopindex" which makes it hard for me to understand exactly what that line of code is doing.

    I'll gladly look things up and try them out, that's how I learned as much of Python as I did. I just need to know what to look up.

    Also, since I've seen a bit of the relevant work you've done and value your expert opinion (as well as that of multiple other users), what's your take on S? This Thread Since I'm a n00b, would it be faster/easier/better to learn to use something like that, or learn all the intricate code to generate my desired results without plugins?

  • Dark Savant: S is a CC plugin, it won't be compatible with C2.

    I guess that for the "item structure data" you could set up an array, populate it on startup of layout (type of item, relevant common properties like strength, durability, and whatever you need as well a s a reference to the animation/animation frame which is your "visual representation" of the item) and on spawn of an item, you populate its proparties (instance variables) with adequate values from the array.

    Hope it makes sense.

    Oh and for learning C2, checking the manual can help, and for expressions like tokenat, refer to the system references (tokenat is a system expression).

  • Thanks Kyatric, I had a feeling S was sounding a little too good to be true. I liked the tutorials though, really good at learning exactly how to do something you want in a WYSIWYG as opposed to just hand coding it.

    I'm not entirely clear on a number of things. I know how to create new instances, but I don't know how to change a particular instance. For example, in my levelup system I'm using different text boxes for every stat, when I might be able to use instances of a single text box to do the same. I tried to get that work for hours, but couldn't figure it out. Another thing is arrays. I don't know the difference between using the X value and making instance variables. Can I apply different numbers to an instance variable based on the X value when applied? (that's kind of what it looks like Yann's doing with his item stats. X is set to the number of animation frames, and Y is set to 5 which is the number of different stats; though it's not quite the same since it uses variables in a separate object. . . I think).

    If I'm overcomplicating things it's due to ignorance, and that's why I'm trying to learn. I'm trying to tackle this one thing at a time. I got my levelup system working using my knowledge of variables and a couple tutorials, but this is beyond my experience which is why I'm trying to learn it.

    I think this project may be too ambitious for my current skills, so I'm thinking of shelving it for the moment. I'd like to continue working on an RPG so that I can learn those aspects applicable to it as I go, but probably need something simpler to get there. One of my friends has been coding since he was 4, and he says if a project is too ambitious you should shelve it until you learn some of what you're stuck on.

    Here is the capx of my levelup system if anyone was curious (with some of the later, failed, attempts at swapping characters partially applied). It was down to 18 or so events before I added in the character swapping mess. If you use the little button next to the "Need" box, that applies XP for testing the leveling system. Apparently, I'm going to need more than 4 layers if I want to do the 3-tab info setup too. . . Another reason to shelve it for now.

    I'm thinking of trying my hand at a side scrolling platformer with some RPG (level up or skill up) elements instead. There are a lot more tutorials on platformers, and if I can get enough done before hitting a wall I'll feel less douchebaggy asking for help. <img src="smileys/smiley23.gif" border="0" align="middle"> Any suggestions on where to start? Like, build a level, make the character move in it, then make obstacles, then make enemies, then make levelup, etc.? Thanks for any advice.

  • I'm not entirely clear on a number of things. I know how to create new instances, but I don't know how to change a particular instance. For example, in my levelup system I'm using different text boxes for every stat, when I might be able to use instances of a single text box to do the same. I tried to get that work for hours, but couldn't figure it out.

    This is all about how events work. Picking a specific instance is what makes the power of C2.

    You can find more discussions and capx about it in the how do I FAQ section "Picking/selecting instance(s)".

    The two currently last topics listed in the section (this and that) should answer all your questions.

    At least I think it covers the subject and should be a valuable reading.

    Also you can ask related questions in those topics.

    Another thing is arrays. I don't know the difference between using the X value and making instance variables. Can I apply different numbers to an instance variable based on the X value when applied? (that's kind of what it looks like Yann's doing with his item stats. X is set to the number of animation frames, and Y is set to 5 which is the number of different stats; though it's not quite the same since it uses variables in a separate object. . . I think).

    I made this capx as an answer <img src="smileys/smiley4.gif" border="0" align="middle">

    It's commented and hopefuly concrete enough to be useful.

    I also recommand you to check the how do I FAQ (same link as above) section "Arrays", the capx in this post should help too hopefuly.

    I'm thinking of trying my hand at a side scrolling platformer with some RPG (level up or skill up) elements instead. There are a lot more tutorials on platformers, and if I can get enough done before hitting a wall I'll feel less douchebaggy asking for help. <img src="smileys/smiley23.gif" border="0" align="middle"> Any suggestions on where to start? Like, build a level, make the character move in it, then make obstacles, then make enemies, then make levelup, etc.? Thanks for any advice.

    Ashley's tutorial about how to make a scrolling platformer game should and will answer all your question.

    It's still a WIP but it should get you started.

    Dark Savant: enjoy <img src="smileys/smiley1.gif" border="0" align="middle">

  • Dang, I just. . . let me prostrate myself here and. . . hold that forehead down for a few seconds. . . you're awesome. <img src="smileys/smiley20.gif" border="0" align="middle" />

    I'll be looking over all this for a while, lol. I've been using Velojet's platformer tutorial, but I'll definitely look through Ashley's and see what I can combine from the two.

    Btw, I loved that Mini-RPG demo, lol. I got to lvl 1100 in a few minutes. They fell like wheat to the scythe. <img src="smileys/smiley15.gif" border="0" align="middle" /> What I looked over in the code before testing it was helpful, so I'll definitely be referring to it often as I progress.

  • I made this capx as an answer

    Seem the link is broken

  • Crawnic: Seems the link is still working for me.

  • Strange. it does work.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)