Default death will move players into communal death room. Following code hacks imitates virtual void rooms so you can create a unique death scene or run specific functions through conditionals. Remember to back-up original files.
1. Create virtual room and container directory:
$ cd /domains/default/virtual/
$ cp void death.c
$ mkdir death
2. Modify room defines. Example below should insert line above ROOM_DEATH definition. Check your work!
$ ed /secure/include/rooms.h
$ 9,i
$ #define ROOM_VIRT_DEATH DIR_STANDARD_DOMAIN "/virtual/death"
$ .
$x
3. Modify room daemon
$ cd /secure/daemon/
$ cp rooms.c rooms.c.YYYYMMDD
$ ed rooms.c
Line 22, should be "static string void_room, SaveFile;". Change to:
static string void_room, death_room, SaveFile;
Line 40, the "#ifdef ROOM_VIRT_VOID" area, edit the next few lines to match the following
#ifdef ROOM_VIRT_VOID
err = catch(vvoid = load_object(ROOM_VIRT_VOID));
if(!err && vvoid) void_room = ROOM_VIRT_VOID;
#endif
#ifdef ROOM_VIRT_DEATH
err = catch(vvoid = load_object(ROOM_VIRT_DEATH));
if(!err && vvoid) death_room = ROOM_VIRT_DEATH;
#endif
if(undefinedp(void_room)) void_room = ROOM_VOID;
if(undefinedp(death_room)) death_room = ROOM_DEATH;
Line 70, add the following function
string GetDeath(mixed ob){
if(!ob) ob = previous_object();
if(!ob) return ROOM_DEATH;
if(void_room == ROOM_DEATH) return ROOM_DEATH;
if(stringp(ob)) ob = find_object(ob);
if(interactive(ob)){
return death_room+"/user_"+ob->GetKeyName();
}
return ROOM_DEATH;
}
indent with i save with x, update to check for errors. When no errors reported update recursively and test with
eval return ROOMS_D->GetDeath(TP)
it should return "/domains/default/virtual/death/user_(+your name)"
4. Modify player object
$ cd /std/
$ cp player.c player.c.YYYYMMDD
$ ed player.c
Line 156 In the eventDie() function look for "string agentname;". Change to:
string rdeath, agentname;
Line 194 We are now changing "this_object()->eventMove(ROOM_DEATH);" to
string rdeath = ROOMS_D->GetDeath(this_object());
( eventMove(rdeath) || eventMove(ROOM_DEATH));
Indent, exit, test with an update. If no errors-- update recursively.
At this point, if you haven't already, you might want to revise /domains/default/virtual/death.c with the contents of /domains/default/death.c
Log on your test character and test with:
eval return find_player("testdude")->eventDie("testing")