dop2000's Forum Posts

  • You can also pick the nearest icon. For example:

    On Up key pressed
    Icon compare Y<CursorSprite.Y
    Icon Pick nearest to (CursorSprite.x, CursorSprite.y-20)
    

    It works best when all icons are placed on a grid. With a map like on your screenshot it may require a lot of tweaking.

    Another option is to add 4 instance variables to icons and use them to configure where the cursor will jump to from each icon. It will be a lot of manual work though.

  • I've tried Windows exports in nw.js, adding as non-steam game, then running through Proton and that won't work. I've tried native Linux exports and that won't work either.

    Both options work for me.

    Linux export doesn't require Proton in Compatibility settings. You can even run it from Desktop mode.

    Try exporting with older NWjs versions, for example 72 or 75. Also I've seen in some other thread that requesting full-screen with Browser plugin on start of the game may help.

  • Make sure you assign the correct event sheet to each layout. (in layout properties)

  • PDF is static, why do you need Construct for it? It would be much easier to use some other editor like MS Word or Adobe Acrobat.

    In Windows you can print Construct window (press Ctrl+P) and then select "Save to pdf".

  • Save action saves the state of all objects on the layout, all variables etc. It doesn't save the game code.

    You can exclude some objects (for example static backgrounds, UI elements) from saving by adding NoSave behavior to them.

    If you make big changes to your game, saves made in old versions may become incompatible with the new version. If you load such save, the game may not function correctly.

    For a word game saving everything is probably not a good idea. I would suggest using LocalStorage to save player's progress only.

  • Im trying to figure out Json because I know it'll be a big help to me in the future

    It's a very good idea, I wish I learned JSON earlier.

    You can start by googling some beginner guides and tutorials about JSON.

    There is an example in C3 which demonstrates how to load and parse JSON in Construct.

    Study the official documentation page, it contains all the useful commands and expressions you will need:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/json

    .

    Then you can start building your JSON structure. For example, for a weapon system it can be something like this:

    {
     "smallSword": {
     "Description": "Small iron sword",
     "Damage": 1
     },
     "massiveAxe": {
     "Description": "Very big axe",
     "Damage": 10
     }
    }
    

    You can access any value using expressions, for example:

    JSON.Get("massiveAxe.Damage") will return 10.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have no idea, I suspect this is a bug, but it's for Ashley to investigate.

    If you are in a hurry you should've filed a bug report two days ago.

    Maybe as a workaround you can remove the enemy sprite from the first layout. Or destroy it before switching layout. I haven't tried it, not sure if this will work.

  • Here is something similar:

    howtoconstructdemos.com/circular-progress-bar

  • The text doesn't change by itself, there must be some event that changes it, right? You can update colors in that event.

    Or create a function which changes text. But make sure to replace all tags in a variable first, before assigning the text to the text object.

  • My guess is that this is a bug with Pathfinding behavior. Enemies can't find path although there are no solid obstacles on the layout. Perhaps C3 engine tries to re-use the obstacle map from the first layout and somehow it doesn't work.

    I suggest you file a bug report:

    github.com/Scirra/Construct-bugs/issues

  • Ok, that explains poor performance. You are changing lots of text objects many times, and repeat this on every tick. Say, if you have 10 texts on the layout, from what I can see on the screenshot, you are making 10*11*60=6600 text updates per second, maybe more.

    An obvious fix is to not update them on every tick. Change colors in the same event where you assign texts to text objects, or in "On object created" event.

    You can also reduce the number of text updates if you replace all tags in a string variable first. For example:

    BBCodecolors On Created
     Local variable s
     Set s to BBCodecolors.text
     Set s to replace(s, "&0", "[/color][color=black]"
     Set s to replace(s, "&1", "[/color][color=darkblue]"
     ...
     BBCodecolors set text to s
    
    
  • Updating a couple of texts on every tick shouldn't cause such big drop in performance.

  • Are you using BBcode? It should not consume much cpu. Can you post your project file?

    You can also check these examples:

    https://editor.construct.net/#open=animated-spritefont-effects
    
    https://editor.construct.net/#open=text-formatting
    
    
  • I have no idea what you are asking about. You need to post some pictures or videos or your project file.

  • igortyhon's reply is a bit harsh, but I agree - it makes no sense to use so many functions. It's impossible to understand what's going on in the code.

    Use breakpoints and Debug Preview (Shift+F4) to debug your code. Although breakpoints sometimes don't work in functions.

    Also I suggest using Browser Log action. For example:

    Browser Log "CurrentTestNum=" & CurrentTestNum