Search Unity

Pokemon rpg inventory

Discussion in 'Game Design' started by dannyboy178, Aug 14, 2018.

  1. dannyboy178

    dannyboy178

    Joined:
    Jul 26, 2015
    Posts:
    14
    Hi sorry if I posted this in the wrong place.

    I am looking to find a solution to making a rpg inventory system.

    Problems im having is I can't seem to get the keyboard to work with scroll rect. I've googled myself out on the problem and hoping there is an asset out there that could accomplish this task.

    Please let me know I will be forever grateful if I can find a solution.
     
  2. Shayke

    Shayke

    Joined:
    Dec 8, 2017
    Posts:
    352
    You can check the asset store but why would you give up?
    If you can't finish that thing you wont finish harder things.
     
  3. dannyboy178

    dannyboy178

    Joined:
    Jul 26, 2015
    Posts:
    14
    True you maybe right. But I feel like it's a limitation of the engine. Maybe I just don't understand it.

    I haven't given up im just looking for ideas. I need an inventory that's manageable via keyboard and it seems difficult to implement or impossible. Using the GUI system.
     
  4. SirTwistedStorm

    SirTwistedStorm

    Joined:
    Sep 20, 2015
    Posts:
    192
    You want an Inventory like the pokemon gameboy games? If so it's doable and there have been tutorials on it since 2014 if you keep looking.
     
  5. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    The basic idea is to set your canvas from constant pixel size to scale with screen. Then set up your scroll rect the way you want it to look. Use Layouts on it to make sure the content of it is properly put in order. In you code you'll want to reference your Event System. Event System has the ability to SetSelectedObject. In your code, set this to your first button in the scroll rect. as long as each button has navigation set correctly, you'll be able to navigate your menu with a GamePad or Keyboard like how Pokemon would allow. This is how I would accomplish this.
     
  6. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    Another way would be to handle it all completely in code. Have each item be referenced in a list. Then set it up to say If you press an axis a certain way it goes to the next item in the list. From there you can set it to say change the color of the selected object and you would get the same visual results as what I said above except it's all handled by code. This would ignore the event system all together and to activate the buttons you could use buttonReference,onClick.Invoke() to call whatever function you had on the button.
     
  7. dannyboy178

    dannyboy178

    Joined:
    Jul 26, 2015
    Posts:
    14
    Thank you I think I may do alot of it in code. Also I found an example game I might look into how they did it.

    I feel like it's doable I just had to rearrange the GUI a little. I got it working in a scollable format with the keys now. So am pretty happy. Now just to make it dynamic like a real inventory system.

    Thanks for the encouragement
     
  8. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    Everyone starts somewhere. Glad you got an idea on where to go now.
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,203
    It's definitely the latter. You're nowhere near running into the limitations of the engine. A quick search for creating Pokémon inventories turned up the following framework on Github. It's incomplete but it appears to have entries for the player's bag if you wanted some reference material for building your own solution.

    https://github.com/PokemonUnity/PokemonUnity
     
    Last edited: Aug 15, 2018
  10. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    580
    That's actually a really cool project in general.
     
  11. dannyboy178

    dannyboy178

    Joined:
    Jul 26, 2015
    Posts:
    14
    Yes I did find that. That's when I got hope. It seemed really complicated to me. But it is using the old gui system.