Hi everyone. Hope your having fun with the editor.
I want to set up a trap/puzzle that when you remove a iron key from a dungeon alcove then a trap door is opened. The logic I have will
only open the trap door if the key is returned to the alcove. Removing the key doesn't open the trapdoor.
These are the settings I have for the alcove and trap door.
Dungeon Alcove: Activate always is checked. Contents: iron key. Event: Activate; Target: dungeon_pit_1; Action:open
Dungeon Pit: trap door checked. Initial State closed.
Thanks in advance for any help.
triggering an event from an alcove
Re: triggering an event from an alcove
Turn off activate always.
You want your activation as always, your target being the pit and your event being toggle.
It should be noted that the player will be able to fool this by placing any other item into the alcove.
You want your activation as always, your target being the pit and your event being toggle.
It should be noted that the player will be able to fool this by placing any other item into the alcove.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: triggering an event from an alcove
This sentence is confusing me !!! , I feel like it's in contradictionI want to set up a trap/puzzle that when you remove a iron key from a dungeon alcove then a trap door is opened. The logic I have will
only open the trap door if the key is returned to the alcove. Removing the key doesn't open the trapdoor.
Anyway, If you want to open a trapdoor when someone moves a key from an alcove, and close the trapdoor if the key is replaced you can to something like this.
(btw have a look at the scripts repository viewtopic.php?f=14&t=3099 this is VaeVictis scripts that he placed there.)
Code: Select all
function DoWeHaveKey()
local itemName = "iron_key"
local alcoveID = dungeon_alcove_1
for i in alcoveID:containedItems() do
if i.name == itemName then
dungeon_pit_1:close()
else
dungeon_pit_1:open()
end
end
end
The script simply runs everytime you do something to the alcove (hence the event=any).
you have defined the name of the alcove as dungeon_alcove_1 and the item as iron_key (feel free to rename here)
when the scripts runs it goes to dungeon_alcove_1 and checks of iron_key is inside, if thats the case dungeon_pit_1 is closed.
if the key is removed then dungeon_pit_1 is opened.
hope this helps.
-
- Posts: 12
- Joined: Fri Oct 05, 2012 1:37 am
clarification of the problem
What I want to happen is that when the key is picked up from the alcove by the party then the trap door opens.
When I pick up the key the trappdoor isn't opening. Nothing triggers. The trigger is activated when the key is put back which is opposite to what I want to happen.
When I pick up the key the trappdoor isn't opening. Nothing triggers. The trigger is activated when the key is put back which is opposite to what I want to happen.
-
- Posts: 12
- Joined: Fri Oct 05, 2012 1:37 am
I fixed the problem
I only needed to change the EVENT to ANY for the dungeon alcove. Now when I remove the key the trapdoor opens.
Thanks to everyone who offered help. And so quickly!
Thanks to everyone who offered help. And so quickly!
Re: triggering an event from an alcove
glad you got it figured out! the Event logic is a stumbling block to lots of people learning the editor, hard to really get your head around how that works at first
Finished Dungeons - complete mods to play