


I like the idea of having some that meet the lava, ill look into that. Yes the red crystals will be placeable for the ceiling and floor.
Code: Select all
{
class = "Null",
onInit = function(self)
local x = self.go.x
local y = self.go.y
local facing = self.go.facing
local level = self.go.level
local fx,fy = getForward(facing)
local rx,ry = getForward((facing+1)%4)
do
local x = self.go.x + fx
local y = self.go.y + fy
if x >= 0 and y >= 0 and x < 32 and y < 32 then
self.go.map:setAutomapTile(x, y, 4) -- rocky wall
end
end
--destroy wall slopes
for yy=-1,1 do
for xx=-1,1 do
local x = x + rx * xx + fx * yy
local y = y + ry * xx + fy * yy
if x >= 0 and y >= 0 and x < 32 and y < 32 then
for e in self.go.map:entitiesAt(x, y) do
if e.name == "rc_wall_slope"
or e.name == "rc_edge_support_01"
or e.name == "rc_edge_support_02"
or e.name == "rc_edge_support_03"
or e.name == "rc_edge_support_04"
or e.name == "rc_edge_support_01b"
or e.name == "rc_edge_support_02b"
or e.name == "rc_edge_support_03b"
or e.name == "rc_edge_support_04b"
then e:destroy()
end
end
end
end
end
end
},
I use it to destroy objects around a particular asset, such as stairs, chasms, contraptions etc. The way Red Cave is set up, some details stick out and over other things, so I have that component on some objects to automatically destroy them so you wont have worry about it. Its a small thing for me to have this destroy objects on a certain elevation, just wanted to see if it was easily possible to add, if its more complicated then I'm cool with out it
Yep your right hahaha, again I'm just stupid lol. I had it on the wrong object." Face Palm"Isaac wrote: ↑Tue Jul 23, 2019 3:59 am That's what I had thought. I haven't scrutinized the script yet. I asked because I made a test map, and defined my own objects named "rc_wall_slope", "rc_edge_support_01" ,"rc_edge_support_02", "rc_edge_support_03", "rc_edge_support_04", "rc_edge_support_01b", "rc_edge_support_02b", "rc_edge_support_03b", and "rc_edge_support_04b".
I then placed my test objects on the map, each having the Null component (and even placed on the same tiles as the RC assets), and nothing happened. I then added a print(e.name) statement just before the e.destroy() statement, and nothing printed.
entitiesAt(x,y) includes all elevations.