Page 1 of 1

[mod] Symbol locks

Posted: Tue Jun 25, 2013 12:33 pm
by AdrTru
There is my new mod. ( it is testing room with some locks )
http://grimrock.nexusmods.com/mods/274/?

This mod is maged alcove( again :) ) looks like lock but event from unlock is only in script.
Readme file is included in mod_assets/symbol_lock/.
SpoilerShow
empty keyhole
Image

full keyhole - wrong disk
Image

full keyhole - correct disk
Image

atlas of disks
Image
Function:
1/you put "symbol_lock_alcove" into dung
2/put "symbolLck_setkey" item(image) into alcove
3/when is putted disk of same type is locked in alcove and lock is unlocked
/when isnt putted setkey image - alcove will be unlocked by every disk
4/when is lock unlocked -> call function Unlocking(lock,key)

BUG:
At the end of function PickUp(self,item,g) is line:
lastItem = item Please delete this line.

Re: [mod] Symbol locks

Posted: Tue Jun 25, 2013 1:22 pm
by Komag
That's very nice, well done :)

Re: [mod] Symbol locks

Posted: Wed Sep 11, 2013 6:20 am
by Hustin
This is very nice!

I've made a few small enhancements to it for my first mod, and I wanted to make it available. Feel free to take a look at it and if you want to post it on Nexus feel free :)

http://www.mediafire.com/download/tn721 ... 130911.zip

Changes:

1. Added support for making locks re-lockable. You do it by adding a symbolLock_lockable item to the alcove, either in the editor or with a script (if you want the rune stones to only be removable at a certain time). sl.lua contains the extra methods for it.

2. Added support for disabling locks. A disabled lock hides the lock type that it requires and won't let you unlock it (it will let you re-lock an unlocked one, though, so be careful). You can disable a lock by adding a symbolLock_disabled item to the alcove. Likewise, sl.lua contains extra methods so you can do it from a script.

3. Moved all locks away from the wall by 0.05 units (z-= 0.05) so that temple wallsets don't poke through the model. Unfortunately I run LoG on a modded Windows 2000 SP4 PC so I can't run the model editor (it uses a version of .NET that requires XP). I make my modest model changes by editing the files with a hex editor :oops:

4. There are extra .model files for the two new modes, altered to use different materials to set them apart.

Re: [mod] Symbol locks

Posted: Wed Sep 11, 2013 6:44 pm
by AdrTru
Thank you for your interest of my mod :)
I invited all new features of my mods and I will poblished your changes on nexus after check it.

Now I am little bit bussy with my another mod(swarm), but your changes I like.

(one problem I found in first look ->
you made second function Unlocking(lock, key),
and use counter_mage1:decrement() in it. )

Re: [mod] Symbol locks

Posted: Thu Sep 12, 2013 1:04 am
by Hustin
Oops, that was part of my mod. Consider it an example :oops:

Re: [mod] Symbol locks

Posted: Sat Sep 14, 2013 11:11 pm
by AdrTru
I publised update integrated changes with Hustin
( Changes does not completely tested - please of BugReport)

-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
changes in update by Hustin
--------------------------------------------------------------------------------
Some changes with models.

events functions:
Callback used whenever any lock is being unlocked. Place dungeon-specific logic here.
- onUnlocking(lock,key)
- onLocking(lock, key)

set functions:
- setLocked(lock) - Unlocks the lock by destroying any "symbolLock_unlocked" items in the alcove
- setUnlock(self,key) - Unlocks the lock by adding a "symbolLock_unlocked" item to the alcove
- setDisable(lock) - Prevents a lock from being unlocked by adding a "symbolLock_disabled" item to the alcove.
- setEnable(lock) - Allows a lock to be unlocked by destroying any "symbolLock_disabled" items in the alcove
- setMakeLockable(lock) - Allows the player to lock a symbol lock by removing the disk
- setMakeNonLockable(lock) - Prevents the player from unlocking a symbol lock by removing the disk

testing functions:
- isUnlocked(lock) - Returns whether the lock is unlocked
- isLockable(lock) - Returns whether the lock can be locked
- isDisabled(lock) - Returns whether the lock is disabled
- getRequiredKey(lock)

Thank you Hustin

Re: [mod] Symbol locks

Posted: Fri Sep 20, 2013 9:36 pm
by AdrTru
Thank to maneus for dicover bug in "sl" script entity.
as I tested my mod a little I get a game crash when I was saving. It says something about the "sl" script of your symbol lock.
It says "sl: cannot serialize table `lastItem`with metatable stack traceback".

At the end of function PickUp(self,item,g) is line:

lastItem = item

Please delete this line.