dop2000's Forum Posts

  • System Save action saves absolutely everything (except for objects with NoSave behavior). It may work for many games, but sometimes you don't want to load some data. For example, you have a volume setting in your game and you reduced volume to 5%. But loading an old save will also load old volume value which was 100% when it was saved. Avoiding things like these is quite difficult. That's why sometimes it's better to make your own save system, where you can control what data is saved or not.

  • In C2 you can pass function parameters when calling a function, in this case pass EnemyMask.UID

    Inside the function use Function.Param(0) to access this parameter value.

  • You can use instance variables and Timer behavior. For example, create "seq" instance variable, pick 5 random circles, assign them seq values from 1 to 5.

    Start a Timer for these picked circles for (2.5+Circle.seq*0.5) seconds.

    This means that the timer for the first circle will trigger in 3 seconds, the timer for the second circle in 3.5 seconds and so on.

    Check out official examples in C3 to learn how to use Timer and other features.

  • If "CodeTextBox" text is: W84FJ3JK then:

    Wait for "CodeButton" to be pressed

    When "CodeButton" pressed then:

    Add "1200" to "Coins"

    It's always recommended to use triggered events when possible. This way your code would only run once when the button is pressed, and not on every tick.

    On CodeButton Pressed <<-- this is a triggered event
    CodeTextBox Compare Text = W84FJ3JK <<-- second condition in the same event
    .. Add 1200 to "Coins"
    .. etc.
    
  • It isn't hard with lerp function: lerp(x1, x2, 0.5), lerp(y1, y2, 0.5) is the middle point between two coordinates.

  • I am not sure if replacing lots of numbers in a large JSON and then loading this JSON back into the tilemap will be any better for performance.

    I too have animated tilemaps in my project and I'm only updating the tiles which are inside the visible area, in my case this is about ~1000 tiles. Updating them every 0.16s only costs a couple of %% in CPU utilization.

    Let's say there are 5 animated tiles in the tilemap - from 10 to 14. After tile 14 the animation restarts from tile 10 again. Then the code can be something like this:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't shift them too far, just enough to look random, but not enough to overlap.

    There are other methods of course, here are a couple of old examples:

    howtoconstructdemos.com/spawn-objects-randomly-without-overlapping-2-capx

  • Here you go - array of objects in JSON.

    dropbox.com/s/72wjywhr1qkvmmp/JSON_arrayOfObjects.c3p

    I believe Firefox can't save or backup projects directly on disk and this is a must have for me. Even if I test and find out that Firefox doesn't lag, I still won't be able to use it.

    Same with the hardware acceleration - my game won't work without WebGL, so I can't just disable it permanently.

    I will try Edge tomorrow.

    So I tried every suggestion from this post:

    • Installing Chrome Canary
    • Disabling spell check and auto-fill for addresses
    • Clearing browser cache and auto-fill data
    • Disabling windows defender
    • Checking the drive for errors - none found
    • Closing all background apps I could find (Google Drive, Dropbox client etc.)

    Nothing helped, C3 editor is still randomly freezing and lagging..

  • If it was working before and now doesn't, it's definitely a bug. You need to report it:

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

  • First, you are missing ".0" in the path, the correct path is "scene.0.dialogue.2.id"

    Check out this demo project, it shows paths to all keys in JSON:

    dropbox.com/scl/fi/3lvdqp1x1v57xy0prahrj/JSON-RecursiveRead.c3p

    But without seeing the code of that dialogue system it's impossible to tell how it works and when the line is actually "executed". There's probably some event that extracts the ".line" value from JSON and displays it on the screen. So you can try adding a sub-event there that will check if the current JSON path is "scene.0.dialogue.2" and if ".id" key equals 2.

    .

    I have a similar dialogue system, where I added a "function" key in JSON. So when a dialogue line is shown, if "function" key exists for it, the function with that name is automatically called.

  • If you want them just to look like they were placed randomly, you can still place them manually in a grid, and then when the game starts shift them slightly in random directions.

    Circle Move random(100) pixels at angle random(360)

  • You can copy all values from the array into a JSON object, and then send JSON.ToCompactString to your server:

    The resulting string will look like this:

    {"arr": ["val1", "val2", "val3".....]}

  • I suggest you place the circles manually in the layout editor, and then on start of the game randomize their frames or animations. For example, if there are 20 frames in the animation and you want to display them in random order:

    System For Each Circle Order by random(1) : Circle set animation frame to loopindex