dop2000's Forum Posts

  • Sorry for assuming that you are a beginner, but some things you've described and especially your troubleshooting methods (re-arranging events, adding waits etc.) are mistakes that I've seen many times on this forum.

    For example, adding 1 to a global variable when any enemy is attacking, and subtracting 1 at the end of their attack animation - with multiple enemies this is difficult to program correctly, and extremely difficult to debug when it's not working.

    It's much easier to set isUnderAttack=true when an enemy starts its attack, and then when an attack ends (or on every tick, or every 0.1s) check if there are any enemies still attacking. If not, set isUnderAttack=false.

    Using "Wait" in this logic will only cause problems! If you need to delay something, for example, player recovering from the attack, use Timer behavior.

    .

    About your other issue with the startup sequence - when you are starting many asynchronous requests at once, and then use many "On completed" events, it's difficult to figure out when all of them are completed. It's easier to execute them one by one.

    Unless the files are really big, these requests should be finished in a couple of ticks.

    .

    Can you please post screenshots of your code, which you are struggling with? It will be much easier to discuss with actual examples.

  • For the console log to show anything, you need to add "Browser Log" actions to your events :)

  • These two objects (healthbar and its background) have different Z-elevation, that's why they are drifting.

  • I'm guessing you can run any CMD command via "start", for example "start dir"

  • In runtime you can move data from one array to another, by copying from cell to cell - "Array2 Set value at (X,Y) to Array1.at(X,Y)". Do this in a loop, if you need to copy the entire row or column.

    But it is not possible to modify JSON files in the project, so you will not be able to save modified arrays in the same JSON files. You can write them to Local Storage or some cloud storage.

  • "start" is a CMD command in Windows:

    windows-commandline.com/cmd-start-command

    You can't run a *.bat file directly from NWJS, but it's possible with "start test.bat"

  • You want to transfer it in the editor? Simply select the cells you want to transfer, press Ctrl-C, open another file, place cursor where you want to insert these cells, press Ctrl-V.

    Have you ever used Excel? It's very similar.

  • It does, thank you!

  • In the editor? Simply rename the files, or copy-paste the content. Or do you mean something else?

  • In French language there is always a space before exclamation or question mark. So I would like to replace it with a non-breaking space to avoid situations when it's wrapped to the next line like this:

    I tried copy-pasting different whitespace characters, using JS code "String.fromCharCode(160)", but nothing works. Looks like all whitespace characters are replaced with a regular space.

    Is there any solution?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not the size of the layout that slows the device, but the number of objects on it, and behaviors/effect on these objects.

  • I also don't advise using "Wait" in game mechanics, especially for long delays. You can do it for unimportant things, like create particles, wait 1 second, destroy particles. But imagine this code:

    In these 5 seconds the enemy may be killed, and you have no way of cancelling that delayed animation change, other than destroying the enemy.

    Another big mistake is having "Wait" in events that are running on every tick. Check out this comment.

  • You need to study game templates included in Construct (Kiwi Story and others).

    Trying many combinations of events in hope that some of them will work is a very wrong approach. You need to understand what you are doing if you want to create a working code.

    From what you described, you are using a "state machine" model. I understand why many beginners do this, at first it looks simple and logical, but as your project grows bigger, it becomes a minefield. You end up with dozens/hundreds of events checking and modifying all kinds of variables on every tick, lots of "trigger once" and "waits" in different placed. It's a delicate mess and any small change can potentially ruin everything.

    There is nothing wrong with having a few state variables, but building an entire game like this - I am strongly against it. In my games most of the events are triggers and functions. For example:

    On timer "Attack" -> Play "Attack" animation
    On "Attack" animation end 
    	-> Call function "DealDamageToEnemy"
    	-> Restart "Attack" timer
    etc.
    

    You can clearly see the sequence of events here, it's much easier to develop and debug this way.

  • Are you using the loader layout properly?

    construct.net/en/tutorials/loader-layouts-custom-loading-9

    It took a long time to load the first screen, and then it just got stuck at 5%.