Jump to content

[LE] Is there a way to pause Game Time while indoors?


jucoking

Recommended Posts

Well, this script doesn't work too well, since a lot of interior cells are technically in the TamrielLocation, but since I made it, you might as well have it.

 

 

Scriptname MyScriptName extends ReferenceAlias 
{Pauses time when not in the specified locations. Written by Wilbur Cobb / smashballsx88}

Location property LTam auto
{Set this to TamrielLocation, you can also define more exterior spaces.}
;Location property nLoc2 auto
;Location property nLoc3 auto

GlobalVariable property Hr auto
{Set this to GameHour.}

bool pInter

float pTime

Event OnLocationChange(Location akOldLoc, Location akNewLoc)
	if akNewLoc == LTam			;Makes sure the player is in Tameriel. You can define more exterior locations, do (Ltam || nLoc2 || nLoc3) ... ect
		UnregisterForUpdate()	;Terminates any registered updates.
		pInter = false			;Sets a bool to track rather the player is or isnt in tameriel, false if tameriel, true if anywhere else.
		debug.trace("The player is in " + akNewLoc)
	else
		pTime = Hr.GetValue()	;Sets the hour that it curretly is, when the player inters the new location, to a float that wont change till he does it again.
		pInter = true
		RegisterForSingleUpdate(10)	;In 10 real-time seconds, it will begin the pause time cycle.
		debug.trace("The player is NOT in exterior")
	endIf
endEvent

Event OnUpdate()	;Starts the loop, and fires everytime an Update happens.
	if pInter == true
		Hr.SetValue(pTime)	;Every 10 seconds it will reset the time to the hour the player left tameriel in.
		RegisterForSingleUpdate(10)
		debug.trace("Time was reset to " + pTime + " hour(s)")
	endif
endEvent

 

 

 

Perhaps you can work with it though, this script attaches to a reference alias through a quest. Just make the specific reference a player, and add it to the Papyrus box.

 

Read more about how OnLocationChange() works here, perhaps you can find a better solution.

 

This also won't account for days, so if the player waits over a day it will just revert it to the hour. To avoid this, it's really simple, just do what I did with the Hr global, to another global assigned to GameDay.

 

Also, watch out for making the script too big, cheers.

Edited by smashballsx88
Link to comment
Share on other sites

This is ingenious. I appreciate this and will give you front page credit if I use it (including any derivatives of it). None of my interior cells are in the tamriel worldspace, as I have made my own original worldspace, so I hope that won't be a problem.

 

I will give it a shot and get back to you.

Edited by jucoking
Link to comment
Share on other sites

Good deal, what might help, is making sure all of your locations don't parent to your exterior world. I don't know if that will have any affect for the script, so do your own testing, but this might have unintended side effects, so read up on Locations and do a bit of research before you decide. Otherwise, if you can think of a good script revision, always go for that instead.

Edited by smashballsx88
Link to comment
Share on other sites

If you have to change GameDay for any reason, you'll notice that the day of week doesn't reflect the change(sundas will stay sundas for example and change to morndas when the day changes naturally as normal). The day of week is hardcoded in the engine. This mainly is harmless unless there are mods that rely on days to be 100% accurate to the vanilla calendar.

Link to comment
Share on other sites

  • 2 months later...

Good deal, what might help, is making sure all of your locations don't parent to your exterior world. I don't know if that will have any affect for the script, so do your own testing, but this might have unintended side effects, so read up on Locations and do a bit of research before you decide. Otherwise, if you can think of a good script revision, always go for that instead.

So, the weirdest thing is happening while trying to compile this script...UnregisterForUpdate() and RegisterForSIngleUpdate(10) won't compile. This is bizarre to me because it's a script line I've used a million times and haven't had any issues with it. Any idea on what gives for this script??

 

UPDATE:

My bad...while copying and pasting I accidentally took off the script header. All is well.

Edited by jucoking
Link to comment
Share on other sites

  • 1 month later...

Hi Rasikko and Smashballsx88,

 

Thanks to your help I have released my mod (a remake of Castlevania II: Simon's Quest) which can be found here:

 

 

 

 

I have thanked you both in the "Credits" section, but please let me know if you'd like me to add anything else to give you credit (such as links to mods or pages). I want everyone who contributed to know that I really appreciate the help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...