dop2000's Forum Posts

    • Post link icon

    I will try your suggestions, but don't think it's the same problem. When I type "(" or "." in the expression editor, I believe it's Construct engine that tries to check the syntax of the entered expression, change text color, display a drop-down list etc. It probably has nothing to do with Chrome autofill.

    Besides, the editor is lagging in other places too - when I click and try to move objects on the layout, when adding a new event or action to an event sheet etc.

    • Post link icon

    Anyone else experiencing random lags in the editor? They are especially noticeable when working with events and expression. The editor starts to feel very sluggish for a minute or two for no apparent reason, then the problem goes away. This happens many times a day and is very annoying.

    The freezes can be very short or last up to 20 seconds! See the gif below - I started typing choose("armor"... and the editor froze for 16 seconds as soon as I typed the opening bracket! Chrome even popped up a message saying that the page is not responding.

    I tried monitoring CPU and memory utilization in Task Manager and didn't notice any spikes when these freezes happen. As a test I opened a youtube video in another browser and it continued to play smoothly during these freezes. So I'm sure that no other applications are responsible, the issue is definitely in C3 or Chrome. There are no any third party extensions installed in Chrome.

    I don't know if it's related to the project size or not. I've been only working on a large(ish) game lately - about 500 objects, 6000 events.

    My hardware specs: Ryzen 9 4900HS, 24GB of RAM, 1TB SSD.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • is there a way to detect when the line breaks?

    I guess when the TextHeight increases it means that a new line is added.

    But even if you insert manual line breaks, you still won't be able to detect the width of the last line which is currently typing. Because TextWidth expression will return the width of the longest line in the text object.

  • There's no such limitation, you must be doing something wrong. Please share your project file or a screenshot of the code.

  • As far as I know, this is not possible.

    You'll probably have to make your own typewrighter effect by adding one letter to the text every 0.1s or so.

    Then you will be able to detect the actual width of the text using Text.TextWidth expression and place the cursor in that position. But it will only work for a single line of text.

  • Shouldn't the variable isDead be called isAlive instead? isAlive=1 means the player is alive. isAlive=0 means not alive any more. (since in any programming language 1 is true and 0 is false)

    Checking if the player has any health left or if it's dead on every tick is not a good practice. I suggest you move these event inside the event where the player actually receives damage. For example:

    Bullet On Collision with Player : Player subtract 1 from Health
    
    .... Player health<=0
    .... : Player set isAlive=0
    .... : Player play animation "Death"
    

    See if it helps. If the animation still doesn't work, run the game in debug mode and check the variables on the Player object.

  • One possible reason is that there is no path to the nearest enemy.

    I suggest adding logging to your events - for example in the first event on your screenshot add this action:

    Browser Log "Finding path to enemy UID:" & enemy.uid

    Add another event "On Failed to find path" with another Browser Log message.

    Then run the project in debug mode, open console and check the enemy UID. Find this enemy by UID, zoom out the layout, see if it's blocked in solid objects etc.

  • No, I had this issue too, couldn't find a solution.

    If you manage to reproduce it in a small project, you can post a bug report.

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

  • Check that the "On created" trigger is actually triggered. The easiest way is to add a "Browser Log" action, then you can see if the message appears in browser console.

    If you discover that the event is not triggered, check if the event sheet is connected to your layout, or included in your main event sheet, that the event group is activated etc.

    By the way, I believe if the object is very dark or black, the "Set color" action will have no effect.

  • You don't need Orbit behavior for that. Here is the easiest method:

    On every tick:
    Arrow set position to Player
    Arrow set angle towards (Mouse.x, Mouse.y)
    Arrow move 50 pixels forward
    

    Or you can set the origin image point in the arrow sprite at x=-50 and then you won't even need the last line.

  • I keep all addons which I use in a separate folder. When I need to install them, I just select all files in the folder. C3 still asks me to confirm the installation of each addon, but the whole thing takes about 30 seconds.

  • Not exactly..

    Since you have an array in JSON, you can pick by comparing sprite ID with the index in JSON array. And add Description and Sprite in a container. Here is the fixed file.

    dropbox.com/s/v5m52m7m99c5vhg/borrador%20load%20json2.c3p

  • You should use either "For each sprite" loop, or "JSON For each entry" loop, not both!

    If you are using "JSON For each entry", then inside this loop pick one instance of the sprite.

    For example, you can manually set Rank values for all sprites. And then pick the sprite for each entry by rank:

    JSON For each entry
    Sprite compare instance variable Rank=JSON.get(".rank")
    ... Sprite set UserName etc.