VictoryX's Recent Forum Activity

  • So I just finished my inventory system and am looking to move forward into a crafting system. However I just can't wrap my head around how one would work and I haven't found any examples online. I read online that you can treat it like a monetary system. You want to buy a sharpened rock you pay 2 rocks and get the upgraded item. You want to buy a knife you pay 1 wood, 1 sharpened rock, 1 vine etc. I can't figure out how to store the prices/recipes of the crafted objects then check that list to see if the player has those items in their inventory to make it. Could anyone explain how this might work or even throw together a simple .capx combining multiple items to create a single item? Below attached is my .capx for my current inventory system.

    Inventory .CAPX

    https://dl.dropboxusercontent.com/u/729 ... ntory.capx

    WSAD - MOVE

    TAB - Toggle Inventory

    LEFT CLICK - Select Inventory Item

    LEFT CLICK OUTSIDE INVENTORY - Drops selected item

  • Thank you very much for the feedback. I updated the Item name so it always pops up in the same spot now for the item you are hovering in your inventory. I also added a remove item feature. If you have an item selected and click outside of the inventory area it will drop the item into the world. It should also track the amount of the dropped item so if you drop 10 rocks when you pick it back up you will get 10 rocks. I went for the create/destroy method because later on I figure there will be a lot of stuff on screen and I didn't want an inventory of items taking up memory while being un-used. You are correct about the UID increase, but I never use the UID to track stuff anyways.

  • So this is something I have been messing with. It's an Array based inventory that is created and destroyed every time it is opened or closed to save on memory usage. I made it in the style of the Terraria Inventory because that is one of my favorites. So far you can pick up items it keeps track of them how many of each you have. You can click and move items around in the inventory. The next feature I will add is the ability to drop items. Then after that I want to move onto a crafting system which should be fun. Link to check it out below as well as the .capx if anyone wants to poke around and see how it works or use it in their game.

    CONTROLS

    WSAD-MOVE

    TAB- Toggle Inventory

    LEFT CLICK- Select item in inventory to move it.

    Game Link

    https://dl.dropboxusercontent.com/u/729 ... index.html

    .CAPX Link

    https://dl.dropboxusercontent.com/u/729 ... ntory.capx

    If you have clicked on the link before you may have to refresh once you get to the game to the get the most recent build.

    If you mess around in the .CAPX and are able to streamline the code or fix any redundancies please let me know so I can make it more efficient.

  • I figured it out now my bad yall. So because I was destroying the box at the begining the code had no box with which to reference a width so they just all spawned on top of each other. Basically changed it so they spawn at arr_Inventory.CurX*50+32 instead of the arr_Inventory.Curx*Inv_slot.Width+32. Now it works as I thought it should and has some good spacing on them. The .capx has been updated.

  • Okay so I tracked down the issue. For some reason if I destroy the first instance of the Inv_Slot during Layout startup the boxes will just spawn on top of each other. If I leave that initial Inv_Slot object though it works. Not really sure why this is. Anyone have an idea? Also one last question on this is there anyway to create spacing between the boxes so they aren't all touching each other?

  • Here you are good sir or madam. It's in the group New Inventory, I had originally started making an Inventory based on a Dictionary object but decided to use an Array instead. https://dl.dropboxusercontent.com/u/72974151/Array.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So im getting into arrays and after looking at some stuff online I found something to spawn a bunch of boxes in a row from an array. Sadly though whenever I run it, it just spawns the boxes all on top of each other.

    Any ideas of what im doing wrong here??

    EDIT: The issue has been resolved and the .capx linked below updated if anyone cares to check it out in future. Thank you for all the help!

  • So it's been a bit over a year and I finally have free time to continue this project. Below you will find a link to the .CAPX of where I left off if you'd like to fiddle with it or have ideas for streamlining the code. Ill post again once I've made some more progress.

    https://dl.dropboxusercontent.com/u/729 ... manV1.capx

  • Use Google Sheets, you can export the data as a JSON and load that JSON into a dictionary object. It can take some time to get the formatting correct for the JSON, but once you do it is supremely helpful. That way if you ever want to change questions or add question you can edit your excel sheet export the JSON and replace the old JSON on your server.

  • Did some more work on the character select and I think I got it working now as it should. Sadly as I said before I only have two Gamepads so I can only test with 2 players. I still need to go through the code because I'm sure there are some inefficiencies in there and probably some redundant stuff. Once I get it all the code working tip top and looking nice i will post a .capx for anyone else wanting to do this.

    Added Character Previews

    Selector now goes back to the beginning if you press right on the furthest right character. Vice versa for left.

    Added Sounds

    Fixed some buggy crap

    Same link above still works, may have to refresh a few times if you opened it before to get the most up to date version.

  • Create BG Scroll box Image the size of the area you want your image to appear.

    Create your FG scroll image, the image that will be scrolling.

    Put them into a new layer and set the layer Force Texture to Yes

    On the FG scroll image set the blend mode to Source Atop

    For the FG scroll image add the behavior drag and drop.

    In the drag and drop settings set it to Horizontal only.

    If you want it to only scroll so far left or right.

    Set events that say if FG Scrol IMage X is > than Far Right number than set FG Scroll Image X to The furthest Point right.

    and Vice Versa for Left

  • Layout

    Add a File Chooser Object

    Add an Empty Sprite

    Event Sheet

    On File Chooser Changed - Image Sprite - Load Image from FileChooser.FileURLAt(0)

    Select Resize Sprite to Image if you want.

    Done

VictoryX's avatar

VictoryX

Member since 29 Aug, 2013

Twitter
VictoryX has 1 followers

Connect with VictoryX

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x4
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies