You can't do that with vaults, unfortunately, and I don't think you can tell the game to load a specific vault from f_info.txt.
However, what you can do instead is create it as a normal lua type map and tell the game to load it and where to place it on each level.
[EDIT:] Something like this should do:
Code: Select all
function big_hole()
if current_dungeon_idx == 19 then
local ysize, xsize = get_map_size(hole)
local tries = 0
--msg_print(format("ysize= %s, xsize= %s", ysize, xsize))
while TRUE do
if ysize < cur_hgt and xsize < cur_wid then
load_map(hole, cur_hgt/2 - ysize/2, cur_wid/2 - xsize/2)
break
else
player.leaving = TRUE
tries = tries+1
if tries >= 200 then
msg_print(TERM_VIOLET,"Warning: could not place hole")
break
end
end
end
end
end
add_hook_script(HOOK_LEVEL_END_GEN, "big_hole", "hig_hole")
hole =
[[#!map
F:#:87:0
D: ## # # # #
D: ### ## ####
D: ## ######## ##
D: ############
D: ############
D: ## ### ### ###
D:# # # ##
]]
It loads the "hole" map in the middle of a level. It's set up for the orc caves atm (dungeon idx 19), and places the #'s as "dark pit" feature(no.87). You can of course change it to anything else, and change the hole to look as you need.
This will create the same size / shape hole in the middle of every level. If you want a variable size, random hole on each level, then I expect I could find some means of doing that as well. This would probably be the ideal solution, since it would eliminate size problems.
I wasn't sure whether it would do this exactly as I wanted, since I was afraid that it would replace the entire rectangle (spaces included), or that it was possible to find the x and y size, but it all seems to work fine.
[
EDITn+1: changed the script above to mean that it'll effectively regenerate the level if the first one is too small for the map, up to the tries limit, at which point it'll give the error.]
(For history's sake: here is the get around script that I foolishly wrote first to get around the non-existant problems...)
Code: Select all
function big_hole()
if current_dungeon_idx == 19 then
local i,j
local lenm = strlen(hole[1])
--msg_print(format("wid = %s, hgt = %s", cur_wid, cur_hgt))
for j = 1, getn(hole) do
for i = 1, strlen(hole[j]) do
if strlen(hole[j]) > lenm then
--msg_print("Increasing lenm")
lenm = strlen(hole[j])
end
end
end
if cur_wid >= lenm and cur_hgt >= getn(hole) then
--msg_print("Hole placement started...")
local starty = cur_hgt/2 - getn(hole)/2
local startx = cur_wid/2 - strlen(hole[1])/2
--msg_print(format("starty = %s, startx = %s", starty, startx))
for j = 1, getn(hole) do
for i = 1, strlen(hole[j]) do
if strbyte(hole[j], i) == strbyte('#') then
cave(starty + j, startx + i).feat = 87
end
end
end
elseif cur_wid < strlen(hole[1]) then
msg_print("Warning: width too small to place 'hole'")
else
msg_print("Warning: height too small to place 'hole'")
end
end
end
add_hook_script(HOOK_LEVEL_END_GEN, "big_hole", "hig_hole")
hole =
{
[[ ## # # # # ]],
[[ ### ## #### ]],
[[ ## ######## ##]],
[[ ############ ]],
[[ ############ ]],
[[ ## ### ### ###]],
[[# # # ## ]],
}