lionz's Forum Posts

  • You can add it to the press space to open inventory event so it triggers once.

  • One way is to have invslot with single frame animations of all the items with matching names, add the variable for array location like I did with the text object in the example, then you can set invslot animation to array.at(self.ID)

    Another option is to create object by name and every time you open the inventory, for each invslot create the object for invslot.item on top of it. That could work well if you are using a drag and drop approach to swapping items. If you are using arrow keys to select them then I would go for the first option.

  • Ok I had some free time I made this quick one. You can see how it adds items to the array and stacks them, and also how you can remove them.

    dropbox.com/s/7s8b2gx1xq9xl4v/inv%20array.c3p

  • If you put the sprite and box in a 'container', whenever you create the box it will create a sprite with it, then they know and relate to each other. Instead of container you can use other methods like sprite is overlapping box then pin.

  • Use one event, on double tap. With sub event, animation frame = 0, Else animation frame = 1. Make sure you use the system else.

  • It also feels like you have more control if you view it in debug preview. You can see what the array contains and what's changing within it. I just think of the items as a list, X rows at column Y=0, the same as a spreadsheet. Then at the other columns you can add more data like amount at Y=1 etc.

  • I would definitely use arrays, it's so easy. An array is just a list of items and you can see what's going on very easily with what you've collected. You can use simple conditions like when you pick up an item, check if the array contains the item, and add 1 or stack it.

    In my opinion it's more difficult to make an inventory without an array and if you are new with the software you will likely come across bugs that you don't know how to fix. Checking if a certain item is overlapping another item to be able to pick it up etc. This can all be avoided with a simple array.

    Array items are rows, X=0, X=1, X=2. Pick up an item, check if array contains item, if not then push to the back of array. Second column could be amount collected so you can stack. Easily display the array items in your game : give the inventory slots instance variable IDs that relate to the array rows - for each slot set slot.item to array.at(slot.ID).

  • Yes under the object conditions, pick nearest instance. Did you check?

  • A bug of the engine itself hmmm

  • You can add a timer behaviour to an object, perhaps the one with the ability. Then on key pressed start the timer for X seconds. Then on the key press event you can add a condition 'timer is not running', which means key press won't work again until the timer finishes.

  • It'll be something to do with your events but we can't see them. Check that the function is not being called constantly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Some of these conditions can be true at the same time. The first two conditions overwhelm any other events. The is blocking event should also specify not moving. The is moving event should also specify not attacking and not blocking etc.

  • Jump button is down : simulate control jump

  • You do not have permission to view this post

  • Yep sounds good :)