INFO key - how to make a key DESCRIPTION With the lock system in /std/basic_lock it is very simple to make a key that fits a /std/door or a /std/box. A key is a /std/basic_thing with the alias "key" and the property "code" set to a string that acts as the "password" to the door. Here is an example of a key: inherit "/std/basic_thing"; reset(arg) { if (arg) return; set_name("bronze key"); add_alias("key"); set_short("A bronze key"); add_property("code","hemligt"); } or as a function: make_key() { object key; key = clone_object("/std/basic_thing"); key -> set_name("iron key"); key -> add_alias("key"); key -> set_short("An iron key"); key -> set_long("The key is a bit rusty."); key -> add_property("code","xyzzy"); return key; } It is also possible to make a key using /std/lib. "/std/lib"->make("key",([ "type" : "steel","code" : "foobar" ])); Read /std/constructors/key.c for more information on this. SEE ALSO /doc/std/basic_lock.doc
Help topics available:
COPYRIGHT | README | banish | castle | door |
ed | feelings | genders | general | hook |
key | mapsystem | prices | properties | rooms |
style/ | termcap | tourist_info | water_room_old |
You are guest number 119 since November 2019.
This file was last modified: June 2000.