Tilemap doesn't show if no other sprite instances on layout

0 favourites
  • 3 posts
From the Asset Store
Enchanted Forest & Cave 16x16 Tilemap with Environment Sprites
  • Basically, the statement above. I am testing with several capx (from me and from many examples on tutorials and posts) and it always happens the same.

    When having a Tilemap, it shows up correctly on the layout. But at preview, if no other sprite instance is inserted on the project (not at runtime), tilemap never shows up.

    This is an example of mine, but you can try with any project woth a tilemap and some sprite.

    1drv.ms/u/s!AojCIgmN1VlPiXHgVYT1aGqqT9-6

    If you delete the troop, arrow and line which are outside the viewport and then prev, screen is blank (black, actually :p). Were any of them onto the layout, tilemap shows up as it should.

    Maybe I am missing some point on how tilemap works? Or some parameter I didn't notice had to be set up on the properties bar?

    I know it could be worked around by adding a destroy action into the first event, since I do know they all have IID 0, due to being the first ones created. But it's a bit odd.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is a pretty basic example. Just a tilemap and a sprite. No addons nor behaviours.

    1drv.ms/u/s!AojCIgmN1VlPiT9oKnbUiHXCBSpG

    The issue comes when creating objects.

    In the event sheet, I just have so far:

    On start of layout >

    Repeat 5 times >

    - create troop

    Now, the problem:

    - If there is at least 1 sprite instance, tilemap shows up and those other 5 sprite instances get created.

    -If there is no other sprite instance, tilemap doesn't show up at all and no object/instance is created.

    -If there is no sprite instance and neither the system object creating event, tilemap shows up (with no other sprites, for I didn't inserted on layout nor created through events).

    Possible workarounds:

    - I have to recalculate every pick and count with a -1 or +1 depending on which evaluations/comparisons are needed for the events to trigger and later on it causes several issues when adding subsequent events. Moreover, in order to make it behave as the rest, some events at first are needed to position that first instance in the way the rest are on being created, set angle,...

    - If I add an event to destroy that very first instance, it seems even not to create the other instances.

    - Disabling that only event (creating objects) makes tilemap shows as it should, even if the troop instance was deleted and no sprite instances are left onto the layout. But I need to have those sprites on screen, so it oblies me to insert in advanced every instance that will appear on game and keep changing visibility/opacity all the time, etc...

    Main concern:

    There is some relation between tilemaps and creating instances on layout I don't get.

    As much as I read, can't find the point I'm missing.

    Why would the existence of an instance onto the layout screen interfere with an event whose condition doesn't involve that object?

    Even worse- Why would the existence of an instance (sprite) on the layout screen interfere with the visibility of another object (tilemap) in a different layer, with no event relating them?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)