I post here besides my searches for hints. So sorry if I missed the answer somewhere. Also I'm rather bad at programming.
But here we are :
I want to press a hidden button and make spawn an alcove with a brass key inside :
Code: Select all
function ThugsAlcove() spawn("dungeon_alcove", 3, 5, 19, 2):addItem(spawn("brass_key")) end
I've been looking for this solution for the same problem at level one : I want a gladiator spear statue to stand in front of the door. But the wallset isn't solid so you can go through it. But I place here a secret door then the secret will hide most parts of the statue. As well if I try to destroy the statue and spawn it elsewhere then the statue can be partly hidden by the wall set already generated by the game.
Later to access a chest (that is meant to be opened with the brass key) I want the party to step in on a pressure plate, it actually toggle a secret door but stepping out closes it. What stepping on the pressure does aswell is spawn a secret button on a wall, let's say the south one, upon switching it, it despawns and spawns another button on the opposite wall, upon switching it it despawns to spawn a third one on the secret door, upon switching it, it opens the door and deactivate the pressure plate. So I wrote this :
Code: Select all
if pressure_plate_hidden_2:isDown() then SpawnSB1() end function SpawnSB1() spawn("dungeon_secret_button_small", 3, 3, 16, 2, "THSBVault_1") THSBVault_1:addConnector("toggle", "THSecretVault", "SpawnSB2()") THSBVault_1:setActivateOnce(true) end function SpawnSB2() spawn("dungeon_secret_button_small", 3, 3, 16, 0, "THSBVault_2") THSBVault_2:addConnector("toggle", "THSecretVault", "SpawnSB3()") THSBVault_2:setActivateOnce(true) spawn("dungeon_secret_door", 3, 3, 16, 2) THSBVault_1:destroy() end function SpawnSB3() spawn("dungeon_secret_button_small", 3, 3, 16, 3, "THSBVault_3") THSBVault_3:addConnector("toggle", "dungeon_secret_door_3", "open") THSBVault_2:setActivateOnce(true) spawn("dungeon_secret_door", 3, 3, 16, 0) THSBVault_2:destroy() end
What it actually does is that it spawns the first secret button but it is hidden by the wallset (that makes a super-hidden super-secret button !) but doesn't trigger the spawning of the others.
Alos to the developpers : would it be possible to have a third AI state like "friendly" to make npcs ?
edit : edited the code of the script (named THSecretVault)
Thank you )