LittleStain's Recent Forum Activity

  • Do you have objects/sprites to display your inventory?

    if so, set them visible when displaying the inventory and set them invisible when not displaying the inventory..

    for example:

    create a global variable inventory

    on key i pressed

    system set variable inventory : 1-inventory

    variable = 1

    set all objects that create the visual display of your inventory visible

    variable = 0

    set all objects that create the visual display of your inventory invisible

    The visual display could be sprites/tiled-backgrounds/text-objects etcetera

    Now all you have to do, if you want to display the amount is set the text-objects to the variable number and you are ready..

  • I don't know what you would like your inventory to look like..

    Maybe you have animationframes to show how much/many of an object you have, maybe you'd like to use text, etcetera..

    Simply put, something like this:

    First you check if you have the object(s)

    (Variable > 0)

    If so you make a visual representation of that object and its value

    create object (set object visible)

    set text to Variable

    else

    destroy object (set object invisible)

    set text to ""

  • Save AsJson is an action for practically every object in Construct2..

    PS: please use local storage, not webstorage..

  • Your hero does run but doesn't move forward?

    Do you want to add speed for a certain amount of time?

  • So:

    Monster on destroyed

    monster spawn object

    Player on collision with object

    destroy object

    add 1 to global variable Objects

    On button clicked

    text set text : "objects in inventory"&Objects

    If you want to visually display the inventory, you should first make the visual display..

  • 2x2 slot inventory.

    Just one for now.

    Yes, and they stack on top of each other, saving inventory slots.

    Run over object to pick up.

    I did forum search, but alot of it directs to array, "poorly" made/worded array inventory guides.

    But I am yet to find one that is worth learning from.

    All of them are worth learning from, even the bad ones..

    They will give you understanding in how Construct2 works..

    So it seems you want something like:

    player on collision with ammo

    • System add 1 to Global variable Ammo
    • Ammo destroy

    Or maybe you'd like to use instance variables on the player, but it would work the same..

    All you'd have to do than is to create a visual representation of the values of the variables..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What kind of inventory would you like?

    How many kinds of objects are there?

    Could you hold more than 1 of those objects?

    How would the player use those objects?

    There are many examples on the forum as well, did you try a forum search?

  • Pawprint, can you reupload the capx file...i can't download it

    If you look at his profile, the user you are asking to upload hasn't been on the forum in 2 years..

  • Ok that's interesting. I changed the System Compare Frame to FamCard Compare Frame, as you suggested. Now the very first flip does work on the card hovered. But then subsequent flips work on another (not the one hovered) card. So I'll say that's a good step.

    Also, I think we're disconnected on the UID question. Will all Card.UID values be the same on each player's running instance? We could assume that every player has the exact same version of the exported app, but it's possible they may not. How can UIDs be guaranteed to match for all players

    ?

    Why would they need to be if you are only using it to reference an already picked object?

    for example:

    on object clicked

    call function with parameter object.uid

    will always call the function for the right object, regardless of it's uid..

  • GUID comes from an Xml data file. Are we 100% certain that UIDs will always exactly match on multiplayer games? My assumption is no, so I went with the GUIDs that I am 100% sure will match.

    In this case you are calling the UID from a picked instance, so yes, the UID will absolutely reference the same instance..

  • Also, if you're sure it's the GUID compare, I'm in trouble. I have this compare in every single function and event. A hundred places probably. So System compare cannot accurately pick object instances by a var?

    System compare doesn't pick

    System pick by comparison, does pick..

    So you should change the system compare event checking the animation-frame with a famcard compare animationframe event..

  • LittleStain wait so if the colors were animations, would a slider bar help????

    Help with what?

    A slider bar is just a UI-element..

    If you want the player to use a slider bar, you add one..

    In my opinion UI-elements should be straightforward and easy to understand, so if you have for example 5 colours to choose from, I wouldn't use a slider-bar, but you are the creator..

LittleStain's avatar

LittleStain

Member since 26 Apr, 2011

Twitter
LittleStain has 4 followers

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies