dop2000's Forum Posts

  • Here you go:

    dropbox.com/s/z89snbjmw8gtfv2/LoadRandomTilemapData.c3p

    You need to create a separate project (Level Builder) where you keep the original tilemaps. Use "Tilemap Download" action to download a json string for each tilemap.

    In your main game create an array with all those json strings. When a new level starts, pick one string at random and load it into the tilemap.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Check the console log - sometimes AJAX throws an error there instead of triggering "On Error" event. Also I would probably move "On any error" event out of the loop. It should be a top-level event. You can use AJAX.tag expression to get the tag of the failed request.

  • MrClifford You can actually access LocalStorage.ItemValue in the "On item exist" event. No need to use Get/On Get.

  • You can use Timer behavior - run a timer for 5 seconds, and in your "On Click Object A" event check that the timer is not running.

    Or even simpler - save the time object was clicked in a variable LastClick. And allow to click it again if (time-LastClick)>=5

  • You can't change layout size in runtime. You can allow "Unbounded scrolling" in layout properties.

  • Je Fawk pandabear7413 birdboy And others who have this issue in Chrome - could you share your hardware config? I wonder if this happens with Intel CPUs?

    I have a gaming laptop and gaming PC, both with AMD Ryzen processors and plenty of RAM. Construct lags and freezes terribly on both computers in Chrome.

    But when I open the same project on an old Intel i5 laptop, there are no lags. (although it crashes frequently with "out of memory" error)

  • Use a local variable to temporarily store the value of one instance.

    Sprite is overlapping Family
    .. Local Variable temp=0
    
    .. Set temp to Sprite.var
    .. Sprite set var to Family.var
    .. Family set var to temp
    
    

    Only in this case you should probably use "On Collision" event. Because Overlapping can happen many times per second, so the instances will continue swapping values again and again many times.

  • Add the sprite to a family. Define the variable on the family and remove it from the sprite. Then you can use this code:

    Sprite is overlapping Family
    .. Family set var to Sprite.var
    

    Depending on your task you might need to pick the correct sprite instance first. For example if you are using Drag And Drop behavior, then the code will be:

    Sprite On Drop
    Sprite is overlapping Family
    .. Family set var to Sprite.var
    
  • You can set an object as Global. Then when you switch to another layout, the object will be transferred there automatically. Make sure not to create duplicates!

  • Another popular method is to create a family with this sprite, and then you'll be able to use "Sprite overlapping Family" condition. Where you could refer to both instances separately.

  • After changing to VSync, the game seems to be better, but everything runs slower and bullet collisions aren't accurate, is there a fix for that?

    You definitely should fix the game to work with V-sync mode. Unlimited mode is only used for stress-testing and you can't release the game with Unlimited mode.

    To improve bullet collision use stepping mode in bullet behavior. There is an official example for it in Construct.

    Also you shouldn't use "Find path" for enemies on every tick, it's bad for performance.

    Maybe it depends on the type of Graphikcard or memory if it doesn't appear on dops Computer.

    I tested on a pretty old laptop with Intel HD video and 8GB RAM.

  • Try renaming the keys, I'm not sure if names like "1" or "2" are allowed, because "key.1" usually means the path to the first element in an array.

  • Change Framerate Mode to V-synced in project properties. "Unlimited" mode can only be used for testing.

    Other than that I don't see any issues, the game runs fine for me, I played it for several minutes.

  • You can put all values you want to save into an array or a dictionary, and then save it with one action - Local Storage Set "data" to Array.AsJSON

    To load - Array Set From JSON

    Check out this demo:

    howtoconstructdemos.com/easily-save-multiple-values-in-local-storage

  • I would advise using the Persist behavior. If you are spawning objects in runtime, you need to do this only once, and don't respawn them when you return to that layout later - Persist behavior will take care of that.

    Another a much more difficult option is to use an array to store the data about objects on each layout.