tModLoader

tModLoader

289 ratings
Persistent Player Position
   
Award
Favorite
Favorited
Unfavorite
Mod Side: Both
tModLoader Version: 1.4.4
Language: English
File Size
Posted
Updated
107.012 KB
15 Sep, 2024 @ 9:37pm
21 Jul @ 3:29pm
8 Change Notes ( view )

Subscribe to download
Persistent Player Position

Description
Persistent Player Position (PPP :p) is a mod that saves the player's position when they leave a world, allowing you to resume your game where you left off after taking a break.

The mod functions off of a per-player per-world basis, allowing every character you have to have their own positions in a single world.

I am aware of another mod that functions similarly (named Save Your Position), which saves the player's position and loads it upon entering a world. However, that mod has a few, albeit minor, issues that this one does not.

The first issue is that, upon loading up a world, the minimap/map would show the player temporarily being at their spawnpoint until Save Your Position moves them to their last saved position.

The second issue is that Save Your Position does not account for whether or not the player is dead when saving their position, allowing the player to die, exit the world before respawning, and rejoin where they died. This, alone, would not be much of an issue as dropped items are not persistent, so you would lose all the items you dropped upon death. However, there are mods that make dropped items persistent, which means you could easily reclaim all your lost items by simply exiting and rejoining, negating the penalty of death outside of a boss fight.

The third issue is not much of an issue, but can be rather limiting. Save Your Position only uses the world's seed to identify which saved player position it should use when moving the player to their last saved position. This means that if you used two worlds with the same seed, your location would persist across both of them, not just one. PPP uses both the word seed and name, allowing for more flexibility while still retaining the ability to have your position apply to multiple worlds at once ('cause it is kinda cool). An alternative to using the world seed and world name would be to assign a UUID (universally unique identifier) to each world instead, however that would be too much work for such a negligible amount of gain.
Edit: Nvm I added the option to use UUIDs anyway. Didn't know worlds had a UUID field, but they do, so there you go. You can enable it in the mod's config.

The fourth (and final) issue is that Save Your Position does not provide compatibility with the Subworlds Library. This mod (as of Sep 20, 2024) does, returning you to your position in the main world when exiting a subworld. This behavior can be disabled in the config if you so desire.

Oh, there's also an older position saving mod called "Player Location Saving", however this mod is outdated and uses vanilla Terraria's Teleport function, which makes particles and plays a sound, ruining any chance of having a seamless transition to where you left off.

Hope you enjoy :)
Originally posted by tModLoader PersistentPlayerPosition:
Developed By alfuwu
Popular Discussions View All (1)
8
16 Oct, 2024 @ 12:11pm
Latest update broke potions of return.
Unga-Boonga
85 Comments
PBalint817 22 Jul @ 4:37am 
Thank you as well for the quick update as well! (you left a console log in the getter btw)
ALFRED  [author] 21 Jul @ 3:31pm 
Thank you! I pushed an update that fixes all the issues, including the one which caused players to spawn in the upper left corner of the map.
PBalint817 21 Jul @ 3:10pm 
The upper left issue wasn't really a big problem, since I could just recall once and it wouldn't happen again, so I just ignored that one.
The issue I fixed was the mod not working with UUID. This arose because I joined a world with the UUID setting off first before enabling it.
The conditional was structured such that it checked for the presence of the seed+name saved position first, before it ever checked whether the UUID setting was enabled, which of course resulted in it putting me at spawn (the last location that was saved with seed+name method).
This exposed another issue in UpdateData, which indexed "Main.ActiveWorldFileData" instead of "Main.ActiveWorldFileData.UniqueId", which meant that when trying to get the player position, the position based on UUID would never be found.

Hope I was detailed enough, didn't want to start dropping code in here.
ALFRED  [author] 21 Jul @ 2:08pm 
Nevermind, I just found it myself. The issue seems to occur for characters/worlds created while the mod is not enabled. Gonna start making a fix for it.
ALFRED  [author] 21 Jul @ 2:03pm 
@PBalint817 I haven't been able to replicate the issue with spawning in the upper left corner of the map. Could you tell me what you changed that fixed the bug? For me the mod still works as intended.
PBalint817 20 Jul @ 6:38am 
Decompiled the mod and fixed it myself 👍 along with a few other hiccups that poked my eye
PBalint817 20 Jul @ 6:27am 
For me this mod doesn't work if UUID mode is enabled. Excluding the initial "tp to top left" which can be solved by the first recall, after that, I always re-join at my spawn, and not my previous location. Not expecting this to be read tho considering the mod hasn't been touched in a year
meow 6 Jul @ 1:29am 
claims to be superior to other mods with better compatibility but can't even work with my incredibly lean vanilla++ modlist... also the thumbnail looks like a condom
Angel_Enriq 10 Jun @ 1:36pm 
tiene un bug donde por algun motivo apareces en la equina superior izquierda del mapa, y te mata el peligro del mar
ERKEK2000 19 May @ 9:21am 
the thumbnail looks like a condom