lionz's Forum Posts

  • Use 2 blocks/sub events : multi = 0, Else multi=2 and is host.

  • You can press S to create a sub event and add 'is host' there

  • make sure the correct event sheets are assigned to the layout.

  • So is it working ? I think the recipe bit should be a bit shorter but I'm just doing it from reading. Like in recipes indexof crafting icon name + column should be enough and the column would be different for item 2. If you have done recipe in the format (name,ingredientA,quantity,ingredientB,quantity) columns would be 2 and 4 for example.

    Also for quantity where you're subtracting it looks ok except don't look for index of the items as they may appear in more than one recipe, always look for the index of the item name you are crafting which is the start of the recipe.

  • Here is a screenshot of what I mean

  • Well again it needs to be much simpler than what you have, you don't need so many loops and you don't need variables to track next available x and y. Also be careful using loopindex("x") as the x is for the name of the loop which you don't have.

    You need a simple system 'for' loop, for from 0 to array.width. This runs down all the rows. Then with this the condition array.at(loopindex,0) = 0. Then on the right side actions, you have Stop loop, and set the other columns to what you want so for example set array.at(loopindex,1) to an item name, array.at(loopindex,2) to an item description.

    So yeah that's all you need to set up what you want I dunno how I can make it clearer than this :D

    Also you never posted what the array looks like but make sure the empty slots are actually 0 and not just lacking any value so it would be "" instead of 0 if that's the case.

  • Lets see the new events?

  • You could use a variable for total number of mines and compare it to number of Cells where text = []. That means you've won I think, if there are x mines and you have x cells of text [].

  • I don't have a sub right now and I'd need one to assist again on this but basically what you are looking at is the 'canCraft' section which for the moment only checks if the item is in the array. You'll need to add a quantity column to your recipe on column 2 where 0 is the item and 1 is the first ingredient add the quantity required on your sheet. Then on 'for each craftingicon' you'll need to check as well as item1 appearing in the inventory that you also have enough quantity in your inventory required for the recipe. You'll need to grab the index of the item in your inventory to check the quantity against the recipe quantity value.

  • 1. You can enable/disable it in the create event or use the condition 'on created'

    2. You can use one event sheet and right click > 'include' that event sheet in other ones to avoid repeating the events.

  • 'for each array' is not looping through the array, this is to pick each instance of invarray of which you have 1 so it is not useful here. You are probably looking for 'for each element' which is a loop on the array object, but the system one I mentioned can also work well. You were never looping the array that's why all your objects are set to 0 position.

    "Or I'm just overthrowing this at this point and should just delete the 6 lines of code and start over with a simply system or a suggested replacement??"

    - Yes, keep it simple like I described above. You were never looping the array so first do this and see where your game is at, then you can come with questions from there when you are able to pick up an item and add it to the next empty slot.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just create a system loop for 0 to array.width, then a sub condition system compare 2 values if array.at(loopindex,0) = 0 (is empty), then stop loop and add the item there with actions.

  • You didn't mention what the incorrect outcome was but I think I see a problem that I also came across. So in the array sheets the rows are actually Y and the columns are X, so the reverse of the array. In the sheet you have to put the data in rows as columns and columns as rows. When you look at your array in debug view, the data will not be what you expect where columns are at X and rows are at Y, I think ?

  • You'll need variables on the invslot for type and also on items for type. Then it is just a case of adding more conditions to your drop event. I would probably split them out by type so they don't become convoluted so one event is for weapon item on dropped so this only handles weapons : on items dropped (items.type=weap), sub events if invslot.type=weap and is not full then drop it, Else if invslot.type not equal weap or is full, then send it back. Then you can create a different event for drop items if item.type=armour etc

  • can you show us what the array looks like in debug view runtime? thanks