NerdanelVampire: You know about CAVE_ICKY, right? That's the flag that prevents you from teleporting inside a vault. I just had the bright idea of making a teleport-proof floor feature. I hate no-teleport levels and have decided that Zothiqband will have zero of those. However I've been thinking about quests lately. Vault-like areas you can't teleport into could potentially be very useful. In the name of transparency and the gamist design philosophy, I decided to make such floors clearly separate by color.
My problem is that I can't get the idea working. The following causes no error messages, but I tested in wizard mode and you can blink into it...
new_feature_type
{
define_as = "FEAT_ICKY_FLOOR"
name = "floor with a mysterious force-field"
display = '.' color = color.ORCHID
priority = 20
flags =
{
FLOOR=true SUPPORT_LIGHT=true CAN_RUN=true DONT_NOTICE_RUNNING=true
}
info =
{
CAVE_ICKY = true
}
}
I hope this isn't an engine limitation.
BucketMan: I don't entirely understand cave icky. It doesn't appear to behave consistently. However, if you want to forbid teleportation onto map squares, you could do that a via map.symbol definition like this:
map.symbol{ symbol='=' feat=FEAT_GRASS info=CAVE_ROOM | CAVE_ICKY }
That should work regardless of the terrain FEAT. If you wanted un-teleportable sqaures to be colored, you could create the FEAT, like you've done above, and then assign info=CAVE_ICKY in the map file that uses them. Of course, this wouldn't allow you to have un-teleportable terrain in randomly generated levels.
Curiously, I more often run into the exact opposite problem: I see routinely see map squares in DBT that cannot be teleported onto, yet I have no idea why.
DarkGod: LordBucket is right, CAVE_* are part of the running dungeon, not the features. So you must set them with map.symbol (or cave(y, x).info)
NerdanelVampire: Thanks. So that means I can do special levels with it. I'll use my feat with map.symbol so that the player gets the nice purple color and the forcefield message. I'll just have to quash all the ideas I was hatching about using that feat in normal dungeon generation, but oh well, that probably won't be a big loss.
BucketMan: To use it in normal dungeon generation, you might try setting a dungeon flag like this:
LEVEL_END_GEN = function()
for i = 1, cur_wid - 2 do
for j = 1, cur_hgt - 2 do
if cave(j, i).feat == FEAT_ICKY_FLOOR then
cave(j, i).info = CAVE_ICKY
end
end
end
end
DarkGod: Exactly, although it's better to add the flag than to override all others like that: cave(j, i).info = cave(j, i).info | CAVE_ICKY
NerdanelVampire: I finally got around to implementing this. I checked it and it works!
ToME Wiki