[Bug] Door:setOpenedBy(key) doesn't persist through saves?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Ixnatifual

[Bug] Door:setOpenedBy(key) doesn't persist through saves?

Post by Ixnatifual »

antti wrote:Yeah, add a script entity and refer to the door with its ID. For example, if you would want to open a with the ID of dungeon_door_wooden_locked_1 with an iron key, you could add the following line to a script entity:

Code: Select all

dungeon_door_wooden_locked_1:setOpenedBy("iron_key")
I assume it's a bug, but if not, it's still something that's caused me more than a few headaches when testing my dungeon until I figured out what keys to sometimes work and sometimes just get tossed at the door, and I'd love to hear how to solve it!

Here's how to reproduce it:
- Put a dungeon_door_wooden_locked in your dungeon.
- Put a key nearby.
- Place a script_entity in your dungeon and write in it the above quoted code snippet (adjust if needed so your key and door match)
- Export the map and load it through the custom dungeon menu.
- Quicksave the game, then load the quicksave.
- The key will now no longer open the door.

It seems like the setOpenedBy operates on a local variable.
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: [Bug] Door:setOpenedBy(key) doesn't persist through save

Post by Magus »

Yeah, you're right.
Tried it and the key don't work after you load the game.

btw you could use a hidden pressure plate to run the script_entity again.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: [Bug] Door:setOpenedBy(key) doesn't persist through save

Post by petri »

Thanks for the bug report! I'll fix it for the next version.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [Bug] Door:setOpenedBy(key) doesn't persist through save

Post by Komag »

okay, this is weird, I'm trying to test this bug and also try the hidden pressure plate workaround with it being linked to the script setting the key to work on the lock. I'm not getting the result I thought I would get...

I added a teleporter and also linked the pressure plate to it just as an indicator for myself that the plate was working. The thing is, after quicksaving and quickloading, the teleporter doesn't activate/deactivate when stepping on and off the plate. That is, UNTIL I pick up the key off the floor, then the plate triggers the teleporter, and opens the lock. But I have to step off the plate and back on for it to work (I was standing right on it when picking up the key)

EDIT - the key was weighing down the pressure plate, duh!!!
So the pressure plate trick works for the mean time (and if there will be items there then set it to party only). The only issue is if the quicksave takes place when the party is standing on the plate right in front of the door, in which case they will have to step off then on again to make it work
Last edited by Komag on Tue Sep 18, 2012 9:33 pm, edited 2 times in total.
Finished Dungeons - complete mods to play
Ixnatifual

Re: [Bug] Door:setOpenedBy(key) doesn't persist through save

Post by Ixnatifual »

Komag wrote:EDIT - the key was weighing down the pressure plate, duh!!!
LOL! :mrgreen:
Personally I'm not bothering with a workaround for now. AH might fix it quickly, and then I'll have weird pressure plate workarounds lying around everywhere in my levels. :(
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [Bug] Door:setOpenedBy(key) doesn't persist through save

Post by Komag »

do you have lots of doors with keyholes in the middle? I have only one, preferring regular locks most of the time
Finished Dungeons - complete mods to play
Ixnatifual

Re: [Bug] Door:setOpenedBy(key) doesn't persist through save

Post by Ixnatifual »

I use them regularly, mixed in with the other lock types. Depends on the key in question, really.
Post Reply