dop2000's Forum Posts

  • Also, your chances are confusing. The first three cards have 100% chance, right? So whatever the chance value is, only the first card will always be picked.

    Or did you mean that the card should be selected at random from the entire array, but the smaller the chance number, the less likely it will be picked? In this case you need to use the Advanced Random plugin, its probability tables feature. Create a probability table with card indices and their chances.

    You can actually load the whole table as a JSON string. Then use AdvancedRandom.weighted expression to pick a random card (its Y-index in the array):

  • It's usually done with a family. Add the sprite to a family, move all behaviors and instance variables to the family level. Then you will be able to pick two instances and refer to them separately, for example:

    OilDerrick has LineOfSight to OilDerrickFamily
    OilDerrickFamily pick nearest to (OilDerrick.x, OilDerrick.y)
    

    Or simply:

    OilDerrick is overlapping OilDerrickFamily
    
  • Also, I don't like these two conditions. In case of several overlapping fam_cards, they will only compare the first instance.

    You need to use "System Pick fam_cards By Evaluate" instead.

    And the second "For each spr_card" loop is not required.

  • I didn't mean layout layers. I meant an instance variable - like CardLayer or CardLevel. It would make a more robust system.

  • It depends. Will something like this be possible? Can a card overlap more than 2 cards above it?

    You'll probably need to introduce levels or layers, instead of relying on z-index.

    Say, the king here is on level 0, ten is on level 1, and seven of spades is on level 3:

    Then you could process cards in a For Each ordered loop, from the bottom level, picking up cards that overlap it and are on (Self.level+1), and add them to the CoveredBy list.

  • Check out this Ashley's comment:

    construct.net/en/forum/construct-3/general-discussion-7/games-nwjs-183964

    He's talking about Local Storage, but I imagine system saves work the same way.

    You can save the full state of the game to a file.

  • If you are using Download action, I don't think there's any way to prevent this.

    In a desktop app you can save/overwrite the existing file using NWjs or FileSystem plugin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try removing "Is overlapping Deck" condition in the function. If it fixes the issue, then investigate why some cards may not be overlapping the deck. Or move this condition in front of the For Each loop.

  • Are you sure that the origin point and collision polygon are the same in all animations and frames? When you have so many animations, it's better to use a separate invisible sprite for the character - with pathfinding behavior. And attach the animated sprite to it.

    Do you know why the character gets stuck? Does "On failed to find path" get triggered? Pathfinding only works within the layout bounds, so make sure the layout size is correct.

    Anyway, it's a guessing game without the project file.

  • igortyhon The function won't have access to the newly created instance of Cards. You need to add "Wait 0"

  • Border 50 seems too much for cell size 16. Read about cell and border size:

    construct.net/en/make-games/manuals/construct-3/behavior-reference/pathfinding

  • Most likely the event where you play the audio file is repeated on every tick. So the audio is repeated as well.

    Give this audio a tag and add a condition checking that the tag is NOT playing.

    Audio tag "tagname" is NOT playing : Audio play Sound with "tagname"
    
  • if, for example, "simulate right" and "simulate down" at happening at the same time then the character should move down-right at a 45 deg angle. Not sure why your solution doesn't do that.

    What do you mean? It works like that in my example.

  • This happens to me too sometimes.