[NOT Solved] How can you remove walls you didn't spawn?
Posted: Thu Oct 30, 2014 1:33 am
I had asked:
So I can dynamically spawn walls and invisible walls. I also can use the destroy() command on these walls and they can be removed. Cool.
But how about one of the walls you placed in the editor? No idea how to access that let alone remove it. Any ideas?
I figured it out. First you use the entitiesAt() command. You get a table of whatever is in that square. In it will be the walls, pillars, floors and ceilings you defined in the editor! The IDs are system generated and they seem to increase each time the map is played. But you can read the "name" attribute to determine what type of entity it is. So you can look for any "wall" name and call destroy() on it. The wall disappears.
UPDATE: Damn it! I had no clipping on it the editor. Sure the wall texture disappears but the invisible wall doesn't. You can't walk thru it. And when you list entities at the square that is wall, you get nothing. UGH. This is tough.
UPDATE 2: So the map object has getAutomapTile() and setAutomapTile(). This is the values you see in dungeon.lua in the "tiles" table. And I can change them to, setAutomapTile changes it. But it doesn't change a thing. I still can't walk thru the squares and nothing visually is altered. I thought I found it. NOPE. Maybe I won't. Maybe we can't do it. Seems like a FAIL if we can't.
So I can dynamically spawn walls and invisible walls. I also can use the destroy() command on these walls and they can be removed. Cool.
But how about one of the walls you placed in the editor? No idea how to access that let alone remove it. Any ideas?
I figured it out. First you use the entitiesAt() command. You get a table of whatever is in that square. In it will be the walls, pillars, floors and ceilings you defined in the editor! The IDs are system generated and they seem to increase each time the map is played. But you can read the "name" attribute to determine what type of entity it is. So you can look for any "wall" name and call destroy() on it. The wall disappears.
UPDATE: Damn it! I had no clipping on it the editor. Sure the wall texture disappears but the invisible wall doesn't. You can't walk thru it. And when you list entities at the square that is wall, you get nothing. UGH. This is tough.
UPDATE 2: So the map object has getAutomapTile() and setAutomapTile(). This is the values you see in dungeon.lua in the "tiles" table. And I can change them to, setAutomapTile changes it. But it doesn't change a thing. I still can't walk thru the squares and nothing visually is altered. I thought I found it. NOPE. Maybe I won't. Maybe we can't do it. Seems like a FAIL if we can't.