You are viewing a potentially older version of this package. View all versions.
FlyingHose-Revive-1.0.0 icon

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.

Date uploaded 2 hours ago
Version 1.0.0
Download link FlyingHose-Revive-1.0.0.zip
Downloads 17
Dependency string FlyingHose-Revive-1.0.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2360 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2360

README

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.

CHANGELOG

1.0.0

  • Version 1.0.0, with the rest of YesuBuildKit.
  • Every number setting carries its allowed range, so Althing shows it and refuses a value outside it. The values the mod uses were already held inside these ranges.
  • If a game update breaks one of Revive's hooks, the game says which part is off, once per world, in the top left, and deaths stay the normal ones. The parts have plain names for that.
  • The text under the crosshair while someone is down no longer makes new garbage every frame.

0.2.0

  • Settings can now be set per world, and the host or a server admin can change them in the game with the Althing mod.
  • Giving up is now a hold, not a key press. While you are down, the text under your crosshair says "Hold [E] to look into the light", and a bar and a percent fill while you hold. Release early and it starts over.
  • The hold takes 2 seconds by default. The new synced setting Downed.GiveUpHoldSeconds changes it, from 0.5 to 10.
  • The hold uses the game's Use button by default (E on the keyboard, the use button on a gamepad). Keys.GiveUpKey now defaults to None, which means the Use button. Any other key means hold that key instead.
  • A config file that still says Keys.GiveUpKey = Delete now means hold Delete for the full time. A single press no longer does anything. Set it to None to use the Use button.
  • A key that is already down when you go down does not count. The hold only starts after you have let go once, and never in the first second of being down.
  • The hold does nothing while you are typing in the chat, the console, or a text box.
  • When the hold finishes you see "You looked into the light." and every other player sees "NAME looked into the light." at the top left. The notice is one small message, limited to one per player every 5 seconds.
  • The timer ending and the hold finishing at the same moment is still one death.
  • Logging out while down no longer gets you out of the death. The downed state is saved with the character, and you come back still down: you see "You are still down." and get the time that was left, at least 10 seconds and never more than Downed.Seconds. If nobody is near, you die right there the normal way. The once-per-life cooldown does not apply to this.
  • The record is kept per world. A record from another world, or one with a version this build does not know, is left alone. If Revive.Enabled is off or the session is not active, nothing happens and the record stays.
  • A character saved while down by a crash or a lost connection comes back as the last save was, which is down only if that save was taken while down.
  • Fixed a death that could fail on a player who had just spawned and had not been hit yet, which would have left them dead without a tombstone. It now runs the game's death with a plain hit record.

0.1.0

  • First release.
  • When you would die and another living player is within 60 metres, you go down for 30 seconds instead. You cannot move, attack, use items, or open the inventory, and you take no damage.
  • A friend within 3 metres holds the Use key for 3 seconds to get you up with 25 percent health and 3 seconds of protection.
  • If nobody revives you, the normal death happens when the timer ends: tombstone, skill loss, and respawn, exactly as without the mod. A key (Delete by default) gives up early.
  • Going down is once per life: a lethal hit within 60 seconds of a revive is a normal death. So are deaths from the edge of the world, lava, and the Ashlands sea.
  • Monsters stop picking a downed player as a new target.
  • Server-synced config and a version check on join.