tModLoader Time Limit - Apply game-altering effects after a set duration

hamstar

Terrarian


Note: Requires Mod Helpers


Time Limit does what it says on the tin. Worlds can now be set with time limits to have configurable events take place. For example, to run a timer for 5 minutes that exits the game on completion, type this into the chat or server console:

Code:
/timer-start 300 exit false

List of commands:
  • timer-start <seconds> <action> <repeat> - Begins the timer with the given number of seconds before the given action is executed.
  • timer-stop <action> - Stops all timers of a given action.
  • timer-pause <action> - Pauses all timers of a given action.
  • timer-resume <action> - Resumes all paused timers of a given action.
  • timer-stop-all - Aborts all currently running timers.
  • timer-pause-all - Pauses all timers.
  • timer-resume-all - Resumes all paused timers.
List of actions:
  • none - No action. Timer exists for show only.
  • exit - Exits the server/returns to menu.
  • kill - All players die.
  • hardkill - All players die as if in hardcore mode (i.e. permadeath).
  • afflict - All players receive a permanent affliction as specified in the config file's 'Afflictions' (de)buff list.
  • unafflict - All players recover from permanent afflictions in the 'Afflicitions' list.
  • (custom action name) - Same as none, unless another mod implements the named action via. API.
See the Mod Helpers Control Panel for configuration options.

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.


TimeLimit.png


 
Last edited:
v1.3.1
  • Updated for TML11.5
  • Added ranges to some config settings
v1.3.0
  • Fixed missing config Clone
v1.1.7.2
  • Fixed expired timer for serverclose lingering for repeat sessions
v1.1.7.1
  • Fixed 'unafflict' action
v1.1.7
  • Updated to Mod Helpers v2.0.2
  • Renamed chat commands for readability
  • Fixed MP player load bug failsafe
v1.1.6
  • Added debug messages for network packets
  • Added debug messages for commands and API calls
  • Added debug outputs for timer actions
  • Minor internal restructuring
v1.1.5
  • Migrated to Mod Helpers v1.6.3
  • Migrated to C# 6
  • Fixed console commands
v1.1.4
  • Dependency update; no changes
v1.1.3
  • Added 'serverclose' action
  • Fixed some API errors
  • Added timer commands for adjusting timers of a given action (with API bindings)
  • Fixed API for custom actions
  • Internal refactoring
v1.1.2
  • Revised net protocol (experimental)
  • Added API function GetTimersOf(string)
  • Minor bug fixes
v1.1.1
  • Changed commands to World (single player) or Console (multiplayer)
  • Added Mod.Call() bindings for API
  • Added SaveModSettingsChanges, RunTimesUpAction, TimerStart, TimerAllStop, TimerAllPause, and TimerAllResume API functions
v1.1.0
  • Changed old begin and end commands to 'timerstart' and 'timerallstop'
  • Added 'timerallpause' and 'timerallresume' commands
  • Added an 'unafflict' action option for the 'timerstart' command
  • Fixed multiplayer issues with commands
  • Internal refactoring
  • Tweaked timer display
v1.0.1.1
  • Fixed repeating timers multiplayer desync issue
v1.0.1
  • Fixed multiplayer
  • Fixed 'exit' command
v1.0.0.2
  • Initial release.
 

Attachments

  • TimeLimit v1.0.0.2.zip
    33.3 KB · Views: 245
  • TimeLimit v1.0.1.zip
    45.7 KB · Views: 232
  • TimeLimit v1.0.1.1.zip
    45.8 KB · Views: 202
  • TimeLimit v1.1.0.zip
    51.8 KB · Views: 201
  • TimeLimit v1.1.1.zip
    54.6 KB · Views: 206
  • TimeLimit v1.1.2.zip
    56.6 KB · Views: 182
  • TimeLimit v1.1.3.zip
    61.6 KB · Views: 222
  • TimeLimit v1.1.4.zip
    61.5 KB · Views: 189
  • TimeLimit v1.1.5.zip
    58.8 KB · Views: 186
  • TimeLimit v1.1.6.zip
    62.2 KB · Views: 183
  • TimeLimit v1.1.7.zip
    41.2 KB · Views: 183
  • TimeLimit v1.1.7.1.zip
    41.3 KB · Views: 213
  • TimeLimit v1.1.7.2.zip
    41.7 KB · Views: 190
  • TimeLimit v1.3.0.zip
    79.9 KB · Views: 152
  • TimeLimit v1.3.1.zip
    80.2 KB · Views: 176
Last edited:
I'm not sure if I'm just not doing it right, but the Blackout debuff doesn't seem to apply correctly when using the afflict timer..
For the Afflictions config option, I have "Slow""Blackout", slow works but Blackout does not.
 
Well, I tried that, and the timer said i had Blackout, but the debuff wasn't applied (again, slow worked fine.)
EDIT: tried it again, and the debuff was applied..
 
Back
Top Bottom