How do I fix my Inventory Problem

0 favourites
From the Asset Store
Template for maintaining an inventory with crafting possibilities. Completely documented in text and video.
  • Imma have to redo it I think. Gimme a sec

  • codah Heres a new one.. Hopefully works for u.

  • Sorry couldn't wait so try this one. Hopefully it will demonstrate the inst var thing. But I'm on my way out soon so good luck.

  • Yer. Srry it took so long.. Imma try my best. Little by little I'm learning everything I need lolz. I appreciate all the help.

    Edit: Noticed if a Object is put over another object.. In slot. It Overlaps :/

    Edit2: Tried fixing it.. I think I made it worse XD

  • Unnatural20

    codah

    Ok have a prob now. I recently tried changing things up a bit. I changed it to when I drop something. I can pick it up again, and so it doezn't pick up EVERYTHING I have it pick top instance.... Anyways. When I pick something up again it changes. I noticed that with the new item frame code fix it changed "item name" to frame number... which just resets it to 0. Its odd. Imma give my full .capx.. Its in the Event sheet called Game Events... and some is towards the middle, and rest bottom. Hopefully it can make sense to someone. If u find anything else wrong with my .capx in general I dun mind tips lolz. Im making a Farmming game in case no one knew. I have ALOT that probs need to be fixed, and added etc. Itz slowly comming together. Any help is appreciated.

  • The problem I see is in Event 131, under ">Mouse -> On Left Button Clicked on ObjectsDisp"

    You have, "Inv -> Delete index Inv.IndexOf(ObjectsDisp.ItemGroup) from X axis."

    This can delete the intended object, , or it might instead remove another object with the same item group. However, you always *create* the right kind of object, so you could (as the demo stands) end up with two hoes or two hammers.

    My suggestion: Give ObjectsDisp another instance variable named "SlotNumber".

    Then, in refresh inventory, Inv -> For Each X element (Event 128 or so) add ObjectsDisp -> Set SlotNumber to Inv.CurX.

    Then, in place of what you had, Inv -> Delete index ObjectsDisp.SlotNumber

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok thanks.. Took a while but I got it working. i was doing some things wrong at first

    Unnatural20 Ok for some reason "ToolName" is being set to 0 in the Array. So when I check for like "Hammer" it can't find it because there is no hammer its 0.

    codah Maybe u can see what I'm talking about

  • Bump.

    Edit its the Objects -> ItemGroup = "Tools" Toolnames.At(Objects.AnimationFrame)

    Bit. It changes Toolname to a Frame number.. Which always becomes 0. It need to be a String Text.. Hence ToolName lolz

    Edit2: Fixed it.. Had to set The Toolnames array width to 0 XD

  • Bump.

    Edit its the Objects -> ItemGroup = "Tools" Toolnames.At(Objects.AnimationFrame)

    Bit. It changes Toolname to a Frame number.. Which always becomes 0. It need to be a String Text.. Hence ToolName lolz

    Edit2: Fixed it.. Had to set The Toolnames array width to 0 XD

    good you got it working

  • codah

    By chance have u seen my other post with my other issue lolz. Any idea on what I can do?

  • Bump Bump

  • .>

    What problem are you currently having?

  • Unnatural20 Still trying to figure out the use of One object thing. Like codah was talking about. Still having problems with it. I think imma have to change quite a bit of my events to get it to work O.O

  • bump

  • It's just difficult going through that capx.. I can't spend the time on working out what's what in there and others probably as well. If you could do a small clean .capx you'd have more chance of people helping. All I was suggesting was having a simple instance variable to say whether it's currently an item in use in the game, or that it's being used for inventory purposes. And you check that whenever you need to use the object in your events (i.e. when picking). If you can't get that going perhaps I could knock up something separate to your capx.

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