Page 1 of 1

Random key/lock sytem - how?

Posted: Tue Nov 06, 2012 9:23 am
by Fhizban
akroma222 told me that crisman is working on something called a "random key/room generator".
I would like to ask you if someone else has a system like this in the working or has some thoughts about the subject.

its not the code, more the logic im asking for. who would this be done?

1. ok, you find random loot and there is a x% chance to find a key
2. the script scans the room you are currently in (big questionmark here) and looks for the nearest locked for
3. the script now spawns exactly the key that you require to open that door? (again big questionmark)

alternatively the game scans the whole level when starting and places keys in reachable tiles nearby the doors... :?:

and while i am already on it, has someone tought about similar scripts like:

* random secret door generator (place them in the editor and let a script decide wich one is open/closed)
* random trap generator

yep, im the "random guy" - you can guess wich road of development im taking :mrgreen:

Re: Random key/lock sytem - how?

Posted: Tue Nov 06, 2012 10:01 am
by cromcrom
I will release TLC source today, I am also very heavily involved in randomness, you will probably find systems to help you there. About almost everything is random, from craft to encounters to loot to whatever ^^

Re: Random key/lock sytem - how?

Posted: Tue Nov 06, 2012 4:49 pm
by crisman
I made a test dungeon with that script, if you are interested you can give it a try!
https://skydrive.live.com/?cid=74CFADF6 ... E98%215304
the file name is: Test.rar
Only the editor will open it.

What you have to do:
Don't move the starting point in the editor!
You'll find 2 keys in front of you, and a hall with doors scattered around. Each door can be opened by one, and only one, key.
Every room closed by a door contains a key - except the last one, with the golden locks.
The test is over when you open the door with the 2 gold keys.
(also having two gold keys in the inventory it's fine )
With each key found in the hub you must be able to find a gold key sooner or later.
Keys will open its appropriate locks (geared lock - gear key, prison lock - prison key etc...) the wooden door is opened by the brass key.

I think the script is fine, but if you are unable to complete the test dungeon, let me know!

EDIT: anyway, my script is not that hard. What I wanted to do is having a hub, with several locked doors, and the keys are in predetermined spots - which key you'll find thought, will be random. So the order the player will visit the hub, will be completely random. Of course, the script mustn't spawn a key right behind the door that opens.

Re: Random key/lock sytem - how?

Posted: Tue Nov 06, 2012 8:37 pm
by Fhizban
@crisman thanks, i guess that is the file akroma was talking about. ill check it out later!