Do you guys see any problems with this script?

Post » Wed May 08, 2013 11:25 pm

Hey guys,

I'm scripting a periodic update to let the player know what their bounty is in my land, since custom bounties can't be added to the menu.

Now, the reason I've come here is simply because this will be very time consuming and difficult to test, so I figured I'd ask here to see if anyone could point out any glaring issues with this right off the bat. Then it's just up to chance as we test over time and try to find issues. If nobody finds any issues then I'll assume I'm good to go and won't worry too much.

The idea here is that I have a script on a book, that opens a bunch of menus on read, allowing the player to configure a message to appear every X amount of time, either game time or real world time. Here's the script on the quest that displays this message, the book's script is pretty straight forward and easy to test so I won't be posting it:

Int Property Frequency AutoFaction Property FalskaarCrimeFaction AutoMessage Property FSBountyNotification AutoFunction UpdateDisplay(Int iType, Int iTime) ; Type 0 = never, 1 = game time, 2 = real time	UnregisterForUpdate()	UnregisterForUpdateGameTime()	FSBountyNotification.Show((FalskaarCrimeFaction.GetCrimeGold()))	Frequency = iTime	Debug.Notification("Setting variables and preparing to register")	If iType == 1		RegisterForSingleUpdateGameTime(iTime)		Debug.Notification("Registered for update game time")	ElseIf iType == 2		RegisterForSingleUpdate(iTime)		Debug.Notification("Registered for update")	EndIfEndFunctionEvent OnUpdateGameTime()	RegisterForSingleUpdateGameTime(Frequency)	If FalskaarCrimeFaction.GetCrimeGold() > 0		FSBountyNotification.Show((FalskaarCrimeFaction.GetCrimeGold()))	EndIfEndEventEvent OnUpdate()	RegisterForSingleUpdate(Frequency)	If FalskaarCrimeFaction.GetCrimeGold() > 0		FSBountyNotification.Show((FalskaarCrimeFaction.GetCrimeGold()))	EndIfEndEvent

Now, one of my concerns here is how much RegisterForUpdate() can take. Since it takes an input in seconds, and my message can be set to display every few hours, it means I input values as big as 3600, or 7200 seconds. Can the engine handle that alright? Also, does that time tick down even in a menu? Are there any problems with this? Since RegisterForUpdateGameTime() takes an input in game hours, it never has a value above about 24.

Thanks for any input! Hopefully I can make sure this works without actually having to acquire a bounty and then play for several hours. :tongue:

Thanks,

AJV

User avatar
m Gardner
 
Posts: 3510
Joined: Sun Jun 03, 2007 8:08 pm

Post » Thu May 09, 2013 1:03 pm

Script looks fine.

I don't know about the RegisterForUpdate() with a long duration. I can't imagine it causing problems.

If you're in a menu, the RegisterForUpdate/GameTime() timer pauses.

As for testing, RegisterForUpdateGameTime() can be triggered easily with SetPCSleepHours iHours. I'm not sure if it accelerates RegsterForUpdate but you could try.

Also, just a suggestion. The SkyUI MCM menu would make it easy to display bounties and any other statistics you want to track. Obviously you wouldn't want to make it a requirement, but I think it would be worth while to look into if you have the time :smile:

User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Thu May 09, 2013 8:05 am

I managed to test in-game and the GameHour side of it all works just fine. I set the timescale to a high value, like 5000 and tried various settings and they all worked. It sets up, and occurs repeatedly.

So, assuming RegisterForSingleUpdate() is okay with a value like 7200, that side should work just fine as well, as it's nearly identical in setup. So I'm going to assume this works fine.

And again, I'm only adding external things like that (Or worrying about them at all) if they can make a major contribution to the mod. The only thing I could use for MCM so far are setting bounty rewards as mentioned previous, and tracking this. I have a good system set up for bounties, and I really like what I've set up here, so that doesn't justify it to me yet. But if something major pops up I'll certainly keep it in mind. :P

User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am


Return to V - Skyrim

cron