A quick question about tilemap.get_bounds()

Hi !
I have a quick question about how to get the bounds of a tilemap . I put my empty tilemap in a Game Object with my script in it .

local x, y, w, h = tilemap.get_bounds("/map#tilemap")

But when I build , I get this error

/scripts/mapper.script:5: no instance could be found in the current script environment
stack traceback:
[C]: in function ‘get_bounds’
/scripts/mapper.script:5: in main chunk

And I’ve no idea how to fix it , because I think I’m doing everything as it should be !

Tilemaps can’t be expanded in size within code. You have to manually put a tile at the bottom left and top right of the tilemap to define it’s maximum size.

I’ve done that !

Are you sure about “/map#tilemap” path to the tilemap? Can you show the outline with the map game object and the mapper.script?

Because I’m new to Lua , I was thinking that i could put the code snippet right on top of the code … not in a function like “init” . I think that I genuinely fixed my problem ! (I hope so !)

but there is the hierarchy

I want to create the procedural map generation that @ross.grams mentioned in a recent thread about procedural generations . And I will be using the platypus extension , because i really like it ! :smile: (Please add more stuff to it ! It is perfect !)

Ah, yeah, you need to run your code within the lifecycle functions. Good catch!

Let me know if you have any suggestions and I’ll consider them!

I’ve not found anything really important that should be implemented for now, but maybe something about achievements ? This is just a quick idea that popped in my mind . I really like everything you’ve done ! Keep the good stuff and have a nice day !

EDIT: I saw that there is an asset for achievments , but this is just an idea ! :smile:

I think achievements should be handled separately from the platformer engine, in a separate extension. Platypus could perhaps provide some stats that could be used as a basis for achievements, but that’s about it I think.

1 Like

Yeah ! Maybe you are right ! Stats are something that will be really useful aswell !