Zebbi's Recent Forum Activity

  • I do that all the time. I, by instance, always group a condition and its else under a blank one.

    I think that the readability beats any minor drawback.

    Not advisable for people with the free version, amount of events run fast out of the max allowed.

    Yes, I think I really understood ELSE statements when I started using sub-events, I think subs are my favorite feature of C2, not to sound like a total nerd! :p

  • I've just put three conditions I want to keep together nice and tidily in a blank sub-event, there's nothing in the parent condition, just three conditions as sub-events. It works exactly the same, but, is there any possible drawback from this practice? It looks nice and it's a bit cleaner for what I'm doing than using groups.

  • if you want to delete all "Badge" cells from inventory use

    indexOf() delete only first "Badge" cell

    ..I assumed that there is only one "Badge" cell on unknown index

    Yes, there should only be one of each, but I'll keep this in mind if there's duplicates, thank you!

  • I got it working, but seems to leave duplicates of other items in the array? Does delete remove the entire cell, and not just the value?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • try:

    Hmm, afraid that doesn't work either, I'm re-running the loop afterwards, but the item is still present in the invetory after clicking.

  • Hmm, tried this:

    Doesn't work though?

  • I'm following this idea:

    Hey Joel, here are some of the key things that helped me build an efficient inventory with an array.

    Create only one sprite for the inventory items, this sprite should have a different animation for every item in the inventory with an appropriate name. Let's say that you have 8 visible slots in your inventory. At the start of each scene create 8 instances of the inventory item, even if you're inventory is bigger than 8 slots, it's only about the visible slots. Position each of these items in the appropriate place, I create an image point in the inventory bar animation and set each sprite to that position e.g: create object 'invitem' on layer GUI at 'InventoryBar.ImagePointX"item1" etc. etc. Then run a function that fills the items to correspond with the array. Here's mine:

    So this first sets a variable stored in my inventory array to 0, then for each instance of my inventory item sprite it sets the animation to whatever is in the array at the value of this variable. For example if the value saved into my array's X at 0 is "Hat" it will set the animation to "Hat". Just make sure you've create an animation called "Hat" and it will work. Then it adds 1 to the variable, so the second time it runs this loop it will set the animation to whatever is in the array's X at 1. If the value is 0 this means the slot is empty and it sets the animation to default, i.e. an empty picture.

    Moving the inventory left and right isn't too difficult. You create a variable, lets call it invScroll, and you add 1 to this variable when the left key is pressed and subtract 1 when the right key is pressed. You also run a function after changing the value of invScroll, i.e. every time you press left or right. This function is almost identical to the one above for arranging the inventory, except instead of: set animation to Inventory.At(Inventory.item) it will be set animation to Inventory.At(Inventory.item+invScroll)

    Hopefully that makes sense and is enough to get you started!

    Now, this is okay, but this assumes you'll have every item appear in a fixed place *I THINK*. I'm not sure entirely, and I'm not sure if this is the best practice for building an array for an adventure game inventory system, but this example does work, I'm just not *QUITE* sure how to, say, push the array to the right to add the new item to the start, similarly, a cell would need to be removed if an object was used. Can anyone just clarify these couple of points and if this is the best way of building the inventory?

    EDIT: Yes, I've just made sure I INSERT the item in the array:

    Now, I'll need to figure out how to grab the correct cell for destroying it from the array when it's used/given awayetc.

  • Is there anything yet that could do this?

  • Zebbi

    The tool just isn't meant for pixel fonts. Sorry.

    No problem, are there any spritefont tools that would do a C2 compatible pixel font?

  • blackhornet I'm trying to make a spritefont that has the height of 7 pixels on the lower characters using the outlined version of this font: http://www.dafont.com/onesize.font but it always comes out missing bits, and I have to use version 1 to do it without anti-aliasing. Any idea how I can get this done?

    Zebbi, wow...

    Man... You probably shouldn't have told me that, I might not even take time to make a C exporter now, might just make a Fusion exporter.

    I think new Fusion 3 will be running the games as close to C as it can get (instead of currently how it just embeds the runtime), so there shouldnt be any need when it comes out for additional exporters, C2 would on the hand benefit from some way of running the games similarly.

  • Coming up on 100-500 installs, fair reviews, anyone knows of a game with a similar mechanism, I'm keen to know, the graphics are meant to be lofi

Zebbi's avatar

Zebbi

Member since 20 Jan, 2014

None one is following Zebbi yet!

Connect with Zebbi

Trophy Case

  • 10-Year Club
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies