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] Age System

Sythen

Sorceror
Hi Felladrin

If I wanted to make it so the Tag read: <AccountName is 34 years old> how would I change the following code? Also, where did you learn so much about Account Tags. I want to try to create a base system that creates any given custom tag onto the Account.xml so that when I make custom items, I can have them refer to that tag and if people don't have it then they can't use that item.

Anyway any help on my question about your system is greatly appreciated and any direction you could point me towards regarding account tags would be nice as well. Thanks :)


Code:
foreach ( Mobile pm in World.Mobiles.Values )
			{
				if ( pm is PlayerMobile )
				{
					try
					{
						if ( ((Account)pm.Account).GetTag( "Age of " + (pm.RawName) ) == null || ((Account)pm.Account).GetTag( "Age of " + (pm.RawName) ) == "")
						{
							//Ignore them. To make a check on the server and adjust the characters who have not recorded their age yet use the comand [VerifyAge
						}
						else
						{
							int age = int.Parse( ((Account)pm.Account).GetTag( "Age of " + (pm.RawName) ) );
							((Account)pm.Account).SetTag( "Age of " + (pm.RawName), (age + 1).ToString() );
							pm.SendMessage( Utility.RandomMinMax(2,600), "Congratulations! You are now {0} years old!", (age + 1) );
						}
					}
					catch
 

Felladrin

Sorceror
Hum, I learned everything to make this script observing the original scripts of runuo. If I remembered anything that do something similar to what I wanted, I looked for the script and saw how to do.
Also I have posted here on Script Support if anyone knew how to use tag accounts to do this. 1 day later I discovered how to do, so I started the script. Then, after starting, it seemed much more easier, because new ideas kept coming, and all I needed to do was to take a look on runuo scripts and make similar use. :)

I didn't understand where you want to show "AccountName is 34 years old'. And you want to show the account age or the character age?

http://www.runuo.com/forums/script-support/100932-account-tag-special-items-issues.html
 

Felladrin

Sorceror
I've just found another bug in my code: If the player types a letter instead of a number, while choosing the age, the server crashes. I'll post an update soon.
 

Felladrin

Sorceror
(Update) Version 1.1.0

- Now it checks if the Age typed is a positive number. This fix the error that was making the server crash when choosing letters instead numbers for the age.

- Now ages are changed automatically after a period of time. You can choose this period at the beginning of the script:

Rich (BB code):
private static TimeSpan AutoRenewDelay = TimeSpan.FromDays( 15 ); //How many Earth Days are equivalent to One Year for characters?
private static TimeSpan AutoRenewCheck = TimeSpan.FromMinutes( 30 ); //Check for new birthdays every 30 minutes.

If you don't want the ages to change automatically, just comment the line: new AutoRenewAgeTimer().Start();

You can get the new file version at the first post of this thread.

If you already have the Age System, you just need to get the new file and overwrite it. Then, in game, type [VerifyAge to auto-adjust everything.
 

Felladrin

Sorceror
Sythen;829208 said:
This is the BEST update yet on this incredible system. Good Work! :D

Thank you Sythen. Please let me know if the auto age changing is working properly in your shard, because I've only tested with one playermobile (my own character).
 

Felladrin

Sorceror
(Update) Version 1.2.0

- Now the attributes (Str,Dex,Int) are affected by the age. You can easily customize the settings or disable it at the first lines of the script.

Rich (BB code):
public static bool AgeStatModEnabled = true; // Character's stats (Str,Dex,Int) are affected by the age?

double maxBonus = 15;  //What is the bonus when the characters are at their best condition?
double topStrAge = 35; //At what age the characters have the best strength condition?
double topDexAge = 20; //At what age the characters have the best dexterity condition?
double topIntAge = 50; //At what age the characters have the best intelligence condition?

It's also easy to mod if you use several races on your shard. You would just need create conditions like "if (from.Race == Race.Istirial)", and set other ages.

You can get the new file version at the first post of this thread.

If you already have the Age System, you just need to get the new file and overwrite it. Then, in game, type [VerifyAge to auto-adjust everything.
 

crackergus

Wanderer
Problem with [verifyage

I've installed the Agesystem, i've tested it and it compiles good but it's a problem: when i launch [verifyage it says me that no characters have selected the age. It is impossible because i used the deed with a player account and before launching [verifyage i've launched [save .
I don't know absolutely what i can debug.
Help me!
I've already translated in italian all the script: send me the good one and i will re-translate it for the community!
Tnx a lot!
 

Felladrin

Sorceror
Hi Crackergus, after the [VerifyAge command, all the players receive a Age Change Deed, then they double-click it and choose the age. The age is not set automatically, so it may take a time for all the players record their ages. A message is sent to the players when they receive the deed, but is they may not see it, so you should broadcast a message to your players, asking them to use the deed. After some time you should see the result. Please, tell me if it is working. Thanks for the feedback!
 

crackergus

Wanderer
I think i wasn't good explaining you the problem... I used the deed with a player account and then i launched [verifyage... in consolle there were also the name of my player that had registered the age before a save! The bad thing is that the agesystem re-add a deed also in the player bag that had already chosen the age!!
Do you understand me?
Excuse me for my bad english :)
 

Felladrin

Sorceror
Hm, understood. It's strange. I've tested and retested that. Please, do the following: Get the new file version on the first post (I've just released version 1.2), and then try the [VerifyAge command. There's no need to save, the system should detect all the changes instantly. Also try setting ages manually with the [SetAge command. And tell me if it still don't work. Don't worry, we'll find a solution for this.

PS: I've just tested here on my test-shard to check it, and it worked perfectly.
 

Two Wolves

Knight
According to my calculations:
If humans in Britannia age at a normal rate, turning 21 makes you about 50 in Earth years.
Number of Earth Days per Britannian year = 73
Number of Earth Days per scale Earth year = 73/2.4, about 30

Britannia World Facts:
One hour in Britannia passes every 5 minutes on Earth.
Five years in Britannia passes every year on Earth.
Britannian days are divided into 24 Britannian hours.
Britannian years are divided into 12 Britannian months.
The release date of Ultima Online was in the Britannian year 289.
Ultima Online was released on September 25, 1997.

Intersting Consequences:
Britannian years are divided into 876 Britannian days.
Britannian months are divided into 73 Britannian days.
One Britannian year passes every 73 days on Earth.
One full day in Britannia passes every 2 hours on Earth.
The current date in Britannia (as of 2010-02-21) is the year 351.
The scale year in Britannia is 2.4 times longer then years on Earth.
If five years pass in Britannia the equivalent is 12 Earth years.
If 50 years have passed in Britannia, that scales to 120 Earth years.
Characters alive on the release date may have died of old age by now.

Time conversions,
Britannia to Earth:

Hour == 5 Minutes
Day == 2 Hours
Month == 146 hours (roughly six days)
Year == 73 Days

Earth to Britannia:
Hour == 12 Hours
Day == 12 Days
6 Days == 72 Days (roughly one month)
Month == 5 Months
Year == 5 Years
 

Felladrin

Sorceror
I agree! I've checked the Britannian Time System before doing this. But I think 73 Earth Days are too much, so I prefer to use 15, so the players can feel the difference. :)
Thanks for posting it here, I'm sure it'll be useful for people who want to mod the system.
 

jraicr

Sorceror
But this characters can be an ancient on a few month!

Im working on a roleplaying enforced server, and i was thinking about the time on my world. I think this default time is so fast for this age system. So 73 can be good.. and your players can see it more realistic. Just a personal opinion. On the past, in the Middle Ages, the average life was ..30 years old? Imagine your server in a few years [if it not leave on]

..
Felladrin was a hero of the king...but he lives on a little house on a mountain at this moment.

You see Felladrin, he is 106 years old
..

In my server i thinking about the perma death, so.. this age system can be a important factor on that.

One more time, thanks and sorry for my english..it can be a headache :rolleyes:
 

Felladrin

Sorceror
That's true! No problem, I'm glad to know this system is useful. I have no shard, so I can't really say what would be better. I intended to make one, but now that the vacations are over, I think it will have to wait till next opportunity. :p
 

Two Wolves

Knight
Consider an option to use age related tags in the title or character scroll, rather than an exact year.

My guild uses these guidelines for character age transition milestones, for example.

Child Children will become Youths in 3 - 6 months (real time), about age 12 (earth years)
Youth Youths will become Youngbloods in 2 - 4 months, age 14 - 16
Youngblood Youngbloods will become Adults in 1 - 2 months, age 15 - 18
Adult From Adulthood till Elder can run 18 - 24 months, age 33 - 40
Elder Elderly characters can easily last 18 - 48 months, age 51 - 88

Other age titles: Adolescent, Teenager, Young Adult, Middle Aged
 

Felladrin

Sorceror
Great! That's a good idea, Two Wolves! I'd prefer that than using exact age, seems much more plausible! I'll implement on next update, so the admin could choose if he prefers the exact age or the related tag to be shown. Thanks for that!
 

Lichbane

Wanderer
Two Wolves;829492 said:
According to my calculations:
If humans in Britannia age at a normal rate, turning 21 makes you about 50 in Earth years.
Number of Earth Days per Britannian year = 73
Number of Earth Days per scale Earth year = 73/2.4, about 30

Britannia World Facts:
One hour in Britannia passes every 5 minutes on Earth.
Five years in Britannia passes every year on Earth.
Britannian days are divided into 24 Britannian hours.
Britannian years are divided into 12 Britannian months.
The release date of Ultima Online was in the Britannian year 289.
Ultima Online was released on September 25, 1997.

Intersting Consequences:
Britannian years are divided into 876 Britannian days.
Britannian months are divided into 73 Britannian days.
One Britannian year passes every 73 days on Earth.
One full day in Britannia passes every 2 hours on Earth.
The current date in Britannia (as of 2010-02-21) is the year 351.
The scale year in Britannia is 2.4 times longer then years on Earth.
If five years pass in Britannia the equivalent is 12 Earth years.
If 50 years have passed in Britannia, that scales to 120 Earth years.
Characters alive on the release date may have died of old age by now.

Time conversions,
Britannia to Earth:

Hour == 5 Minutes
Day == 2 Hours
Month == 146 hours (roughly six days)
Year == 73 Days

Earth to Britannia:
Hour == 12 Hours
Day == 12 Days
6 Days == 72 Days (roughly one month)
Month == 5 Months
Year == 5 Years

How well does this work with the http://www.runuo.com/forums/custom-script-releases/80650-runuo-2-0-rc1-time-system.html scripts?
 
Top