the.sand's Forum Posts

  • Ah okay.

    I really want to trigger this (and other) actions on the start of any layout but there doesn't seem to be a trigger for this. Is there one?

  • I've double checked and it is using the correct event sheet.

    Here is a link to my game file if you don't mind taking a look: drive.google.com/file/d/1ngS6ldw6lmu6gQmtYx-3yKLeyjdmpW2D/view

    You can switch between two layouts by walking inside/outside the house.

    Thanks!

  • Thanks for your response!

    What's weird is I am using "on start of layout" function to stock the default items. And even though both layouts are using the same event sheet the items still get destroyed and don't get re-stocked when I switch layouts.

  • Hi all,

    I am currently storing the player's inventory in an array and displaying their inventory in a bar at the bottom of the screen.

    On start of my game I trigger an "itemPickUp" function so the player is stocked with their default items. The problem is when i switch layouts, these items get destroyed. They are still stored correctly in the array but I'm not sure how to draw them again to the screen.

    I was hoping "on start of layout" would trigger on start of any layout but this is not the behaviour.

    Is there a way to trigger an event on start of any layout? Or is there some better way I could be doing this?

    Thanks in advance for your help!

  • Thanks! oosyrag dop2000

    That was exactly what I needed to know!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was hoping I could use:

    distance(Tilemap.TileID(1282).x,Player.X,Tilemap.TileID(1282).Y,Player.Y)

    But Tilemap.TileID is not a real function.

    Is there some way to do this that I'm missing?

    Thanks!

  • dop2000

    Perfect thank you so much!

  • Really appreciate that dop2000

    Where/how would I set a constant variable like that?

    I'm a little new to all this...

  • dop2000

    OMG of course...can't believe I missed that.

    Thanks for taking the time to check it out Dop.

    And thanks for the compliment! I know you've probably seen a lot of games here on this forum so that means a lot coming from you.

  • dop2000

    No problem here it is:

    Its a little bit of a mess as I am in the middle of switching from spawning a tile image to actually modifying the tilemap as I think it will be lighter on the system.

    Essentially I can know if the call wass successful if the player watering animation is triggered and the only time it works is if I use TileID:0 and not TileID:1282

    Here is a link to the file if you want to take a look: drive.google.com/file/d/1W-16XIjrOijjUH7soWGSFGXsywrzp2LG/view

    Thanks!

  • dop2000

    Thanks Dop!

    They are on separate layers but if that were an issue shouldn't the "set tile" action not work?

  • Hi all,

    My player has the ability to modify the tilemap. For example they can use the Hoe tool to change the tile from grass (TileID:0) to dirt (TileID:1282). And this works just fine, switching the tile successfully.

    Once they change grass to dirt, the next step is for them to be able to water that tile, but the watering can should only work on dirt tiles. So what I am trying to do is check that the tileID underneath my aimer (used for targeting) is equal to TileID:1282 and if so they can water the tile. For this I am trying to use the "Compare tile at" action:

    Compare tile at X: Tilemap.PositionToTileX(Aimer.X)

    Compare tile at Y: Tilemap.PositionToTileX(Aimer.Y)

    = Equal to

    Tile ID: 1282

    But this check never returns successfully, event though the tile underneath the aimer is a dirt tile (TileID:1282). What's odd is that if I set it to check for the grass tile (TileID:0), it does work. So I think that even though the tile image has been changed from grass to dirt, the tileID isn't actually being updated.

    Is that what is going on here? If so, is there any way to get the tileID to update as well as the tile image?

    Thanks in advance for your help!

    Tagged:

  • Hi all,

    I have been spinning my wheels trying to figure out how to build an item quantity tracker into my item pickup function.

    Essentially when the player picks up an item I want a number to appear in their inventory showing how many they have.

    The issue is every time the item is picked up, the function runs and it creates a new text object on top of the other one so they just keep stacking and it gets all jumbled.

    I tried destroying them and recreating it each time the item is picked up but it destroys the other item quantities.

    Here is my current config:

    And here is a link to my project file if you require more context: drive.google.com/file/d/1XcwPibvtKqQ79krFOU7Gy_eqV_tKZ90V/view

    Thanks in advance!

  • calminthenight

    Wow that simple eh? Haha that worked!

    Thanks so much!

  • Hi calminthenight

    Here is a link to my project file: drive.google.com/file/d/1NDH_3Aqj4FgjMksGCBrROOiC1z172uAS/view

    I have the numbers in the inventory right now (press space to hide and show the inventory bar)

    Thanks for your help!