Alcove item remove

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
DeDy
Posts: 132
Joined: Sun Oct 07, 2012 3:41 pm
Location: Brno, Czech Republic

Alcove item remove

Post by DeDy »

Hi, need help alcove script.
In alcove is "SnakeKey"
party take key = open pit
party insert key to alcove = close pit

Thanks
Nightfall: First Contact – http://dedy.euweb.cz/nightfall.html
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Alcove item remove

Post by crisman »

Try this script, but first you need to add a coounter. Don't forget to connect the alcove to the script with activate always ticked, and set to "any" the event.

function pitOpen()
counter:setValue(0)

for i in alcove:containedItems() do
if i.name == "SnakeKey" then
pit:close()
counter:setValue(1)
end
end

if counter:getValue() == 0 then
pit:open()
end

end
User avatar
DeDy
Posts: 132
Joined: Sun Oct 07, 2012 3:41 pm
Location: Brno, Czech Republic

Re: Alcove item remove

Post by DeDy »

counter is good idea, thanks
Nightfall: First Contact – http://dedy.euweb.cz/nightfall.html
User avatar
DeDy
Posts: 132
Joined: Sun Oct 07, 2012 3:41 pm
Location: Brno, Czech Republic

Re: Alcove item remove

Post by DeDy »

If add false key to alcove script is not work. Please help.
SpoilerShow
function SnakeKey()
counter_snake_key:setValue(0)

for i in alcove_snake:containedItems() do
if i.name == "snake_key" and "snake_key_false" then
dungeon_pit_52:close()
dungeon_pit_53:close()
counter_snake_key:setValue(1)
end
end

if counter_snake_key:getValue() == 0 then
dungeon_pit_52:open()
dungeon_pit_53:open()
end
end
Nightfall: First Contact – http://dedy.euweb.cz/nightfall.html
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Alcove item remove

Post by crisman »

I need to know how the pits should behave.
They must close when both keys are inside the alcove?
I think... you want to swap the right key key with the fake one to keep the pits close, right?
If so, should be (haven't tested)
SpoilerShow
function SnakeKey()
counter_snake_key:setValue(0)

for i in alcove_snake:containedItems() do
if i.name == "snake_key" or i.name == "snake_key_false" then
dungeon_pit_52:close()
dungeon_pit_53:close()
counter_snake_key:setValue(1)
end
end

if counter_snake_key:getValue() == 0 then
dungeon_pit_52:open()
dungeon_pit_53:open()
end
end
EDIT: just realised you haven't put
i.name ==
right before "snake_key_false"
maybe it's just for that.
User avatar
DeDy
Posts: 132
Joined: Sun Oct 07, 2012 3:41 pm
Location: Brno, Czech Republic

Re: Alcove item remove

Post by DeDy »

work correct, thanks :)
player first take on alcove snake_key_false, after snake_key
must return false key to alcove = pit close (test combinations OK)
Nightfall: First Contact – http://dedy.euweb.cz/nightfall.html
Post Reply