RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Time System

Morxeton

Sorceror
The next version will have the option to have evil spirits not attack murderers.

This unfortunately requires two more distro file edits (BaseAI and BaseCreature), but good news is that the SelfInstaller will take care of the edits for ya (if the method's that it modifies aren't already modded or it *might* fail, there's still a chance it may work).

It never hurts to let SelfInstaller attempt to install the necessary changes, since it always renames the distro file it edits to <filename>.cs_old and moves the modded one into a directory under scripts called ~Modded. It maintains the same directory structure, so if the file was located at Scripts/Misc/LightCycle.cs (for example), it will now be located at Scripts/~Modded/Misc/LightCycle.cs
 

Morxeton

Sorceror
New version released.

v2.0.6:

  • Added a new EMO feature, UseCantTellTime. When set to true, you can't tell the time in the EMO region via [time, clock, and can't see the moon with the spyglass. useful for setting EMO regions in dungeons. Must set system-wide setting UseCantTellTime to true to use this feature.
  • UseNonRedMageAI EMO setting has been created. When set to true, the evil spirits will NOT attack reds (murderers). However, if a player who is red decides to take a shot at an evil spirit with this option enabled, they will end up killing themselves for 100% of the damage will be reflected back onto the player.
  • SelfInstaller has been updated to make updates to two more distro files (BaseAI.cs and BaseCreature.cs). It also has been updated to disable itself after all the updates have been made to the distro files.
  • Optimized the Install() method in SelfInstaller.
  • Made the Evil Spirits a bit stronger.

Gumps are still in the works. I wanted to release this since early since I implemented the feature for evil spirits to not attack reds. This introduces a new AI, and as a result, requires BaseAI.cs and BaseCreature.cs to be updated. SelfInstaller will update these itself.

I just realized I forgot to update the manual installation instructions for the two new distro edits. I will do that later when I get a chance and update the zip file.
 

Soultaker

Sorceror
Awesome this is great

Cool new updated. adding this to the shard and checking it out now.!!
outta be great!
Thanks Again
Soultaker
 

Pyro-Tech

Knight
I have a crash for ya....right now it's fatal in that i can't restart my server from my most recent automatic backups :(

Code:
19/03-03:05 Error:
19/03-03:05 System.ArgumentOutOfRangeException: Index was out of range. Must be
non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argu
ment, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Server.TimeSystem.TimeEngine.GetFacetAdjustment(Object o) in d:\RunUO Serv
er 2.0\Scripts\Custom\New Scripts\Systems\Time System\Engines\TimeEngine.cs:line
 110
   at Server.TimeSystem.TimeEngine.GetAdjustments(Object o, Boolean useTimeZoneS
caling) in d:\RunUO Server 2.0\Scripts\Custom\New Scripts\Systems\Time System\En
gines\TimeEngine.cs:line 96
   at Server.TimeSystem.TimeEngine.CalculateLightLevel(Object o) in d:\RunUO Ser
ver 2.0\Scripts\Custom\New Scripts\Systems\Time System\Engines\TimeEngine.cs:lin
e 295
   at Server.TimeSystem.LightsEngine.CheckLights() in d:\RunUO Server 2.0\Script
s\Custom\New Scripts\Systems\Time System\Engines\LightsEngine.cs:line 53
   at Server.TimeSystem.Engine.OnSystemTick() in d:\RunUO Server 2.0\Scripts\Cus
tom\New Scripts\Systems\Time System\Engine.cs:line 130
   at Server.TimeSystem.Engine.TimeSystemTimer.OnTick() in d:\RunUO Server 2.0\S
cripts\Custom\New Scripts\Systems\Time System\Engine.cs:line 171
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)
19/03-03:05 Crash: Backing up...TransferServer version 1.05 listening on port 80
30
19/03-03:05 done
19/03-03:05 Crash: Generating report...done
19/03-03:05 Crash: Restarting...done

EDIT: Also another suggestion....for darkest hour, make a check against objects such as candle's, torches, and other Fire burning objects to "blow out" from evil winds. And as for down decoration may want to also add these into the thing so that they can be unlit during the day and light at night. Both of these would add to the ambience
 

Morxeton

Sorceror
Pyro-Tech;665143 said:
I have a crash for ya....right now it's fatal in that i can't restart my server from my most recent automatic backups :(

Code:
19/03-03:05 Error:
19/03-03:05 System.ArgumentOutOfRangeException: Index was out of range. Must be
non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argu
ment, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Server.TimeSystem.TimeEngine.GetFacetAdjustment(Object o) in d:\RunUO Serv
er 2.0\Scripts\Custom\New Scripts\Systems\Time System\Engines\TimeEngine.cs:line
 110
   at Server.TimeSystem.TimeEngine.GetAdjustments(Object o, Boolean useTimeZoneS
caling) in d:\RunUO Server 2.0\Scripts\Custom\New Scripts\Systems\Time System\En
gines\TimeEngine.cs:line 96
   at Server.TimeSystem.TimeEngine.CalculateLightLevel(Object o) in d:\RunUO Ser
ver 2.0\Scripts\Custom\New Scripts\Systems\Time System\Engines\TimeEngine.cs:lin
e 295
   at Server.TimeSystem.LightsEngine.CheckLights() in d:\RunUO Server 2.0\Script
s\Custom\New Scripts\Systems\Time System\Engines\LightsEngine.cs:line 53
   at Server.TimeSystem.Engine.OnSystemTick() in d:\RunUO Server 2.0\Scripts\Cus
tom\New Scripts\Systems\Time System\Engine.cs:line 130
   at Server.TimeSystem.Engine.TimeSystemTimer.OnTick() in d:\RunUO Server 2.0\S
cripts\Custom\New Scripts\Systems\Time System\Engine.cs:line 171
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)
19/03-03:05 Crash: Backing up...TransferServer version 1.05 listening on port 80
30
19/03-03:05 done
19/03-03:05 Crash: Generating report...done
19/03-03:05 Crash: Restarting...done

That looks like v2.0.3 of the time system. The line numbers were not matching up to anything after v2.0.3.

I did some digging and it looks like somehow the FacetArray is messed up. Do you recall making changes in Config.cs for the FacetArray?

To fix this for now, edit TimeEngine.cs and find this line in the GetFacetAdjustment(object o) method:
Code:
if (index > -1)

Change it to:
Code:
if (index > -1 && index < Data.FacetArray.Count)

I will fix this for future versions as a check measure, however, this should have never been an issue since the FacetArray should never be modified outside of it's default size.:eek:

Pyro-Tech;665143 said:
EDIT: Also another suggestion....for darkest hour, make a check against objects such as candle's, torches, and other Fire burning objects to "blow out" from evil winds. And as for down decoration may want to also add these into the thing so that they can be unlit during the day and light at night. Both of these would add to the ambience
This can be done now by adding more baselight types to this list in Data.cs:

Code:
        public static readonly Type[] ItemLightTypes = // BaseLight item types that will be toggled on/off for day/night.
        {
            typeof(LampPost1), typeof(LampPost2), typeof(LampPost3),
            typeof(TSLampPost1), typeof(TSLampPost2), typeof(TSLampPost3)
        };

I may create a separate list for lights that are to be affected by Darkest Hour only... and I may also make the lists configurable in-game.

Hmm, and now I'm also thinking of adding an EMO setting called something like UseDarkestHourNoLighting which would prevent you from using a lightsource completely during Darkest Hour, of course this requires creating new scripts that inherit TSBaseLight and converting all existing torches, candles, etc.

Thanks for the bug report and suggestions.:)
 

Pyro-Tech

Knight
yes...it is 2.0.3....i haven't had a chance to mess with upgrading to the others yet but no, i haven't edited anything with the scripts themselves.

and thanks for the hot fix....ill try it out right now

EDIT" seems to have worked...thanks again.
 

Pyro-Tech

Knight
Ok came accross this with one of my players....still looking into it but....

It seems that dark hour and what not isn't working properly for some....i have a player w/o any nightsight attribute's on, and he never see's darkest hour effect. Anything i can look into to see if i may have things improperly set up?

along with this, i have another suggestion....it is a personal problem with me and may not be for others, and may be easier once gumps are implemented, but for setting darkest hour, instead of "minutes after night" use darkest hour start and instead of length, use darkest hour end....like you do for day night start times.

Also, i had asked about the timer's earlier in the thread and never got to finish asking....i dunno what the default UO day is, nor how often the timer need's to check, but if i wanted the day's to be 6 realtime hours long, what do i need to set the timer variable to?

thanks for any help/information you can provide
 

Malaperth

Wanderer
Pyro-Tech;665732 said:
Ok came accross this with one of my players....still looking into it but....

It seems that dark hour and what not isn't working properly for some....i have a player w/o any nightsight attribute's on, and he never see's darkest hour effect. Anything i can look into to see if i may have things improperly set up?

Razor and many other tools/scripts can adjust the lightlevel in UO and nothing can be done about it at this point.
 

Morxeton

Sorceror
Pyro-Tech;665732 said:
Ok came accross this with one of my players....still looking into it but....

It seems that dark hour and what not isn't working properly for some....i have a player w/o any nightsight attribute's on, and he never see's darkest hour effect. Anything i can look into to see if i may have things improperly set up?
It is possible, as Malaperth mentioned, that they are running Razor or another 3rd party utility that is filtering out the lightlevel packet that is sent from the server, thus allowing them to always see daytime levels regardless. Unfortunately that defeats a huge purpose of the time system (light level management and effects)...

Pyro-Tech;665732 said:
along with this, i have another suggestion....it is a personal problem with me and may not be for others, and may be easier once gumps are implemented, but for setting darkest hour, instead of "minutes after night" use darkest hour start and instead of length, use darkest hour end....like you do for day night start times.
I did it this way since it would require two variables (how many minutes past night to start, and how long to last) instead of four (start minute, start hour, end minute, end hour).

Pyro-Tech;665732 said:
Also, i had asked about the timer's earlier in the thread and never got to finish asking....i dunno what the default UO day is, nor how often the timer need's to check, but if i wanted the day's to be 6 realtime hours long, what do i need to set the timer variable to?

thanks for any help/information you can provide
UO's default is 5 real seconds is 1 UO minute, which means 120 minutes makes up a full UO day. If you would like your days to be 6 hours long, increase the timerspeed to 15 seconds.

The formula to use would be:
<minutes long for UO day> / (<MinutesPerHour / MinutesPerTick>) = TimerSpeed.

For example, MinutesPerHour = 24, MinutesPerTick = 1. You would like the day to last 4 hours (240 minutes), the formula would be:

240 / (24/1) = 10
 

Morxeton

Sorceror
Almost forgot, I will not be implementing gumps into the system.

I decided to go with a socket/windows form method instead. You will use a windows form application to connect into the server to administer the time system.

It is far easier to implement forms than trying to lay out gumps, and gives you the ability to make changes to the system without having to be logged into the server through the UO client at all.:eek:
 

Pyro-Tech

Knight
Morxeton;665751 said:
Almost forgot, I will not be implementing gumps into the system.

ok....at this point im at OMFG WTF?!?! :mad:
Morxeton;665751 said:
I decided to go with a socket/windows form method instead. You will use a windows form application to connect into the server to administer the time system.

It is far easier to implement forms than trying to lay out gumps, and gives you the ability to make changes to the system without having to be logged into the server through the UO client at all.:eek:

and then had a laugh at myself.

it does make more sense on your part and alot easier i think. So that's actually pretty cool idea then :D

hehe, and thanks for the scare. and the info on the timer clicks :)

as for the lightlevel thing....i haven't been able to figure it out...but he had said he wasn't using razor so....*shrug*

EDIT: also i keep getting this at the beginning....and it doesn't seem to save anything i enter.
22/03-01:40 Time System: "Time System.dat" is corrupt! Creating a new file usin
g the current settings.
 

Morxeton

Sorceror
Haha, didn't mean to scare ya:eek:

Code:
22/03-01:40 Time System: "Time System.dat" is corrupt! Creating a new file usin
g the current settings.
This is a bug in v2.0.3, which was fixed in v2.0.4:

  • Fixed a bug in the Load() method in Data.cs that was incorrectly checking the version and would result in a failed load attempt everytime.

You may want to upgrade :)
 

Pyro-Tech

Knight
oops...didn't catch that :eek: was trying to wait till the gump/form thing but...guess that means upgrade time :D

thanks for the help then:)
 

Cheetah2003

Wanderer
Having another difficult problem with Time System. Still using version 2.0.5.

First, I've not added or removed any EMO's, just using the default ones. Have some changes to effect on nightsight.

Anyway, sometimes, when the world saves, I get a "Time System.dat" that's 1012 bytes. This is what seems to be correct, for when I reload a world that has that size "Time System.dat", the game time is accurate in relation to what it was before.

But other times, I get a "Time System.dat" that is 1666 bytes, and when I load a world that has this size file, the Time System says my save file is corrupt and resets itself.

No idea what is causing it, but it's rather annoying.
 

Morxeton

Sorceror
Very strange. If you could do me a favor and send me both the normal and the "1666" size one in a PM and I'll take a look.
 

Cheetah2003

Wanderer
Morxeton;667351 said:
Very strange. If you could do me a favor and send me both the normal and the "1666" size one in a PM and I'll take a look.
I didn't see a way to attach files to a PM so I'm putting the files here. The second one is actually 1705 bytes, it just says 1.66kb in Explorer.
 

Attachments

  • datafiles.rar
    1.8 KB · Views: 42

Morxeton

Sorceror
I just did a quick test and the latest version of the time system read both of those files correctly. Very strange. I'm going to test it on v2.0.5.
 

Cheetah2003

Wanderer
Morxeton;667373 said:
I just did a quick test and the latest version of the time system read both of those files correctly. Very strange. I'm going to test it on v2.0.5.

Check the ingame date too. The smaller file sets it to around Sept. 100, while the larger one resets it back to Jan 1st 100
 
Top