VictoryX's Forum Posts

  • Oh sweet ya I usually use Googles Spreadsheet and export as a JSON from there. Or at least that is how I have done it in the past I haven't tried text file or xml before though.

  • This is freaking amazing, thank you so much for your help. What took me 68 events to accomplish you were able to do in 16 and really as you said your format is much more flexible.There is just no way I would have thought to do it this way even if I had gone back and refactored. It's awesome to see you even took parts of my idea with the tokenat and tokencount and re-purposed it in such a useful way. Love this community so much, ya'll always come through for me. Thank you so much again. I'll post again once I have an updated .capx working from your example.

  • So I think I figured it out using my above idea. Basically I have a check_Craft function that checks to see if the player can craft an item any time an item is added or taken away from the inventory. I use tokencount to find out how many materials the item needs to be crafted. So if the recipe value has 2 "|" separators I know it needs 1 material or if it has 4 "|" separators I know it needs 2 materials etc. Then I use tokenat to find out what material and how much of each material it needs. So far I only have it working for the sharp rock and it is just a text based thing that says if you can or cannot craft a sharp rock but I think this will work. Fingers crossed, the .capx above has been updated with my most recent code.

  • The limit is so large and at max by closing and opening the inventory you create 120 new UID's based on all the slots, an item in every slot, and each item there is a multiple so you get the number count. They would have to open and close the inventory millions and millions of times before reaching that limit. Even with every other object in the game you have to be creating something seriously massive to ever reach that limit.

  • So my thinking is this I can create a dictionary object for each key there will be a recipe name like Sharp Rock, Spear, Knife etc and for their values I will put in the materials and amounts needed to create that item with separators I can tokenat to.

    That way when the inventory is opened i can run through the entire recipe dictionary see what materials and how much of each I need to create that item if I have it in my inventory then spawn the crafted item on screen so that I can click it to craft it. What do you guys think? Sound like this will work?

  • So I would like it to work like this, when the inventory is opened, slots will show at the bottom of the screen that contain all the different items you can make based on the current items in your inventory. Some items may require you to be standing by a certain in game object like a crafting table or furnace to show up in the list. It's basically a rip from Terraria's crafting mechanics.

    Subscribe to Construct videos now
  • Little bumpski, hopefully someone might have an idea I still haven't come up with a good approach to this.

  • This can also happen if you have an image named "ad" or "advertisement". If someone has an Ad Blocker on their browser it will see this image as an Ad stop it from downloading and cause your game not to load. Food for thought in the future.

  • You should be using an instance variable for the tank health instead of a global variable. So to do this select the tank sprite and on the left in the properties click the blue text instance variables create one called health and start it off at 100. Then when a bullet hits it subtract 20 from that variable once the variable hits 0 spawn an explosion and destroy the tank. .CAPX attached.

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

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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