[mod] Symbol locks

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

[mod] Symbol locks

Post 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.
Last edited by AdrTru on Sat Sep 21, 2013 6:31 pm, edited 2 times in total.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [mod] Symbol locks

Post by Komag »

That's very nice, well done :)
Finished Dungeons - complete mods to play
Hustin
Posts: 105
Joined: Thu May 31, 2012 7:26 am

Re: [mod] Symbol locks

Post 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.
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: [mod] Symbol locks

Post 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. )
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
Hustin
Posts: 105
Joined: Thu May 31, 2012 7:26 am

Re: [mod] Symbol locks

Post by Hustin »

Oops, that was part of my mod. Consider it an example :oops:
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: [mod] Symbol locks

Post 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
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: [mod] Symbol locks

Post 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.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
Post Reply