dop2000's Forum Posts

  • You need to provide more information. Is this is a top-down view game? Should enemies move on a grid, from cell to cell? Or just find path to a random spot in the dungeon and move there?

  • I have a template for this request saved as a JSON project file:

    It doesn't have to be a file, you can simply store this JSON string in a text variable. Then to replace session ID use:

    Set jsonString to replace(jsonString, "YOUR_SESSION_ID", extractedSessionID)

    Another option is to load (parse) it into JSON object and use this action:

    JSON Set value at "transport.session_id" to extractedSessionID

    Then how do I format this so that I can use it in the data parameter of the AJAX request?

    This should be in Twitch documentation I suppose. If you are using JSON object, you can convert it back to string with JSON.ToCompactString expression.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, that's essentially the same what you had before.

    The condition should pick family instances - "System Pick fam_cards by evaluating ..."

  • I would try giving the objects slightly rounded edges:

  • You can't simulate a keyboard event. But you can run the same code that runs when the key is pressed.

    Keyboard On Space pressed : Call function PlayerJump
    
    Touch on Button touched : Call function PlayerJump
    
  • Are you using Construct 3?

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

  • 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):