Pits in DSB
Posted: Sun Oct 21, 2007 11:52 pm
I agree about starting a different thread, so I'll do that now
An "ipit" (that is, an invisible pit) needs a ceiling pit underneath, and, of course, custom pits are also a possibility. How does this version look to you?
A "fakepit" is just a floor decoration, without anything associated underneath, and doesn't really need any special treatement. It could be generated via this new spawn_pit with:
but a regular dsb_spawn will do the job too.
As for dsb_msg_chain, I'm not sure if there's any need to specify that in the editor. It's mainly used for things like pits where there's a need to create a hard link between two objects directly. The functionality can be duplicated by exvars and a custom message handler (The arch "x_relay" does exactly this) but it might be low enough level that only someone hacking around in custom code would care about it.

The original spawn_pit was kind of a hack. I didn't really think it through. The purpose of it, of course, is to automate the task of having a ceiling pit associated with a floor pit, but it kind of falls short in flexibility.RemyR wrote:I'm also using spawn_pit, but with no changes (and there's going to be a user setting to turn it off if people don't want it). My question is - it's currently only attached to 'pit's, not 'ipits' or 'fakepit's (I think thouse are what they're called) - should it be attached to all of them? Should there be seperate user settings for each? I imagine not (since 'ipit's are supposed to be invisible, and fakepits aren't really pits, but I thought I'd ask).
And one last question, before I think it's time to start a different thread, since we've veered way off the 'tc' exvar topic - 'dsb_msg_chain': is there another way to duplicate this functionality with exvars, 'cause currently there's no way to attach instances like this within the editor, and it may be neccesary.
An "ipit" (that is, an invisible pit) needs a ceiling pit underneath, and, of course, custom pits are also a possibility. How does this version look to you?
Code: Select all
function spawn_pit(lev, xc, yc, pit_type, ceil_pit_type)
if (pit_type == nil) then pit_type = "pit" end
local pit_id = dsb_spawn(pit_type, lev, xc, yc, CENTER)
if (ceil_pit_type ~= false) then
if (ceil_pit_type == nil) then
ceil_pit_type = "ceiling_pit"
end
local ceil_pit_id = dsb_spawn(ceil_pit_type, lev+1, xc, yc, CENTER)
dsb_msg_chain(pit_id, ceil_pit_id)
end
return(pit_id)
end
Code: Select all
spawn_pit(lev, x, y, "fakepit", false)
As for dsb_msg_chain, I'm not sure if there's any need to specify that in the editor. It's mainly used for things like pits where there's a need to create a hard link between two objects directly. The functionality can be duplicated by exvars and a custom message handler (The arch "x_relay" does exactly this) but it might be low enough level that only someone hacking around in custom code would care about it.