Adding custom DeathNotes in the config for Cave Spikes, Sharks --causes secondary issue with Rustcord.Solved

I've started looking at this plugin and found that I have to edit the CS file to enable the sharks because as it is now, they're only triggering the Animal messages. I've also had to introduce different code to handle the cave spikes and motorbike as they're a Barricade and Bike but need to use the ShortprefabName to trigger the messages. Is there a way to add these messages by using the config only and not have to edit the CS each update? It looks like they're in the config but they don't get called on the death event for some reason.

Also, when I do hack these in, it appears that Rustcord won't pick up the DeathNote. Most of the other ones work fine except the ones I added and the Minicopter death message. Could it be how I'm adding them to the enum and CASE statements in the CS?

No plugin tweaks should be necssary. I highly recommend moving your config file elsewhere and lettting the updated plugin build a new, fresh config upon plugin startup, and then re-tweak your death messages. Some death notes were added that don't get incorporated if you have an existing config file. Sharks, for example, should show up in the config as:
{
"KillerType": "Player",
"VictimType": "SimpleShark",
"DamageType": "*",
"Messages": [
"{killer} killed a {victim} using their {weapon}."
]
},

I've noticed that Rustcord is definitely out of date for some messages because of the updates (enum changes). I have it on my todo list to take a better look and let the maintainer know.

I just unloaded the mod, deleted all the files from the Plugins, Config, and Data folders for DeathNotes. Then I re-downloaded it from this site and moved the CS into Plugins. It compiled and created the new config which I confirmed was created. I loaded in, spawned a bunch of simplesharks in the ocean, and the death message was the Animal one. "CPanoplyd couldn't run away from the Shark."

Thanks for performing this test. I apologize, I mis-spoke about the sharks, and the shark entries in the configs were relics from early tests that I didn't remove. You can only generate different death note messages based on entity types, and sharks (until now) did not have a unique entity type. I had them fall under the Animal category, so the messaging was always the same as the Animal messages. Sharks are a unique enough critter where I believe they deserve their own unique entity type, so I went ahead and added "Shark" as a new entity type. This change will be included in the next release of Death Notes. Thanks for bringing this to my attention.

Thank you for the prompt replies. Can you do the same with the Cave Spikes vs the player deployable barricades? They're both barricades but the shortprefabname for the cave spikes is spikes_static.

I would also like to thank you for being promt with this. Cpano and I spent around 6 hours playing with it. He did most of the heavy lifing though. 

I greatly appriciate the plugin. 

DWGJay, you're welcome! CPanoplyd, the fix is pretty simple. First, know that Rust calls spikes_static "Wooden Floor Spikes" (you see it at the top of the respawn screen). The code fix is simple, I just added this near the top of the plugin code (this will be incorporated into the next release):

private readonly Dictionary<string, string> _enemyPrefabs = new()
{
["spikes.floor"] = "Wooden Floor Spike Cluster",
["spikes_static"] = "Wooden Floor Spike Cluster",
["barricade.woodwire"] = "Barbed Wooden Barricade",
["barricade.metal"] = "Metal Barricade",
["wall.external.high.wood"] = "High External Wooden Wall",
["wall.external.high.stone"] = "High External Stone Wall",
["gates.external.high.stone"] = "High External Stone Gate",
["campfire"] = "Campfire",
["skull_fire_pit"] = "Skull Fire Pit",
["heavyscientist"] = "Heavy Scientist"
};

After making that change, Death Notes will call them Wooden Floor Spike Cluster, or whatever you want to name it. I found that Wooden Floor Spike Cluster worked well with the "a Barricade" death note.



Merged post

This fix been incorporated in release 6.4.4.
Locked