dop2000's Forum Posts

  • So the correct path is "message.content.background_rgb"

    Also, you can't send "rgb(4,107,109)" in JSON, because it's a string. Well, you can, but then you will have to parse it into three individual numbers 4, 107 and 109..

    So you need to send three separate numbers - "background_r":4, "background_g":107, "background_b":109. And then use this code to set color:

    JSON Set Path to "message.content"
    Sprite set color to rgbex255(JSON.Get(".background_r"), JSON.Get(".background_g"), JSON.Get(".background_b"))
    

    Another option is to pre-generate the rgb colors which Construct will understand and send them from the server. For example, if you run this small event

    TextInput Set Text to rgbex255(4,107,109)
    

    ... you will see that it returns the number -4405244385279. So you can just send this number in JSON key "background_rgb" and then use this:

    JSON Set Path to "message.content"
    Sprite set color to JSON.Get(".background_rgb")
    
  • If each enemy type has one animation and they are not too big, then you can probably use one sprite for all enemies.

    If there are multiple animations per enemy (for example, idle, walk, attack), they may be difficult to manage when they are in one sprite. Then make different objects and combine them into a family.

    Another thing to consider is memory usage. A single sprite with many heavy animations can use a lot of memory. So if your game has different enemy types on different levels, I would definitely suggest keeping them in separate sprites to save on memory.

    • Post link icon

    When I'm at "choo" while typing, I'd personally only want "choose" and "chooseindex" to populate in the dropdown list, not "clocktext".

    I agree. Not only these long lists are slow, they become less and less useful when they contain hundreds of objects mixed with expressions and variables.

    Filtering them as you type is one solution. Another option would be splitting the list somehow, perhaps displaying two or three lists side-by-side - one with expressions, another with objects, and the third with variables.

    • Post link icon

    In your gif, once you select the choose function, the dropdown list has to clear the elements, could this be a factor?

    Not sure what you mean, which elements? Theoretically, the number of objects and variables in the project should not affect system expressions like "choose" at all.

    Another possibility is that its actually Chrome that causes these freezes (as Asmodean suggested in his comment), because it does something as I type, like performs a spell check. I disabled the spell check yesterday, but I can't tell yet if it helped or not..

  • I believe you can specify any delimiter in the addon. You can use a special character like % or ^.

    • Post link icon

    1StepCloser I know what you are talking about. C3 begins to lag when populating long lists of objects or expressions/variables. But these lags are relatively small, in largest projects I've seen the lags were about a second or two. It definitely doesn't explain random 10-20 second freezes in my case. They are probably related to the same functions, but something else makes the issue much worse.

    Maybe it's a HD issue. Did you try running defrag and chkdsk?

    It's unlikely. The drive is a fairly new very fast SSD. I don't have any issues running large modern games from it. Edit: I ran chkdsk and it didn't find any errors.

  • Try JSON.Get("background_rgb") without the dot.

    If it doesn't help, please post the full JSON string.

    Also, you can't just use a number to set color in C3, unless you encode it properly. You need to use one of these expressions - rgbex, rgbex255, rgba, rgba255

    For example: rgbex255(0,255,0) is 100% green.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't use Rotate behavior with Physics.

    dropbox.com/s/14f7br8kf5v9k1r/PhysicsGears.c3p

  • Are you talking about DrawingCanvas in Construct 3? Its JSON doesn't have image data.

    • Post link icon

    Another unlikely idea, but perhaps computer temperature?

    No, the laptop is running cold. And like I said other apps are not affected, the issue is isolated to C3 in Chrome only.

  • Odineye Have you tried it yourself? Canvas.AsJSON doesn't contain image data.

  • With only two objects the code may be even simpler. You don't have to loop through them. You can do this:

    Set minX to min(player1.x, player2.x)
    Set maxX to max(player1.x, player2.x)
    etc.
    

    Or you can add both sprites to a family.

    • Post link icon

    do you have a third party antivirus installed or only windows defender?

    No, only Windows Defender. I'll try disabling it tomorrow, see if it helps.

    Does this happen in small/empty projects?

    I don't know, to test this I will have to actively edit the project for a prolonged period of time - maybe 20 minutes, maybe an hour.. These periods of lagging are very random.

    As ever it's difficult to provide any help whatsoever without the information requested by the bug report guidelines.

    Thanks for checking those chrome profiles!

    I don't have any other information unfortunately. I understand there is probably something specific to my setup (maybe a combination of hardware or drivers), that is causing this issue. If I find a certain way to reproduce it, I'll log a bug report.

    • Post link icon

    Thanks, Ashley and everyone else for the replies! I installed a fresh version of Chrome Canary, didn't log in, didn't install any extensions. Unfortunately, about 30 minutes after opening my project the issue returned.

    I recorded a performance report in Chrome DevTools - one when the editor was lagging and another when not. Both times what I did was adding a simple action in the event sheet with a simple expression in it - Player.8direction.VectorX

    Although I don't understand what most of this means, the report clearly shows huge periods of latency when I typed the dot after "Player" or "8direction". In the section I highlighted there were hundreds of long removeChild calls. Similar calls are present in the report when there was no lagging, but they took a lot less time to process.

    If anyone wants to investigate, here are both reports. To load them, open DevTools in chrome and click "Load profile" icon in the Performance tab.

  • Do you want it to flash (become visible) after the typewriter has finished? Then you should wait more than 1 second.

    Or perhaps you can display two spritefonts one over another. One with "hide" tags, and another without. Run the typewriter on both. Make the whole second spritefont invisible by default, and after a 1s wait change it to visible.