lionz's Forum Posts

  • Ah yeah sorry. on the Contains value itemname comparison in HUD change the value ItemPosition.IndexOf(ItemName) + Quantity to ItemPosition.At(ItemPosition.IndexOf(ItemName),2) + Quantity.

    I think that auto fixes the other problem too ?

  • The opposite actually as it only loads what is in the current layout. Putting everything in a single layout is where you would have the performance issues, though I believe there is something where you can unload graphics that are not being used if you prefer to do it that way.

  • Do you mean a patrolling enemy that changes direction when it reaches the platform edge? You can put invisible sprites at the end of the platform, when it touches one of them toggle a boolean that relates to simulating left/right on the enemy platform behaviour.

  • When asking for help please mention the actual problem you are having

  • Yeah that's the best idea unless it makes more sense to change the background in the same layout and spawn objects based on stored co-ordinates.

  • You should be able to use indexof "0" since you used that for empty slots, so at the top of the add item function set cur slot ID to array.indexof("0"). If you have a problem you can send the file again.

  • I would expect that to work for the next new item, I guess it breaks for the one after that because it could overwrite the next. If you do the above in my recent post for calculating cur slot ID then it should all come together, there will be no need to set slot ID when you delete the item or add 1 to it, it will just go to the first empty slot each time (assuming that is how you want it in the game)

  • I was saying that when I pick up an item, it was added to the empty slot, but when I pick up a different item, it doesn't appear on the next empty slot.

    That was working in the file I shared though right ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can imagine a problem but it doesn't sound like what you described. Because you are always adding 1 to the slot ID and then using this as the next empty one then deleting items in the middle won't work so I can see that you need to rework the empty slot ID logic but you said the problem is its always added on the slot of the deleted item ? So is that what you meant that it doesn't find the new empty slot ?

    To rework that logic to find the empty one you can rather than add 1 to curslotID, add an event to set curslotID to the first column that has 0 amount... so for each x if no item name at curx,0 then set that x to the curslotID. You can add this to top of the function before the other checks.

  • Better with a global variable. The local won't retain it's value so it's going to revert to false.

  • On the tilemap bar use the load icon to import the tmx

  • Yes the first event where you say to set to animation frame 0 whenever you click on them.

  • Ok I tidied it up a little and got it working, take a look here dropbox.com/scl/fi/11t8l53k64av4tggggihq/game_edited.c3p

  • And where can I test picking up items ?