lionz's Forum Posts

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The logic looks good, do you have other events that affect the animation or frame?

  • Looking at the conditions maybe it needs a bit of work, I think some are not needed. Feel free to share the file and I can take a look

  • Have you tried the typewriter setting on the text object? That works quite well for what you're describing. What is the flowchart? I guess that's where the problem lies because it is already a string.

  • That should work if you do it in that order, the one you posted was in reverse converting it to a string in a variable and then trying to set text with variable. Also what is the importance of the variable, can't you just set text?

  • I don't think it'll recognise loopindex(i) so probably keeps returning 0. I would instead continue using array.curx for the row