Revive
Go down instead of dying when a friend is near. Hold a key to revive a downed player before the timer ends. The server sets the numbers.Revive
Part of FlyingHose's Modpack. Needs only BepInEx.
In the base game, when your health runs out you die and wake up at your bed. With this mod, if a friend is close, you go down instead. You get a short time for them to pick you up before the normal death happens.
Going down
When a hit would kill you and at least one other living player is within 60 metres, you do not die. You go down for 30 seconds.
While you are down:
- You cannot move, attack, block, jump, use items, or open the inventory.
- You take no more damage.
- Your screen shows a countdown, and how to look into the light if you would rather not wait.
- Monsters stop picking you as a new target.
- You can still look around, use the chat, and open the game menu.
If nobody is that close, you do not go down. You die at once, the normal way. A player who is already down does not count as a friend, because a downed player cannot revive anyone.
Reviving a friend
Stand within 3 metres of a downed player and look at them. The text under your crosshair says they are down and how long they have left. Hold the Use key (E unless you changed it) for 3 seconds. The percent on the text grows as you hold.
If you let go, look away, or step out of range, the hold starts over from zero. You cannot revive while you are in build mode with the hammer, because the game turns off looking at things in build mode. You cannot revive while you are down yourself.
When the hold finishes, the downed player gets up with 25 percent of their max health and cannot be hurt for 3 seconds. You both get a message. You can change the key with Keys.ReviveKey. It stays on the game's Use button until you set it.
When the timer ends
If nobody revives you in 30 seconds, the normal death happens. It is the game's own death, not a copy: your gear goes into a tombstone, you lose skill points as usual, and you respawn at your bed. The mod does not change what you lose or where your things go. It only waits before the death runs.
Giving up
If you would rather not wait, you can choose death. While you are down, the text under your crosshair says Hold [E] to look into the light. Hold the Use key (E unless you changed it, or the use button on a gamepad) for 2 seconds. A bar and a percent fill as you hold. Let go early and the bar starts over from zero.
When the bar is full, the normal death happens at once, the same one the timer would give you. You see "You looked into the light." and every other player sees "NAME looked into the light." at the top left.
The hold does not start in your first second of being down, and a key that is already down when you fall does not count. Let go once, then hold. It also does nothing while you are typing in the chat, the console, or a text box.
Change how long the hold takes with Downed.GiveUpHoldSeconds. Change the key with Keys.GiveUpKey: None uses the game's Use button, and any other key means hold that key instead. There is no way to turn giving up off, because it is only ever a deliberate hold. If your config file still says Delete from version 0.1.0, it now means hold Delete.
Once per life
You can go down once per life. After you are revived, a lethal hit within the next 60 seconds is a normal death, with no waiting. After 60 seconds you can go down again. Dying the normal way starts a new life, so the 60 seconds no longer matter.
Deaths that stay normal
Some deaths are never turned into a downed state, even with a friend beside you. Falling off the edge of the world, lava, the Ashlands sea, an incinerator, the console kill command, being under the ground, and dying while teleporting or in a cutscene all kill you the normal way.
Logging out while down
Logging out does not get you out of a death. The moment you go down, the mod writes a small record into your character: which world you are in, how many seconds you had left, and a version number. It keeps the seconds current every 5 seconds. The record is saved in the same write as your gear and health, so a character saved while down always says so. It is removed the moment you are revived or the game's own death runs.
When you log back in, you come back still down. Once you have spawned and stood in the world for about 5 seconds, you are put straight back into the downed state where you stand, and you see "You are still down." You get the time the record says was left, never more than Downed.Seconds and never less than 10 seconds, so a friend who is there can still pick you up. Until that happens you cannot move or use items.
If nobody is within Downed.FriendRadius, the normal rule applies: no downed state, and the normal death at once, right where you logged out. That is the game's own death, with the tombstone, the skill loss, and the respawn at your bed. The once-per-life cooldown does not stop this and does not give you a way out of it.
The record belongs to one world. If your character carries a record from a different world, it is left alone and keeps waiting until the character is back in that world. A record with a version this build does not know is left alone as well. If Revive.Enabled is off on the server, nothing happens and the record stays.
A crash or a lost connection is different, because the game cannot save at that moment. Your character comes back the way the last save left it, which the game writes about once a minute. That save says "down" only if it was taken while you were down.
If you remove the mod, a character that was saved while down keeps one unused text entry in its data. It does nothing and takes no room worth mentioning.
The server sets the numbers
Everything except the keys and the General switches is synced. On a server, the server's values are used and your own config file is ignored while you are connected. Values outside the allowed range are pulled back into it.
| Setting | Default | Range |
|---|---|---|
Revive.Enabled |
true | on or off |
Downed.Seconds |
30 | 5 to 120 |
Downed.FriendRadius |
60 | 5 to 200 metres |
Downed.Invulnerable |
true | on or off |
Downed.GiveUpHoldSeconds |
2 | 0.5 to 10 |
Downed.CooldownSeconds |
60 | 0 to 3600 |
Revive.Range |
3 | 1 to 5 metres |
Revive.HoldSeconds |
3 | 0.5 to 15 |
Revive.HealthPercent |
25 | 1 to 100 |
Revive.ProtectionSeconds |
3 | 0 to 15 |
Players far away are not loaded on your machine, so a friend can only count when they are within about 60 metres, even if you set the radius higher.
If you turn Downed.Invulnerable off, a downed player can be hurt. Any damage that kills them while down is the normal death.
Local settings, one per player:
| Setting | Default | What it does |
|---|---|---|
General.Enabled |
true | Master switch. Off means no patches and no RPCs. Needs a restart. |
General.DebugLogging |
false | Detailed log lines. |
Keys.GiveUpKey |
None | Hold to look into the light while down. None uses the game's Use button. |
Keys.ReviveKey |
None | Hold to revive. None uses the game's Use button. |
The config file is BepInEx/config/com.yesucs.yesubuildkit.revive.cfg.
Everyone needs the mod
The server and every player must have the same version of Revive. A server with the mod refuses players who do not have it, and a player with a different version sees which version the server runs. Revive also runs on a dedicated server. There it only does the version check and the config sync.
Monsters
A downed player is marked so that monsters do not pick them as a new target. A monster that is already chasing you keeps its target until the game makes it let go, so a fight does not end the moment you drop. You take no damage while down, so your friends have time to deal with it.
Do not combine with
Other mods that change how death, respawn, or reviving works. They change the same game code, so run one or the other.
If a game update breaks it
Revive checks its hooks into the game when it loads. If a game update broke one, nobody goes down, every death is the normal one, and the game tells you once per world, in the top left, which part is off: for example Revive could not patch the game, so reviving is off.
How it works
Your own game decides whether you are down. It holds your death back for a moment, keeps your health at 1, saves that you are down with your character, and publishes it so the other players can see it. A revive is one message from the reviver to your game, which checks that the reviver is alive, standing close, and not down before it lets you up. The only other message is the short notice that you looked into the light, which carries your name and nothing else.
If anything goes wrong while you are down, you die the normal way. If the mod is switched off while you are down, the death runs first.
