triggering an event from an alcove

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
gamefanatic
Posts: 12
Joined: Fri Oct 05, 2012 1:37 am

triggering an event from an alcove

Post by gamefanatic »

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.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: triggering an event from an alcove

Post by Neikun »

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.
"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
  • Message me to join in!
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: triggering an event from an alcove

Post by Skuggasveinn »

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.
This sentence is confusing me !!! , I feel like it's in contradiction

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
what we are doing here is we have an alcove that is set to event=any and it targets a script with that code inside it.
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.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
gamefanatic
Posts: 12
Joined: Fri Oct 05, 2012 1:37 am

clarification of the problem

Post by gamefanatic »

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.
gamefanatic
Posts: 12
Joined: Fri Oct 05, 2012 1:37 am

I fixed the problem

Post by gamefanatic »

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!
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: triggering an event from an alcove

Post by Komag »

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
Post Reply