dop2000's Forum Posts

  • It's not really about collisions or visibility, it's about picking. Replace "is visible" with any other condition, say, "is animation playing" - and the result will be the same.

  • And oddly enough number two performs just as bad if the "system compare" was directly below the loop instead of in a sub-event.

    You are right, wow...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, but +55% CPU usage - it makes no sense! And if I move the "is visible" condition inside the loop, the difference is only 3%

  • Here is another fun example - a massive 55% difference in CPU utilization when I replace the condition inside the loop:

    Can anyone explain?

    Project file:

    dropbox.com/scl/fi/l01aj1fqnc916d78gob70/LoopPerformanceTest.c3p

  • Well, this completely shatters my belief system... I always thought filtering the SOL before running a For Each loop was more efficient.

    And it’s not even about collision checks - the same thing happens if you use any other condition inside the loop, like 'Compare instance variable'.

  • According to chatgpt:

    The spellcheck attribute (<input spellcheck="true"> or <textarea spellcheck="true">) only enables or disables the browser’s built-in spellchecking.

    Browsers do not expose the results of that spellcheck to JavaScript for privacy and security reasons (e.g., otherwise scripts could snoop on what words you mistype).

    You can enable/disable browser spellcheck, but you cannot read the error state programmatically. If you need programmatic access, you must implement your own spellcheck system.

  • The image points are defined on the enemy sprite, not on blocks. And it's easy to replace blocks with a tilemap:

    dropbox.com/scl/fi/s813xhmap2se856wdzta0/WalkAroundWalls_Tilemap.c3p

  • I made this demo a while ago, maybe you will be able to adopt it for your game:

    howtoconstructdemos.com/enemies-walking-around-walls-metroid-style-or-patrolling-the-perimeter-enemy-ai-capx

  • Remove last two events and use this one:

    On Every tick: Set layout scale to lerp(layoutScale, ZoomTarget, 10*dt)

    You can try other values instead of 10 to make it faster/slower.

  • My question is: Shouldn't this OR block that's nested underneath my AND block still fire off these actions (when the AND block is not satisfied)

    No. If the conditions in the parent event are not satisfied, then the entire event won't run - including all sub-events. It doesn't matter if there are OR-blocks or AND-blocks or empty blocks in sub-events.

    If you put a breakpoint and run your code in the debugger, you'll see how the engine processes it step by step.

  • ChatGPT to the rescue! :)

    It's possible to fake URL parameters in preview or debug with a bit of scripting:

  • Do you need to read the contents of the file?

    In this case you have to access it with AJAX:

    You can use "AJAX Request URL" action if you want, and type the name of the file in the URL field.

  • with everything formerly worked on there, how would I now implement the new into the old?

    It's your game and only you can answer this question. I mentioned before that your system of attaching sprites with dx/dy instance variables and a dictionary was overly complex and error-prone. I understand you based it on R0J0hound's advice - he's a brilliant programmer, but he works in Construct 2, where hierarchies don't exist. In Construct 3, the hierarchy feature would be a much simpler and more efficient solution for your task. That said, you don't necessarily have to switch to it.

  • You can add a 1-2px offset with bbcode. But it's possible that some texts will become clipped on the right.

    Another option is to convert this font to spritefont and use spritefonts everywhere.

  • I strongly suggest starting using JSON instead of arrays. It will take a little time to learn, but will save you a lot of time and headache down the road!

    Consider this JSON, which stores all weapons in the game and their stats:

    {
     "IronSword": {
     "Type": "Melee",
     "Rarity": "Common",
     "Damage": 25,
     "Attack Speed": 1.2,
     "Crit Chance": "5%",
     "Range": 1.5,
     "Durability": 100,
     "Special Effect": "None"
     },
     "SteelAxe": {
     "Type": "Melee",
     "Rarity": "Uncommon",
     "Damage": 40,
     "Attack Speed": 0.9,
     "Crit Chance": "3%",
     "Range": 1.3,
     "Durability": 120,
     "Special Effect": "Cleave"
     },
     "HunterBow": {
     "Type": "Ranged",
     "Rarity": "Common",
     "Damage": 18,
     "Attack Speed": 1.5,
     "Crit Chance": "10%",
     "Range": 8.0,
     "Durability": 80,
     "Special Effect": "Quick Draw"
     },
     "Longbow": {
     "Type": "Ranged",
     "Rarity": "Rare",
     "Damage": 35,
     "Attack Speed": 1.1,
     "Crit Chance": "15%",
     "Range": 10.0,
     "Durability": 70,
     "Special Effect": "Armor Pierce"
     }
    }
    

    You can access any stat directly with a single expression, for example: WeaponJSON.Get("Longbow.Damage"). It's a lot easier than dealing with arrays!

    .

    Besides, JSON is flexible - you can create records and structures that are simply not possible with arrays:

    .

    And here is a more advanced trick - I often store the data as an array in a table format, which makes it easy to view and modify in the editor. But at runtime, I convert it to JSON. I've been using this method for the past few years with great success.