Feature Request | Varname = tileId x,y

In Comet, I play different sounds when you stand of different surfaces.

if tile_name=="path" then
	if footset==0 then
		sound "footstep path 1"
		footset = 1
	elseif footset==1 then
		sound "footstep path 2"
		footset = 0

I then name all my sand, wood, grass and path tiles the same name.
To keep the above code as simple as possible.

This is fine until you want to read what a tiles is for swapping.

So a bird that files over different surfaces will read it's target's tile as dock, move to that tile, and when it moves off of it, it will place down the first "dock" with the highest tile ID

If the name event could be updated to support
tile prototypes varname = name x,y
as well as tile IDs varname = tileId x,y

It would save me needing to multiply my code by x11 for each time I reference tiles.


A few people have asked me about this and told me it's already possible.

But to be clear
I know you an currently read a tiles name by using varname = name x,y

But I would like to read the tile ID
Something like varname = tileId x,y

Why do I want this?
I want it to keep my code clean.
There are times when you want all tiles with the same name to act the same way.
And there are times when you don't.

In my example above, I have a bird moving over surfaces.
Since all my grass tiles are named grass (as well as my dock tiles) and my path tiles are numbered. The bird will read the grass, step on to the grass but will place the wrong grass tile back.

It actually places this flower.

I have fixed this for my path tiles by numbering them but have not updated my code as I didn't want to make my player script longer than it already is :sweat_smile:

This issue doesn't just matter for this bird. it plays out the same way when I place the lamp down and will also be an issue when we make objects pushable.

Pulp already knows about tileIDs. If you hover over a tile in the editor it shows you.
And it seems to decide what tile to place if the names are the same.
So it feels like an obvious and hopefully simple include.

Others on discord have also asked how to get tileIDs as they assumed you could.

Let me know if this isn't clear enough.

1 Like

This feature has been added in the latest release.

Thank you @shaun!