dop2000's Forum Posts

  • NW.js package is 150MB zipped. So 200MB makes sense.

    I believe WebView2 export is a lot lighter.

  • idk, I use Construct explicitly when I don't feel like coding, I don't think there was any other ways to do JSONs unless I'm just blind.

    Think of JSON as a more advanced and flexible dictionary. It's not that complicated once you try it.

    You can of course use a dictionary. There are two options:

    1. Name the keys in the dictionary as CardType&ValueType, for example "DarkKnight_price":10

    2. Create a new instance of the dictionary for each instance of the card sprite. Link it with the card (for example, by UID). Then each card will have its own dictionary.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should try contacting the author of the theme.

    but got a warning that any file saved with DARCSS will no longer load if I uninstall the theme...

    What??? Is this true? How can an editor theme prevent projects from loading?

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

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