dop2000's Forum Posts

  • Can you post a screenshot of your code? Also, run the game in Debug Mode and check that there is an instance of fam_paws with pawState containing current (without quotation marks).

  • The easiest fix would be moving the origin point to the center for all objects.

    Alternatively, you will need to offset all path points by 16px. Say, find path to (NPC.X+16, NPC.Y+16), and when the path found - loop though all nodes and add 16px to them..

    Or use a separate invisible sprite with the origin point in the middle for pathfinding, and pin your NPCs to it.

  • Try Cell border=-1

    Here is a demo:

    dropbox.com/scl/fi/fb9xopeimo4ht4mwbzu2q/PathfindingOnTilemap.c3p

  • Yes, if you align the tilemap and configure the pathfinding grid properly. Also, disable diagonals in pathfinding, and use MoveTo behavior to move along the pathfinding path - it's more accurate.

  • "debugText Set from JSON" is incorrect! Use "debugText Set Text" action.

    After you fix that, if nothing appears in the debugText, this means the Websocket doesn't receive any text data. You can also press F12 and check for errors in the console.

  • {"is-c3-clipboard-data":true,"

    You know that we can't paste your code without adding all the same objects first? Next time please post screenshots.

    Try this:

  • I still don't understand. What should it look when it's half colored? What if it collided with 3 different colors - will there be 3 different spots, and the rest of the dog remain white? Or the entire dog becomes progressively darker with each collision?

  • Can you make a picture? What will the sprite look like after several collisions with different colors?

  • But if the player mutes the sound and restarts the level, it stays muted — unless the player manually unmutes it.

    They probably mean that sound settings should be saved between game sessions. If you mute the sound and close the browser tab with the game, the next time you open it - the sound should already be muted.

  • The easiest solution is to use min() expression.

    Set betAmount to min(betAmount, totalMoney)

    or clamp if you also want to prevent negative values:

    Set betAmount to clamp(betAmount, 0, totalMoney)

    .

    Check out the documentation, there are lots of useful expressions!

    construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See the comments here:

    github.com/Scirra/Construct-bugs/issues/8576

  • If you limit the fish’s turning angle so it can’t make sharp turns, and its body is shorter than the turning circle (i.e. the path it would take to complete a full turn), then it won’t be able to overlap itself.

  • You can make a list and create objects by name.

    Variable list=apple,banana,plum,orange
    
    Repeat tokencount(list) times
     Create object by name: tokenat(list, loopindex, ",")
    
  • I had to click save several times on each project in order for the save icon to deselect and construct to allow me to close

    This actually has been happening for me in the past few days - the save icon stays active for about 20-40 seconds after saving. Maybe the fact that you clicked it multiple times broke something in the project..

    You can try sending the project to Construct support email. Don't forget to attach all used addons.

  • Just to add some additional information — in that example, the JSON contains an array of books: "books":[...] This approach works well when you have many books. However, it's not necessary to store data in arrays when using JSON. In fact, I rarely do that.

    For example, if you want to store stats for different weapons in an RPG game, using an array means you'll have to iterate through it every time you need to find a specific weapon:

    {
     "weapons": [
     {
     "name": "Short Sword",
     "type": "melee",
     "damage": 8,
     "range": 1,
     "weight": 3
     },
     {
     "name": "Longbow",
     "type": "ranged",
     "damage": 12,
     "range": 10,
     "weight": 4
     },
     {
     "name": "Fire Staff",
     "type": "magic",
     "damage": 15,
     "range": 6,
     "weight": 5
     }
     ]
    }
    

    To find a weapon you will need to loop thought the array:

    JSON For Each element in "weapons"
    JSON compare ".name"="Short Sword"
    

    It's much easier to store each weapon as a separate object instead:

    {
     "short_sword": {
     "type": "melee",
     "damage": 8,
     "range": 1,
     "weight": 3
     },
     "longbow": {
     "type": "ranged",
     "damage": 12,
     "range": 10,
     "weight": 4
     },
     "fire_staff": {
     "type": "magic",
     "damage": 15,
     "range": 6,
     "weight": 5
     }
    }
    

    Then you can access any weapon and its stats directly with a single expression, for example:

    JSON.get("fire_staff.damage")
    

    And of course objects can contain nested objects and arrays: