dop2000's Recent Forum Activity

  • What export did you use for Windows?

  • Check out this forum:

    construct.net/en/forum/game-development/job-offers-and-team-requests-28

    There's also a very active Discord community:

    discord.gg/tVxsAdEt

  • How big is the JSON file? Try saving it to your desktop using the "Browser Download string" action. Then, analyze it with an online tool to see which objects are taking up so much space.

    My guess? The dictionary.

    You’re writing saveJSON into the dictionary. Then, 15 seconds later, you create a new save, which stores the entire dictionary (already containing the previous save) into saveJSON again. After that, you write saveJSON back into the dictionary.

    It’s like Russian dolls — your dictionary keeps nesting copies of all previous saves.

    The solution is to clear the dictionary before running "System save".

  • Consider using JSON instead, you can store any amount of data for each card. For example:

    CardJSON set path to CardName
    CardJSON set ".quantity" to (CardJSON.get(".quantity")+1)
    CardJSON set ".price" to 500
    

    To retrieve a value: CardJSON.get(CardName & ".price")

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies