gumshoe2029's Forum Posts

  • Right, but the loop is not the problem. The inventoryArr is. You need to master control of that first.

    If you pipe it out to a text object every tick, I guarantee you will have rogue entries in there. Then you just need to figure out where they come from. Usually, the timing will help with that, as you can see them appear in real time that way.

    Did you put that condition on the click event?

    Another way to debug is to disable events and see if that affects it. That is what I am doing right now to track down a JSON-AJAX bug.

  • Not without a server between them or a peer2peer connection (like the Multiplayer object).

    Here's a request for C3 : auto-complete when calling functions() names.

    That already exists...

  • You should make a debug Text object on your screen and output "InventoryArr.AsJSON" to it.

    The inventory array is the sole determiner of the contents of your inventory.

    If it is blank, then you can track when it is getting items added to it and see why.

    When you open an empty inventory it should look like:

    {"c2array":true,"size":[0,1,1],"data":[]}[/code:gtu1old7]
    Otherwise, you will get rogue items appearing in your inventory.
    
    That was why I added my debug text objects also, because I had some issues getting the example to work properly.  Do a search in your C2 for "InventoryArr" and find anywhere you are pushing objects to the array; those are where your problems will be.
    
    Also, be aware that you can still click on your "Equip_chest" even if it is 0 opacity or invisible.  So you should probably put another condition on that event, like:
    [code:gtu1old7]If Equip_chest is visible[/code:gtu1old7]OR[code:gtu1old7]If Equip_chest opacity > 10[/code:gtu1old7]
  • You do not have permission to view this post

  • Make your sound files smaller?

    Also, that should only happen the first time because most browsers will cache sound files.

  • The URL of your game is the address that you have it posted to.

    In order to do what you are asking, you have to have a server-side application talking to a database or cache.

  • You can dynamically scale all of your assets to fit any screen.

    https://drive.google.com/open?id=0B-xiq ... 0lDRklrNVU

    A curious side effect of this is that it effectively disables the ctrl-mouse wheel zoom in a browser.

  • Make sure you InventoryArr is cleared and set to 0 X-size (Set Size 0,1,1) otherwise, the array value defaults to 0. Also, make sure you destroy all of the items sprites upon entering the inventory so that you display loop can work with a clear inventory.

    I actually had the same problem when I was testing this capx too.

    Another option is to exclude the 0 index from your items array and put a condition in your loop that bypasses any 0 values.

    all the other items that i create are being created and deleted so fast that you can't even see it being destroyed and created again

    I am not sure what this means?

    Keep in mind though, that every global event will run every tick (or as fast as possible); so if you have an unconditioned destroy event, it will continually destroy your items.

  • I don't think that would do it, because I don't want it to look like the player is teleporting, just as if they are still moving along the seamless world. Also, this would misplace the enemies. If I have to teleport the player, the enemies would lose sight of the player's ship when he's crossing the imaginary teleport line

    Then just create more map as they approach the edge of your current map. As long as you control the visuals of the seams, it will appear seamless.

  • You have one Array (I'll call this ItemsArr) that contains all of your items and one Array (I'll call this Array InventoryArr for this post) for your inventory.

    When you want to add a new item to your inventory you push the item Id from the ItemsArr to the IventoryArr, like:

    IventoryArr: Push to front: ItemsArr.IndexOf("potion")[/code:293mmz1k]
    
    Then you loop through your InventoryArr again to display the new object in the inventory.
    
    So for example, let's say your ItemsArr looks like:
    
    ["potion","sword","armor","cape"]
    Idx: 0________1_______2_______3
    
    and your inventory array has a sword and armor and looks like this: 
    
    [1,2]
    
    When you use [code:293mmz1k]IventoryArr: Push to front: ItemsArr.IndexOf("potion")[/code:293mmz1k]
    
    Then your InventoryArr would look like:
    
    [0,1,2]
    
    If you then use [code:293mmz1k]IventoryArr: Push to front: ItemsArr.IndexOf("cape")[/code:293mmz1k]
    
    Your InventoryArr would look like:
    
    [3,0,1,2]
    
    Then to display items, you loop through your InventoryArr and pull items from your ItemsArr using the item IDs stored in your inventory array.
    
    The 5x5 is only a display change, not a fundamental data structure property.  So you would address the 5x5 property in your display loop using a row variable and incrementing it every 5.
    
    Like this: [url=https://drive.google.com/open?id=0B-xiqKTWbBrfZktIajB6ZmtoaVk]https://drive.google.com/open?id=0B-xiq ... jB6ZmtoaVk[/url]
  • NAME: Set Text: List2.ItemTextAt(RANDOMNUMBER)[/code:1bu2f5hl]
    
    Except that you will occasionally get null, since you are using SMALLEST to BIGGEST+1, and BIGGEST and BIGGEST+1 will never exist, because the List2 indices start at 0.
    
    You can condense all of that down to one row though:
    
    [code:1bu2f5hl]NAME: Set Text: List2.ItemTextAt(floor(random(List2.ItemCount)))[/code:1bu2f5hl]
    Like this:
    [img="https://s23.postimg.org/x1wuang23/image.jpg"]
    Note: The floor might mitigate the index issue at the top.  So it might be round(random(List2.ItemCount-1) or floor(random(List2.ItemCount)) try them both.
  • Also, your Push events are not subsidiary to your loop. They are on the same tier as, so they will only happen once on the button push.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can't you just use the "Push" function in the Array object? That pushes a value to the 0 index of the array.

    Also, what is "Array" is that you item list, or is that your inventory?

  • https://docs.google.com/forms/d/e/1FAIp ... w/viewform

    For now, the results of this form will only be made available to the Tigris Skype group. Currently, in this Skype chat there are around 126 indie and non-indie game developers across a very wide variety of genres, so you will very likely be contacted if the genres that you select match what is being developed.

    I'll figure out some way to parse this information and make it more broadly available without destroying everyone's privacy.