dop2000's Forum Posts

  • Didn't you ask this question a few days ago?

    Use "AreaSprite On collision with Enemy" event - it will pick all enemies inside the area. If the area needs to deal damage over time, you can do something like this:

    Every 0.5 seconds
    AreaSprite Is overlapping Enemy : Enemy subtract 10 from HP
    
  • What I want is for each Sprite 2 that's attached to then have anchors to attach to other Sprite 2s, but only when attached to Sprite 1. I'm thinking heirarchy and having children of Sprite 1 be Sprite 2 might solve the problem of in which order, but when I press Space I also want the Sprite 2s to shoot out and remake-available the anchors once present.

    Can you draw a picture, showing sprites before attaching, after attaching, after shooting-out, and different combinations of them? How long can these chains get?

    If you need to re-use the anchor points, then don't destroy them. Instead use a instance variable, for example "occupied". When attaching a new sprite, pick nearest anchor with occupied=0, change it to 1. After detaching change it back to 0.

  • Here is what happens when I add a blank tilemap, immediately resize it to 10x10 tiles, then draw some tiles on it.

    "tilemapData": {
    "width": 10,
    "height": 10,
    "max-width": 53,
    "max-height": 30,
    "data": "9x0,5,29x0,5,29x0,5,29x0,5,29x0,5,29x0,5,29x0,5,29x0,5,29x0,5,29x0,5,1310x0"}
    

    As you can see, Construct remembers the initial size and stores lots of zeros for tiles which are beyond the 10x10 area. (Here tile indices start with 1, and 0 is an empty tile. For example "29x0" means 29 empty tiles.)

    Of course, it's a negligible overhead - just a few extra bytes of data and perhaps an extra microsecond to parse them. But if you have lots of tilemaps in your game, it may be a good idea to create them with the correct size from the beginning:

    "tilemapData": {
    "width": 10, 
    "height": 10, 
    "max-width": 10, 
    "max-height": 10, 
    "data": "9x0,5,9x0,5,9x0,5,9x0,5,9x0,5,9x0,5,9x0,5,9x0,5,9x0,5,9x0,5"}
    
  • You need to pick a target instance first. When you use "find path to target" without picking, then it will always use the first instance.

    "walker var=target.tar" condition is also incorrect, it will not pick target instance.

    Try this:

    System Every 0.3 seconds
    target Compare variable tar = walker.var 
    .... walker find target to (target.x, target.y)
    

    It needs to be a single event with two conditions.

  • if the layout size is 1000x1000, does this mean that every tilemap object added contains tile data for 1000x1000, even if the object is resized to 50x50?

    I think so. When you add a new tilemap, its size is set to layout size. If you resize the tilemap, it will still remember its initial size and will store the values for those invisible tiles.

  • Or, if you are comfortable with editing project files, here is a little tool I made that converts tilemap data to a string that can be stored in Layout.json file. It also shrinks the tilemap. It can be useful if you create tilemaps in runtime and want to store them permanently in the project.

    dropbox.com/scl/fi/mda3f73tgpbmnjmv5ofde/tilemap_data_convert.c3p

  • I tested with 1000 tilemaps created on every tick and apart from a slightly higher memory usage there's no difference in performance.

    The funny thing is that you can't actually delete those invisible tiles, even if you erase them, they are still stored in timemap data. The only way to shrink the tilemap is to delete all instances of it, restart the editor, create a small blank layout (say, 300x300 px) and place the tilemap object on it.

  • There are three sprites named "target1", "target2" and "target3"

    Do they need to be different objects? Consider combining them into one sprite, maybe with different animations.

    If you are sure they should be different objects, then you need to add them all to a family and define the variable on the family. Then you will be able to pick any family instance:

    Family variable=2 -> Sprite find path to Family

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley Thanks for the detailed answer! We are of course staying on NWjs for now, but it's good to have a backup option.

  • Tell players they'll need to say goodbye to their previous saves. Keep the old version in another branch, so if they want, they can continue their old games.

    I don't think this qualifies as a solution.

  • I wonder if it's possible to switch from NWJS to WebView2 in an already published Steam game?

    I'm guessing the folder and file structure will be different. Will this cause any issues? Will the game be able to access Local Storage data from NWjs version?

  • When several objects are draggable/clickable you can use "Pick top instance".

    There are many way to prevent click-through - one solution is to disable/enable layer interactivity. For example, when menu layer is active, disable interactivity on all game layers. Another option is to organize events in groups and activate/deactivate them. Say, if an object is clicked, deactivate "UI controls" group.

  • I never really knew how to use the LocalStorage feature

    There are plenty of examples and tutorials. All you have to do is save one value in Local Storage - "isBanned"=1

  • Here is the solution to #2

    dropbox.com/scl/fi/j6vtjlirv55gojr4b0gci/DragAndToggle.c3p

    Like I said, #3 may be difficult. Perhaps you need to use invisible immovable sprites to limit the zone of the box. Or you can allow the object to go through the walls while dragging, but when released snap it to the nearest free shelf.

  • You do not have permission to view this post