
Mods / Local Respawn
Author: DoodleGarbage
Side: Server
Created: Sep 8th 2024 at 11:02 PM
Last modified: Apr 19th at 8:27 PM
Downloads: 2638
Follow Unfollow 51
Latest release (for outdated Vintage Story v1.20.x):
localrespawn_1.2.3.zip
1-click install
Many people hate dying in this game. You explore far, locate that precious bauxite you need for a steel and then- you die. You now must travel 10,000 blocks, just because the bauxite was far away.
No more! With this mod, this distance you need to travel will be consistent. No matter where you are in the world, it'll take the same amount of time to travel back to your body, and you can decide how hard you want that to be.
Temporal Gears will no longer cause you to respawn at the location you use them when you use one to set your spawn point. However, if you set your spawn point using a Temporal Gear, the Base Return Teleporter will return to that point. Additionally, if you die near your temporal gear spawn point, you'll spawn at that spawn point.
- Rage Quitting and not respawning before the server restarts (or when you exit the world in single player) can delete your spawn point set with a temporal gear.
Warning: This is my first mod, the code is messy. While it is very simple and touches very few parts of the game, there's certainly bound to be edge cases, bugs, or unintended behavior. Be cautious when using this mod.
Configuration
This mod is easily configured: Just set your world's Spawn Radius, and the mod will use that value (provided a restart, if changed mid game)
May or may not be implemented:
- Add an alternative spawn selection. Instead of picking a random block within the spawn radius, pick one at the edge of the spawn radius, for even more consistent respawning.
- Proper configuration file settings. Haven't figured this out yet.
Version | For Game version | Downloads | Release date | Changelog | Download | 1-click mod install* |
---|---|---|---|---|---|---|
v1.2.3 | 511 | Apr 19th at 8:27 PM | Show | localrespawn_1.2.3.zip | 1-click install | |
v1.2.2 | 151 | Apr 16th at 5:12 PM | Show | localrespawn_1.2.2.zip | 1-click install | |
v1.1.0 | 683 | Jan 29th at 11:22 PM | Show | localrespawn_1.1.0.zip | 1-click install | |
v1.0.7 | 628 | Sep 20th 2024 at 5:33 AM | Show | localrespawns_1.0.7.zip | 1-click install | |
v1.0.6 | 101 | Sep 19th 2024 at 11:55 PM | Show | localrespawns_1.0.6.zip | 1-click install | |
v1.0.5 | 77 | Sep 19th 2024 at 9:54 PM | Show | LocalRespawns_v1.0.5.zip | 1-click install | |
v1.0.4 | 139 | Sep 15th 2024 at 3:04 AM | Show | LocalRespawns_v1.0.4.zip | 1-click install | |
v1.0.2 | 127 | Sep 11th 2024 at 12:18 AM | Show | LocalRespawns_v1.0.2.zip | 1-click install | |
v1.0.1 | 129 | Sep 9th 2024 at 12:04 AM | Show | LocalRespawns_v1.0.1.zip | 1-click install | |
v1.0.0 | 92 | Sep 8th 2024 at 11:23 PM | Show | LocalRespawns_v1.0.0.zip | 1-click install |
Some of my friends are still reporting the spawn-in-the-ground bug. Anything useful I could try to collect as far as debug goes? I haven't personally experienced it, but I'm also allergic to death.
Update: Cleaned up some errenous code I left in. After respawning a hundred times with and without mods, I spawned above ground ~99% of the time. Sometimes spawned halfway in a block, especially if respawning in water. But otherwise, was not stuck.
Awesome DoodleGarbage
Update Update: It looks like I got something slapped together that fixes the spawn-in-ground bug! Enoy!
Update: Still have no clue how to prevent spawning inside rock.
I implemented a teleport that triggers on player respawn to put you on the surface, but it does not prevent spawning underground.
I have however confirmed the issue: My code to spawn the player cannot find the surface block (likely due to nothing being there), and thus spawns you at the same y-level you were previously at as a fall back.
I will continue to work to figure out if I can determine a fix.
florins You're probably right with that guess. There's another bug report about the game bricking when spawning in an bugged unloaded chunk, which suggests that world gen coould be a factor.
Doesn't 100% confirm it, I wouldn't know why you'd not spawn at the bottom of the world (should check if it's spawning at the same y as where you died?)
The code to set your respawn point runs when the "on death" event triggers, so the world won't generate before it gets set. The code uses the World.BlockAccessor.GetBlock function, which I do not know how it interacts with unloaded chunks nor do I know if there's any alternative function that will work.
Maybe I can instead write some code that will teleport you to the surface "on revive" - this might do the trick.
The bug might be because player spawns before the world tile is generated?
I notice if I set 500 spawn radius, I can spawn right at the edge of the currently generated map, and my computer takes another 2 seconds to generate the world right in front of me.
Maybe at 5000 spawn radius we spawn so far away from last location that the world hasn't generated yet but your code to land on the ground runs too early?
DoodleGarbage
DoodleGarbage I've "fixed" it by setting a 250 spawn radius. Haven't spawned in the ground yet with that setting.
florins I can confirm that spawning in the ground does happen. To be honest, I have no clue why. The current code should detect the top most block and thusly spawn you there, but it doesn't always seem to do this. Not really sure what the issue with the code is.
I'm spawning in the ground or the ocean quite often.
Settings: Wilderness Survival (meaning 5000 spawn radius) and I'm using 60% land cover (so 40% oceans)
Hey everyone! I have returned from the graveyard of ghosts. I've pushed a new release that should fix the spawning in ground bug, along with updated the github repository with the up-to-date source code.
If you still spawn in the ground, let me know. The code should start at y=3000 and then fall down until it finds a non-air block, where it spawns you 1 block above.
this is for 1.19.8
for anyone having probelms with dying and being spawned inside of a rock, a easy way to reduce the issue is to run the comand
"/worldconfig spawnradius 10".
this wont remove the problem, but it will reduce it.
suggestions for dev:
here are two ideas I have for removing the problem.
the best thing i can think to do is to do a combination of the both of these. by checking the players last grass interaction location with the function loop to find the spawn location that doesnt have blocks inside of it or has air blocks.
i always spawn in a rock and have to use admin kill 9/10 spawn until i final land above ground
This is how I thought the respawn distance worked when I first played. Really glad to see this mod existing.
Phoenicius
Yes, that is correct.
WickedSchnitzel
Good point. I'll implement that the next time I work on this mod.
Thanks for letting me know. Also, just to make sure I'm understanding correctly, the spawnRadius value in serverconfig.json controls how far away you'll respawn from your death point? So if I set it to 100, then if I die, I should respawn within a 100 block radius of where I died?
DoodleGarbage
So if the spawn radius is 0 (like on servers people are spawning at the same place, near the info boards etc), we cannot use that mod, right? This should have it's own spawn radius.
Phoenicius
Sorry for the shoddy work, but I've released a new version that actually implements compatability with higher world heights, fixed a nasty bug the old fix introduced, and as a bonus added a new feature.
And so my knowledge expands. The bugs in this code are just 💀
Oh no the "world height compatability" change now means you respawn on the same y as you died
fixing immediately
Awesome! Downloading now.
Phoenicius
Wait no longer! I've offload internal work to game code and now spawning should both work worlds of any height and no longer throw you inside (or very high above) the ground!
Following your mod in the hopes that you'll eventuallly be able to make it work with world heights bigger than 256
Robik
Thanks for letting me know. Also ran into this on my end, looks like I made a mistake when publishing the version. It should be fixed now, thank you for the help!
Does not seem to work. I died several thousands blocks from my spawn and I still respawned very near my spawn point where my base also is. Happened twice, so I don't think it was unlucky coincidence.
Hexis
Hey, I've released an update that makes the use of Base Return Teleporters possible. Thanks for bringing this issue to my attention!
Hexis
Thanks for pointing that out. I'll have to think about how to account for that (and other items, modded or otherwise, that use your respawn point). I do have an idea of how I could get that to work.
What a clever idea!
quick edit to add, though, what about the use of base return teleporters? if your base is at spawn, and the biome youre in is many MANY thousands of blocks away... you have to walk back home if you cant set a temporal gear spawnpoint.