• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

tModLoader Reset Mode - Cycle worlds one after the other

hamstar

Steampunker


Note: Requires Mod Helpers and Time Limit. Made to also make use of Rewards (optional).


For having met my first patreon goal, here's a mod request I've implemented based on this idea. In a nutshell, once the mode is activated, a timer is set for the current world, causing it to auto-exit and become unplayable thereafter. Once a new world is loaded, all players that join it will be reset (all items, max life, max mana, etc. set to starting amounts). The only recourse for preserving player progress between resets is by way of accrued Progress Points (via. Rewards mod).


Source code now available. API now available (now featuring Mod.Call() bindings).


Installation

Requires tModLoader (+0.11). Copy the above .tmod file to your 'Documents/My Games/Terraria/ModLoader/Mods' folder to play.



 
Last edited:

hamstar

Steampunker
v1.2.1
  • Updated for TML11.5
  • Added ranges for some config settings
v1.2.0
  • Updated to TML11.4 and MH5b
  • Adjusted configs to use non-interface references (improves compatibility?)
  • Replaced uses of ConcurrentDictionary settings in configs with locks
v1.1.4.5
  • Added safety checks against bad local player references
v1.1.4.4
  • Updated for MH v4.2.4.1 fixes
v1.1.4.3
  • Fixed PlayerEjectProtocol
  • Added further debug outputs (e.g. player sync fails)
  • Restructured some ResetModePlayer code
v1.1.4.2
  • Added log alerts for invalid session state
  • Cleaned up some snake case stragglers
  • Changed WorldHelpers.GetUniqueIdWithSeed occurrences to GetUniqueId
  • Improved invalid state debug output
v1.1.4.1
  • Futher tweaked Mod.Call to be less persnickety
v1.1.4
  • Updated to MH v4.2
  • Changed snake case to camel case
  • Refactored away references to the current mod via parameter passing (now uses static instance)
  • Improved error reporting
  • Modified net protocols to use newer standard
  • Updated config to MH v4.2 standard
  • Fixed multiplayer reset stasis fail (sync wasnt completing?!)
  • Added better real-time debug info output

v1.1.3.5
  • Updated for MHv4
v1.1.3.3
  • Set player validation checks to eject player via. signal
  • Added session syncing to client after validation
  • Added update method FPS throttling
  • Added WorldInPlay Promise wrappers to player init stuff
  • Changed player connect code with a convention tweak
  • More fixes for net code issues (knock on wood!)
  • Refactored player sync stuff
v1.1.2
  • Update to Mod Helpers v2.0.2
  • Altered chat commands for readability
  • Added 'WrongWorldForcesHardReset' config option
  • Skimmed non-local player data from session data for syncing
v1.1.1.16
  • Minor internal cleanup
  • Triggered session data to save upon world save
  • Added yet more debug messages
v1.1.1.12
  • Reduced debug message spam output a bit
  • Added slight improvement to debug outputs (e.g. PP spendings)
  • Added periodic debug output
v1.1.1.10
  • Added a very specific failsafe on mod load
  • Corrected exit type (good vs bad) on world expire from a previously-played world vs an unplayed world
  • Synced session data with clients on world expire in MP
  • Added failsafe against saving and loading as a client
  • Added a measure to set Rewards PP refunds between resets to be performed only once
v1.1.1.7
  • Removed redundant inbox messages
  • Set player validations to persist
  • Removed some debug scaffolding
  • Improved error messages
  • Fixed incorrect world exits (plz!)
  • Added debugging aids
v1.1.1.5
  • Set console commands to work as chat commands via the new MH v1.6.6 privileged user
v1.1.1.4
  • Set existing stray reset timers to auto remove
  • Added some safety measures to session logic background Update() code
  • Added more failsafes against invalid global state (e.g. SessionLogic.IsWorldInPlay)
  • Refactored session logic layout internally
v1.1.1.3
  • Fixed an issue causing worlds to re-engage when expired
  • Restructured Mod class internally
v1.1.1.2
  • Restructured game mode loading into SessionLogic
  • Ensured players exit non-active worlds
  • Improved error reporting for world session start
  • Made game state checks more explicit
v1.1.1.1
  • Removed failsafe timer
v1.1.1
  • Deferred player validation on server until at least after world safely loaded
  • Remove net code for rewards purchases; handled with Rewards mod, now
  • Transferred world data to session data, but preserved a wrapper for migration convenience
  • Consolidated ResetModeWorldData wrapper into SessionLogic
  • Assorted refactoring
v1.1.0.6
  • Fixed (hopefully) Wing Slot compatibility
  • Fixed SP redundant timer issue
v1.1.0.5
  • Added timeout failsafe against players who haven't validated their player (failure to sync RM data)
  • Minor internal restructuring
v1.1.0.4
  • Restructured to debug error with Wing Slot mod resets
v1.1.0.3
  • Added Wing Mod compatibility
v1.1.0.2
  • Fixed console commands
  • Updated for Mod Helpers v1.6.3
v1.1.0.1
  • Migrated Hamstar Helpers to Mod Helpers
  • Migrated to C# 6
  • Fixed issue with UI loading
v1.1.0
  • Extensive restructuring and refactoring
  • Set world state to update reactively
  • Set player validation to occur reactively to world and session state
  • Fixed session saving for single player
  • Set world data to be its own discrete data class
  • Added config options for resetting Rewards spendings (refunded) and player kills
  • Fixed autostart (knock on wood)
  • Changed Rewards PP full resets into spendings refunds
  • Fixed world deletions from DeleteAllWorldsBetweenGames setting
v1.0.8.2
  • Fixed (hopefully) Rewards mod API interaction
  • Ensured client awareness of world status on join
v1.0.8
  • Added syncing for clients from server for session data
  • Changed world data file name to newer standard
  • Refactored player loading (hopefully avoids errors)
v1.0.7.2
  • Reimplemented per-session Rewards PP tracking
  • Migrated incorrect per-world PP resetting to per-session system
v1.0.6.1
  • Added reconstitution of player PP on reset (untested)
v1.0.5.1
  • Fixed multiplayer disarming fail (see HH update)
v1.0.5
  • Added OnWorldEngagedCalls to specify a set of Mod.Call() invocations to make when a world is engaged in reset mode. Ex:
    [{"MyModName":["List", "of", "params"]}, {...}]
  • Refactored session save and load to use Mod Specific Data/Reset Mode folder
v1.0.4.2
  • Minor internal refactoring
  • Updated for newer Hamstar's Helpers (v1.4.5)
  • Changed welcome message to inbox message
v1.0.4.1
  • Added config setting 'ResetAllWorldsOnLoad' - Deletes ALL worlds (use with caution!)
  • Refactored some internal code
  • Refactored net protocol layout
v1.0.3.1
  • Added 'AutoStart' config option
v1.0.2.1
  • First public release.
 

Attachments

Last edited:

ShuVi

Steampunker
I actually have a question... i started a run, which i aborted midways. planned on starting a new one, deleted the old world, created a new character, and created a new world (with start with base mod active, same as the world before). the moment i enter the world, the message "World not valid for Reset Mode. Exiting..." pops up and drops me. i had the option "AutoStartSession" on true for a little bit aswell, but deactivated it and created another world after that.

any solution to fix that?

Edit: apparently it resolved itself after some meddling around and using another character (which didnt work before oddly enough)
 

hamstar

Steampunker
I actually have a question... i started a run, which i aborted midways. planned on starting a new one, deleted the old world, created a new character, and created a new world (with start with base mod active, same as the world before). the moment i enter the world, the message "World not valid for Reset Mode. Exiting..." pops up and drops me. i had the option "AutoStartSession" on true for a little bit aswell, but deactivated it and created another world after that.

any solution to fix that?

Edit: apparently it resolved itself after some meddling around and using another character (which didnt work before oddly enough)
This mod's determined to be buggy, despite a lot of effort on my part. I think a big part of that is the player id issue I recently found an alternative to, which I'll attempt to implement. Player progress might get lost, though.
 
Last edited:
Top Bottom