Project Zomboid

Project Zomboid

44 ratings
ReviveMP
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
296.829 KB
10 Apr, 2022 @ 11:00am
11 Apr, 2022 @ 9:45pm
4 Change Notes ( view )

Subscribe to download
ReviveMP

Description
This mod allows you to return back to life by selecting "Revive" occupation in the character creation screen without losing any of your progress (weight, skills, skill boosts, traits and recipes. Can be changed which one(s) will be recovered in the SandBox settings). It will also set your occupation back to what it was when you die. Your new character's Forename and Surname must be same with the character you died with. (If you pick up "Revive" occupation but have no data stored on server, your character will be killed instantly so you can create a new character. This is to prevent people playing with "Revive" occupation. I couldn't find a way to delete the character so that's why I choosed to kill. Let me know if you have a better way.)

Tested on 41.66. (This mod only works in multiplayer)

Available Add-on List:
Name
Description
Adds a permanent injury to your character everytime he/she revives.
Adds an admin managament system to the game for allowing using the revive option.

Want to support development and motivate me?
[www.buymeacoffee.com]

Note:
This mod inspired by Respawn mod and developed solely for multiplayer. Respawn mod is saving your character data on client side even if you are playing on multiplayer. This can easily be exploited by simply editing your character's JSON file that's generated when you died and change the values inside. However ReviveMP saves your data on server-side which means no one can edit the values of the revive data.

To Modders:
If you wish to build a mod and take an action when a character revives, please add your callback function to ReviveMP.onReviveEventTable. Or if you want to save your own mod data to the revive data of the died character (which will be loaded when character revives and will be passed as parameter to callback function in onReviveEventTable) you can add your callback function to ReviveMP.onDeathEventTable.

-- Simply save all worn clothes by the character. -- Note that this callback function takes "IsoPlayer" object as parameter. function ReviveMPAddons.ExampleAddon.OnDeathEvent(player) local data = { clothes = {} } local inv = player:getInventory() local items = inv:getItems() for i=0, items:size() - 1 do local item = items:get(i) if item:IsClothing() and item:isEquipped() then table.insert(data.clothes, { fullType = item:getFullType(), condition = item:getCondition() }) end end return data end ReviveMP.onDeathEventTable.ExampleAddon = ReviveMPAddons.ExampleAddon.OnDeathEvent
Data returned from the ReviveMPAddons.ExampleAddon.OnDeathEvent will be saved to revive data under the "addonData" with the key of "ExampleAddon" as you assigned this callback function to "onDeathEventTable" using "ExampleAddon" key. As long as you avoid duplicate keys with other mods, you shouldn't be concerned with keys as ReviveMP will automatically pass your addon data. Now please see the example below about using the saved mod data. Also be sure to use same key names while assigning callback function to event tables of ReviveMP.

-- Simply give all the worn clothes back to player. (You need to write some more code to make them equipped when player revives, I will not do that.) -- Note that this callback function takes "IsoPlayer" object and your addon data that you saved at the other example as parameters. -- Always check if your addonData is null or not before proceeding. function ReviveMPAddons.ExampleAddon.OnReviveEvent(player, addonData) if not addonData then print("Oops! Please be sure you used the same key while assigning this callback and OnDeathEvent callback functions.") return end local inv = player:getInventory() for _,clothData in pairs(addonData.clothes) do local item = inv:AddItem(clothData.fullType) item:setCondition(clothData.condition) end end ReviveMP.onReviveEventTable.ExampleAddon = ReviveMPAddons.ExampleAddon.OnReviveEvent
With these you can implement your own add-ons like letting players keep their inventory after dying or giving them a negative trait as penalty of reviving. There are many possibilities, your imagination is your only limit.

Workshop ID: 2792421325
Mod ID: ReviveMP
38 Comments
FiFi 5 Mar @ 1:40pm 
I use good names for character but still i'm dying on respawn. Why? Somebody can help please?
Lunacity 27 Aug, 2023 @ 5:19am 
This does absolutely nothing
Drumnbass 3 Aug, 2023 @ 5:39am 
unmaintained abandoned mod, DON'T USE IT!
VaIIve_Is_Filth 16 Jun, 2023 @ 4:27pm 
this is trash; doesn't do anything.
The Marshal 22 May, 2023 @ 1:41pm 
We tried to use this mod on our server and it caused the server to throw a bunch of errors and crash a few times an hour. Worked find for the first few days but when the server kept crashing it was ReviveMP that was throwing the errors.
I don't know what the errors were, just letting you know. Does the mod conflict with immersive medicine?
Kaszd3g 28 Apr, 2023 @ 1:53pm 
@Zaphiel
I made an Add-on Mod for ReviveMP maybe you can check it and add it to your add-on list.
regarts
HardZ 29 Mar, 2023 @ 2:28pm 
One thing that could be useful in this mod that is still missing is the configuration of how much xp is recovered after death, as in the recovery diary mod, and can even be used together only with different xp recoveries.
Piniowy Chomiczek Bojowowy 30 Jan, 2023 @ 1:56pm 
Is there any equivalent of this mod for a single player game
Kalan 3 Jan, 2023 @ 10:01am 
Could you keep Zombie Kills Count?
PotatoDev 7 Oct, 2022 @ 4:05am 
I Did but it did not work i did the same forename and surname and when i spawn, it did not spawn me to where the character died at and i lost all my progress