dop2000's Forum Posts

  • An easy way is to use a Tiled Background object instead of a sprite. If the width of the heart image is 20px, then all you have to do is set TiledBackground width to PlayerLives*20

  • Canvas addon from Construct 2? It doesn't work in Construct 3.

    Construct 3 has its own official plugin called Drawing Canvas.

  • You can't add two functions with the same name. But you can call a function from any event sheet in the project.

  • Yeah, but Local Storage works differently - you first need to execute "Check Exists" action or "Get".

    Then wait for "On Item Exists" or "On Item Get" to trigger, and inside that event you can access the ItemValue.

    Check out those examples I posted.

  • WebStorage was replaced with LocalStorage about 6 years ago.

    You need to open the project in an old version of C3 (which you've done). Then find all references of Веб-хранилище (WebStorage) in event sheets and replace them with with similar events using Local Storage plugin. After that delete WebStorage plugin itself from the project. Save and you will be able to open the project in the latest version of C3.

    There is an official example and a few tutorials explaining how to use Local Storage.

  • Ultimately only you can decide which option will be better for your game, and you may regret your decision later :)

    A single sprite may be easier to deal with. You'll have to store enemy type in an instance variable. Then, for example, if you need to set an idle animation use Enemy.type&"_idle". To check if an idle animation is playing for any enemy, you will have to do something like this:

    System Pick Enemy by evaluate right(Enemy.AnimationName,5)="_idle"
    

    If you start with a single sprite, but later change your mind and decide to split enemies into multiple sprites, here is a tutorial on how to upgrade them to a family:

    construct.net/en/tutorials/upgrade-object-family-319

  • 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")
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

    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.

    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 ^.

    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.

  • 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.