Cedit and Player Corpses

  • WhiskyTest
  • WhiskyTest's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
6 months 1 week ago - 4 days 39 minutes ago #8094 by WhiskyTest
Cedit and Player Corpses was created by WhiskyTest
This is a snippet which adds a couple of configurable options into cedit.
The changes focus on corpse retrieval, and what happens to players items.
Update the settings using the cedit Gameplay menu, options T and U.


Corpse Creation Level
Set the level players have to reach before their equipment is transferred into their corpse upon death.
Intended to save new players from corpse retrieval while they are still acclimatizing to your MUD.

Corpse Decay Behavior
Define what happens when the corpse decomposes.
Default: the corpse is removed and all items are dropped into the room
Donate: the corpse is removed and all items are donated into a random donation room
Delete: the corpse and all objects are deleted from the game
Expandable so you can add your own ideas



Warning: Spoiler! [ Click to expand ]

File Attachment:

File Name: corpse_beh...2-09.zip
File Size:5 KB
Attachments:
Last edit: 4 days 39 minutes ago by WhiskyTest. Reason: Bug fixes
The following user(s) said Thank You: Banlock, Chime

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks ago #8113 by Chime
Replied by Chime on topic Cedit and Player Corpses
I was looking for something exactly like this. Thank you!

Please Log in or Create an account to join the conversation.

  • WhiskyTest
  • WhiskyTest's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
5 months 2 weeks ago #8124 by WhiskyTest
Replied by WhiskyTest on topic Cedit and Player Corpses
Most welcome!

And a bug correction, thanks to Vivienne:
case 'u':
    case 'U':
          write_to_output(d, "Select behavior of items upon PC corpse decomposition\r\n");
          write_to_output(d, "0) Default: items are left in the room\r\n");
          write_to_output(d, "1) Items are donated randomly\r\n");
          write_to_output(d, "2) Items are purged\r\n");
          write_to_output(d, "Enter choice: ");
          OLC_MODE(d) = CEDIT_CORPSE_DECAY_BEHAVIOR;
          return;
In the original, the numbers are all 1 higher than they should have been, making the decay behavior not what was expected.
The following user(s) said Thank You: Chime

Please Log in or Create an account to join the conversation.

More
5 months 2 weeks ago #8126 by Sascha
Replied by Sascha on topic Cedit and Player Corpses
By the way - this works beautifully, as intended, and I am loving it. Thanks so much for tackling it, Whisky!

Dovie'andi se tovya sagain. After the Breaking MUD, now in beta testing...

Please Log in or Create an account to join the conversation.

More
1 week 11 hours ago #8252 by Sascha
Replied by Sascha on topic Cedit and Player Corpses
So hmm. As I've been working on a mini-adventure I have noticed that when anything dies, their items are dropping into the room as soon as the mob is killed instead of staying on the corpse. I'm wondering if this snippet caused this?

Dovie'andi se tovya sagain. After the Breaking MUD, now in beta testing...

Please Log in or Create an account to join the conversation.

More
1 week 11 hours ago #8253 by Sascha
Replied by Sascha on topic Cedit and Player Corpses
Also, because items are being dropped into the room, when the (empty) corpse decomposes there's obviously nothing being sent to the donation rooms or auto-purged.

Dovie'andi se tovya sagain. After the Breaking MUD, now in beta testing...

Please Log in or Create an account to join the conversation.

  • WhiskyTest
  • WhiskyTest's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
1 week 4 hours ago #8254 by WhiskyTest
Replied by WhiskyTest on topic Cedit and Player Corpses
I'll double check but fairly certain it doesnt change mob corpses

Please Log in or Create an account to join the conversation.

More
6 days 20 hours ago #8255 by Sascha
Replied by Sascha on topic Cedit and Player Corpses
Here's what I see, my brilliant and creative friend... :)

[ 3715] The Lair of the Rat King [ DARK INDOORS * ] [ Inside ]
A part of the sewer tunnels has been blockaded by a morass of junk and litter.
In the far corner is a huge nest made of trash and old bleached bones.
Glittering objects litter the nest, interspersed with foul bits and pieces of
refuse. There are deep claw marks in the stone floor, and there are splashes of
something rusty on the lower parts of the tunnel walls.
[ Exits: n ]
[65535] The corpse of the big rat is lying here.
[3700] [T862] A pile of glittering objects has been gathered here.
[3713] A piece of fungus grows with an eerie light.
[3702] [T3703] A huge rat lashes its tail as you approach.
[3703] [TRIGS] The Rat King is standing here.

i1 510hp 110mn 92mv>
l king
At first look this creature is the largest rat ever seen. Its body is covered
in mottled fur and its beady eyes glitter with malice. On second look the fur
is actually clothing made from bits and pieces of animal skins, but the malice
in the man's eyes is very real.
The Rat King is in excellent condition.

The Rat King is using:
<worn on body> [3714] a fur shirt
<worn on head> [3719] a crown of twisted scrap metal
<worn on legs> [3715] some fur-covered leggings
<worn on feet> [3716] a pair of fur-trimmed boots
<worn on hands> [3717] a pair of claw-tipped fur gloves
<worn about waist> [3718] a beltpouch
<wielded> [431] a silver-chased dagger

You attempt to peek at its inventory:
Nothing.

i1 510hp 110mn 92mv>
k king
You chop it to pieces! Ah! The blood!
Your blood freezes as you hear the Rat King's death cry.

i1 510hp 110mn 92mv>
The protector rat stops following the Rat King.

i1 510hp 110mn 92mv>
l
[ 3715] The Lair of the Rat King [ DARK INDOORS * ] [ Inside ]
A part of the sewer tunnels has been blockaded by a morass of junk and litter.
In the far corner is a huge nest made of trash and old bleached bones.
Glittering objects litter the nest, interspersed with foul bits and pieces of
refuse. There are deep claw marks in the stone floor, and there are splashes of
something rusty on the lower parts of the tunnel walls.
[ Exits: n ]
[431] A sharp dagger with a silver-chased hilt glints in the light.
[3718] A beltpouch is here.
[3717] A pair of furry gloves tipped with sharp claws have been left here.
[3716] A pair of boots trimmed with fur stand together.
[3715] A scant length of fur is folded here.
[3719] Some shiny scrap metal has been twisted together into a band.
[3714] A shirt made of animal fur lies in a pile.
[65535] The corpse of the Rat King is lying here.
[65535] The corpse of the big rat is lying here.
[3700] [T862] A pile of glittering objects has been gathered here.
[3713] A piece of fungus grows with an eerie light.
[3702] [T3703] A huge rat lashes its tail as you approach.

i1 510hp 110mn 92mv>

Dovie'andi se tovya sagain. After the Breaking MUD, now in beta testing...
The following user(s) said Thank You: WhiskyTest

Please Log in or Create an account to join the conversation.

  • WhiskyTest
  • WhiskyTest's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
6 days 19 hours ago #8256 by WhiskyTest
Replied by WhiskyTest on topic Cedit and Player Corpses
Yep it's a bug!

I need to have a closer look at this when I get home, but for a quick fix try this:

in fight.c, make this change
+  /* Begin item transferal */
+  if (IS_NPC(ch) || (!IS_NPC(ch) && GET_LEVEL(ch) > CONFIG_CORPSE_LEVEL)) {
    
   /* transfer character's inventory to the corpse */
   corpse->contains = ch->carrying;
   for (o = corpse->contains; o != NULL; o = o->next_content)

I realize now that mob corpses will also be subject to the decay rules - was this what you wanted? Or only player corpse contents should get donated etc?..

Please Log in or Create an account to join the conversation.

More
5 days 20 hours ago #8259 by Sascha
Replied by Sascha on topic Cedit and Player Corpses
The idea is to not include the NPC corpses, so that if someone kills something and they don't loot it it remains for someone else to find or if unfound is left behind when the body decays. PCs should be the only ones subject to the decay rules. Thanks for checking!

Dovie'andi se tovya sagain. After the Breaking MUD, now in beta testing...

Please Log in or Create an account to join the conversation.

  • WhiskyTest
  • WhiskyTest's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
5 days 3 hours ago #8260 by WhiskyTest
Replied by WhiskyTest on topic Cedit and Player Corpses
Gotcha! I'll need to make some more changes.
Sorry I didn't catch this earlier it's kind of obvious now!..

Please Log in or Create an account to join the conversation.

  • WhiskyTest
  • WhiskyTest's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
4 days 34 minutes ago #8261 by WhiskyTest
Replied by WhiskyTest on topic Cedit and Player Corpses
Bug fixes uploaded into original post:
1) Mobs no longer affected by the decay behaviors
2) Players below the corpse retrieval level are now crash-saved upon being killed to correctly retain their equipment before extraction

Thanks Viv for highlighting these!

Happy to help if you need a hand updating your existing code

Please Log in or Create an account to join the conversation.

Time to create page: 1.773 seconds