Can be detected if a player is inside a tile

Apamaster

  • Posts: 118
My idea is to detect if a player is inside a tile that has no collision. I know that behaviors in the world exist on tiles, but I only saw an example in the forum.
The idea is to use a tile without collision as a region if the character enters the tile something happens.
of the tileset tile 1A no collision template:
Example the player is inside tile 1A or step, if so then player dies.

JeffreyDriver

  • Posts: 2262
Yes, you can check if a tile exists at a certain XY location. SCENES > WORLD > TILES

You'll need to convert the XY value to a row/column value but there are the blocks for that.

Apamaster

  • Posts: 118
but I do not understand how to use it, I put 1 1 which would be the first frame that has a tile but only returns -1, and in the section anything I should put?
this gives error when I compile I put in the coordinates 0 0 create a block in layer 0 and I suppose that from tile set id must go 1 which is the only tile I have.

« Last Edit: February 01, 2020, 06:17:29 pm by Apamaster »

Luyren

  • *
  • Posts: 2719
My idea is to detect if a player is inside a tile that has no collision.
The block JeffreyDriver mentioned checks if a collision of a tile exists at the given collumn/row.  A tile without collision cannot be used for what you are describing. Use an actor with a sensor collision instead if you plan to go with that idea.

If you do need more info on the blocks for tiles, read here: http://www.stencyl.com/help/view/tile-api
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Apamaster

  • Posts: 118
I already solved the problem, I already understood how it works although there are more examples of api uses.

ichimitch

  • Posts: 73
I'd place an sensor-actor which uses the "hide sprite" block in a when created event (rather than an actor which looks like a tile). That way you can reuse it along side any other tile.