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

Felladrin

Sorceror
[RunUO 2.0] Age System

Introduction:

Here is another release made thinking of role-playing. It makes every character of shard to have an age and get older. The age currently does not affect the character. But it can be a base for role-playing. Also this could be an way to introduce perma-death and family trees on the shard. Well, there may be many uses for it, but it only depends on you.

Features:

# Drag & Drop
# Automatic age changing
# Attributes affected by age (NEW!)
# Display age in the name
# Population statistics
# Easy customization
# Clean Reset/Uninstall

Installation:

Drop AgeSystem.cs anywhere on your Scripts folder.
Login with administrator account and type [VerifyAge.
Doing this, every character will receive and Age Change Deed.
Use that to select your starting age, and tell the players to do the same.

Commands:

Administrator's commands:

NewAge - Makes all characters become one year older.

SetAge - Sets the age of a character to the specified value.

VerifyAge - Checks the age of all characters, sends a warning and a Age Change Dee to those who have not recorded their age, and shows statistics on the population's age.

ClearAgeSystem - Removes all tags and items of the Age System from your shard. After that you can re-enable the system or delete the script from RunUO folder and restart the server.

Player's command:

Age - Say your age to everyone around and toggles the age being shown in name. Also place an Age Change Deed in your backpack, if you don't have the age recorded yet.


Not showing age.


Showing the age in name.

Items:

There are two items in this package (which functions can be easily changed on script):



Age Change Deed: Allows the player to record their age. They must choose between a minimum and maximum value. (Default is Min: 18 Max: 40). It can't be moved, so the players can't give/sell it to others.



Rejuvenation Potion: Makes the character younger. The effect is variable. (Default: reduces from 1 to 5 years). May be given on quests, or you can place it on vendors.

Planned Features:

# Growth of hair and beard over the time.
# Detailed statistics with gumps.

Tested and Untested:

This system was tested with RunUO 2.0 RC2, RunUO 2.0 Final, RunUO 2.0 SVN 500, RunUO 2.0 with Mondain's Legacy.

I need feedback to know if it's running fine on RunUO 2.0 RC1 and on shards with more than 500 characters.

Remember, always backup your shard before testing new scripts or use a clean copy of RunUO for tests.

Patchlog:

Click on a version to see details.

Version 1.2.0 (February 21, 2010) [Current Version]
Version 1.1.0 (February 19, 2010)
Version 1.0.2 (February 15, 2010)
Version 1.0.1 (February 13, 2010)
Version 1.0.0 (February 09, 2010) [First Version]

Some Notes:

The system was fully developed in Brazilian Portuguese. I spent several days working on it, and now I consider it ready. I've translated it to English before releasing here. If you find any bugs or words written wrong, please let me know. Ideas and suggestions are always welcome!

I hope you enjoy it!

Felladrin.
 

Attachments

  • AgeSystem.cs
    17.8 KB · Views: 277
  • agechangedeed.png
    agechangedeed.png
    23.5 KB · Views: 789
  • fellawithage.png
    fellawithage.png
    22.4 KB · Views: 794
  • fellawithoutage.png
    fellawithoutage.png
    16.2 KB · Views: 781
  • rejuvenationpotion.png
    rejuvenationpotion.png
    39 KB · Views: 790

Felladrin

Sorceror
(Optional) Integration with Look Command

It's possible to integrate the Age System with Look Command (Released here: http://www.runuo.com/forums/custom-script-releases/100753-runuo-2-0-look-command.html [This one doesn't have integration with Age System]).

The Look Command for Age System is attached to this post.

Here goes the examples:


Age being shown under your description.


Age being shown under description of a targeted character.


(Optional) Showing the age under the name



If you want the age to be permanently shown under the character's name, you should add a piece of code to PlayerMobile.cs.

Find the line: public override void GetProperties( ObjectPropertyList list )

Then add the following code right AFTER the "base.GetProperties( list );" line:

PHP:
if ( ((Account)this.Account).GetTag("Age of " + (this.RawName)) != null )
	list.Add( "{0} Years Old", ((Account)this.Account).GetTag("Age of " + (this.RawName)) );
 

Attachments

  • LookCommandForAgeSystem.cs
    2.5 KB · Views: 82
  • ageundername.png
    ageundername.png
    25 KB · Views: 778
  • lookcommandforagesystem1.png
    lookcommandforagesystem1.png
    91.4 KB · Views: 786
  • lookcommandforagesystem2.png
    lookcommandforagesystem2.png
    40.4 KB · Views: 785

Sythen

Sorceror
Just A Few Friendly Suggestions! Awesome Work!!!

#1... Age changing automatically according to a period of time.
#2... Attributes affected according to the age.
#3... Detailed statistics with gumps.

#1... You might consider having where OnDoubleClick > Please Enter Your Date Of Birth... Then have a timer system set to have the number change 1 up every time the date entered comes around again.
example: I enter: MM/DD/YYYY (so every time that date comes around your age increases).

#2... You could make this a birthday gift giving system as well with a random selection of x number of gifts to choose from. Joke gifts are always fun like a fake id that changes name, age, and body value from male to female/male to male/female to female (at random with different hues on skin color and hair styles etc). lol This would definately be cool - look into the disguise kit for this code I would think.

#3... Detailed statistics with gumps... the only suggestion here would be to not only display the age over the players head, but also have it appear in the players paperdoll in the title section. In all fairness though I think a context menu addition to the player context menu should have a toggle for this to be on and off at the players discretion. This would allow staff to see ages but not other players. :D
 

LordHogFred

Knight
I've always thought that characters should get some bonuses with age. So young chars would be more atheletic maybe bonus to dex, adults would be at peak fitness so bonus strength and then old characters would have life experience so they should get bonus int.

I had a thought that with an age system you could loose skills as you got older and need to retrain them, but then when you get too old you'd die and have to make a new character that was your old characters heir. They'd inherit the skills (maybe 80%) of the old character. Would stop servers being overrun with high end chars all the time.
 

Felladrin

Sorceror
Thank you for your comments and suggestions! I forgot to write up there that ideas and suggestions are always welcome! Also i really needed some ideas to make what I planned.

LordHogFred;828049 said:
Awesome idea, you should look into the XML Spawner see if using attachments for age handling would help :).

I'd like to be able to do make all my systems using XML! But I didn't have a chance to study it yet. I'll take a look at that, thanks for your suggestion!

Sythen;828052 said:
#1... You might consider having where OnDoubleClick > Please Enter Your Date Of Birth... Then have a timer system set to have the number change 1 up every time the date entered comes around again.
example: I enter: MM/DD/YYYY (so every time that date comes around your age increases).

#2... You could make this a birthday gift giving system as well with a random selection of x number of gifts to choose from. Joke gifts are always fun like a fake id that changes name, age, and body value from male to female/male to male/female to female (at random with different hues on skin color and hair styles etc). lol This would definately be cool - look into the disguise kit for this code I would think.

#3... Detailed statistics with gumps... the only suggestion here would be to not only display the age over the players head, but also have it appear in the players paperdoll in the title section. In all fairness though I think a context menu addition to the player context menu should have a toggle for this to be on and off at the players discretion. This would allow staff to see ages but not other players. :D

For the Age changing automatically I first thought using (and I'd like to) the Time System, previously released here on forums (don't remember the creator). It would be awesome, as your Idea would fit perfectly. Without the time system, I have no Idea how to make the system detect the same date.

Good idea about the birthday gifts hahahah!

The 'Attributes affected according to the age' would be seen as bad think for getting older. And old character would be less dexterous/stronger than a character in the best age.

Good idea about the age be aways visible for staff members. The admin already can do that, but he need to see the account tags via [admin command. Change titles according to age is also a great idea, but it would need to change the distro, unfortunately.

By the way, the age, while being shown in name, appears on paperdoll too, if you want another format, just change the string line in the script :D

LordHogFred;828214 said:
I've always thought that characters should get some bonuses with age. So young chars would be more atheletic maybe bonus to dex, adults would be at peak fitness so bonus strength and then old characters would have life experience so they should get bonus int.

I had a thought that with an age system you could loose skills as you got older and need to retrain them, but then when you get too old you'd die and have to make a new character that was your old characters heir. They'd inherit the skills (maybe 80%) of the old character. Would stop servers being overrun with high end chars all the time.

That's the idea! New ways to character's life!
 

LordHogFred

Knight
I'd like to be able to do make all my systems using XML! But I didn't have a chance to study it yet. I'll take a look at that, thanks for your suggestion!

If you need a hand using the XML Attachments I've done quite a lot of work with them so far so I'd be more than happy to help if need be :).
 

oiii88

Sorceror
LordHogFred;828214 said:
I've always thought that characters should get some bonuses with age. So young chars would be more atheletic maybe bonus to dex, adults would be at peak fitness so bonus strength and then old characters would have life experience so they should get bonus int.

I had a thought that with an age system you could loose skills as you got older and need to retrain them, but then when you get too old you'd die and have to make a new character that was your old characters heir. They'd inherit the skills (maybe 80%) of the old character. Would stop servers being overrun with high end chars all the time.

I truly love this idea. I have thought the same thing for sometime. I have been slowly working on a server that evolves with time. And had been contemplating ways to allow established players to not be over ran completely by new players. Skill based on age might be one way. Its slow go for me on developing but passes the time. I always thought animals should have an age as well . And their strengths should be based off this.

And to the original poster TY again. This system has breathed a bit of new life into my desire to finish my little shard.
 
Quess this is no good for RC2 ... all commands crash it... but good job ... I know someone will have use for this... thanks for posting it.
 

Felladrin

Sorceror
Hello purplemouse91, thanks for your feedback. But it's strange. After reading your post I got both RunUO 2.0 RC2 and RunUO 2.0 Final, and tested the Age System. It worked perfectly in both. Maybe because they were clean copies... (Note: I ran then using Mono, through Ubuntu 9.10)

Could you try again, using a clean copy of RC2, and tell me the result?
 

Sythen

Sorceror
No problems here either and I'm running a heavily modded Callandor2k ML SVN [RunUO 2.0]

BTW: Awesome System! ;)
 
Felladrin;828366 said:
Hello purplemouse91, thanks for your feedback. But it's strange. After reading your post I got both RunUO 2.0 RC2 and RunUO 2.0 Final, and tested the Age System. It worked perfectly in both. Maybe because they were clean copies... (Note: I ran then using Mono, through Ubuntu 9.10)

Could you try again, using a clean copy of RC2, and tell me the result?




this is crash report


RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 6.0.6002 Service Pack 2
.NET Framework: 2.0.50727.4200
Time: 2/12/2010 6:35:09 PM
Mobiles: 47671
Items: 474938
Clients:
- Count: 1


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Commands.VerifyAge.VerifyAge_OnCommand(CommandEventArgs e)
at Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Engines.PartySystem.Chat3Guild.UnicodeSpeechChat3(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

Felladrin

Sorceror
(Update) Version 1.0.1

- Characters without backpack won't make the server crash anymore. Their names will be marked in the console when you type [VerifyAge. Also they will receive a warning telling to look for a staff member urgently. The same will happen if they type [Age and don't have backpack.

- Now the Age Change Deed can only be used if it's on backpack.
 
Still Crashing


Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 6.0.6002 Service Pack 2
.NET Framework: 2.0.50727.4200
Time: 2/13/2010 4:04:44 PM
Mobiles: 47682
Items: 474993
Clients:
- Count: 1
+ 192.: (account = ) (mobile = 0x12BD '')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Commands.VerifyAge.VerifyAge_OnCommand(CommandEventArgs e)
at Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Engines.PartySystem.Chat3Guild.UnicodeSpeechChat3(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

Felladrin

Sorceror
Hum... Please, purplemouse91, try the following:

Move, temporally, the Save folder from RunUO folder to another folder. Start the server (it will ask a new admin account). Login and try the [VerifyAccount. (After the test you place the Save folder back).

So we'll know if the error is with the Saved game or if it's some script conflict.
 

jraicr

Sorceror
server crash Verify age

Thanks for share it, its a nice idea for roleplaying.

Im checking this script, when i run [verifyage the server crash. Im running RunUO RC 2.


Server Crash Report

Code:
===================

RunUO Version 2.0, Build 3567.2838
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 3
.NET Framework: 2.0.50727.3603
Time: 15/02/2010 16:48:01
Mobiles: 40
Items: 3222
Exception:
System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
   en Server.Commands.VerifyAge.VerifyAge_OnCommand(CommandEventArgs e) en c:\runuo\scripts\Custom\AgeSystem.cs:línea 62
   en Server.Commands.CommandSystem.Handle(Mobile from, String text, MessageType type)
   en Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
   en Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue) en c:\runuo\scripts\Mobiles\PlayerMobile.cs:línea 2229
   en Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
   en Server.Network.MessagePump.HandleReceive(NetState ns)
   en Server.Network.MessagePump.Slice()
   en Server.Core.Main(String[] args)

AgeSystem.cs - line 62:

Code:
	if ( ((Account)pm.Account).GetTag( "Age of " + (pm.RawName) ) == null || ((Account)pm.Account).GetTag( "Age of " + (pm.RawName) ) == "")

PlayerMobile.cs - Line 2229:
Code:
base.DoSpeech( text, keywords, type, hue );

So, this happened.

Thanks, Rai.
 

Felladrin

Sorceror
(Update) Version 1.0.2

- Now unreadable accounts are ignored to avoid server crash. It won't say what are the 'troublemaker' accounts, as they can't be read and we can't get any information about them. But it will tell how many couldn't be read while the age check.

This should fix the error posted by purplemouse91 and jraicr, about the null reference.
 
Top