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!

Young Player System BETA 1.0

cward

Wanderer
The NewPlayerTicket should be added in CharacterCreation.cs, the code you showed would not work the way it should.
 

Saxum

Wanderer
cward said:
The NewPlayerTicket should be added in CharacterCreation.cs, the code you showed would not work the way it should.

Well, the thing is I don't know what kind of code I should add and redirect it to the NewPlayerTicket to do a check. In the readme it said that code should be put into playermobile.cs and I got no errors when I ran it but I got no ticket either.

Mind enlightning me with a hint how to add it to the charactercreation.cs?
 

cward

Wanderer
Saxum said:
Well, the thing is I don't know what kind of code I should add and redirect it to the NewPlayerTicket to do a check. In the readme it said that code should be put into playermobile.cs and I got no errors when I ran it but I got no ticket either.

Mind enlightning me with a hint how to add it to the charactercreation.cs?
I've not looked at this script so I'm not sure. You would need to do a check for the young player account tag.

This is how I did it on my young system I've been working on.

Code:
NewPlayerTicket playerticket = new NewPlayerTicket();
playerticket.Owner = newChar;

if ( account tag check here )
{
    newChar.AddToBackpack( playerticket );
}
 

jaynigs

Wanderer
Code:
private static void AddBackpack( Mobile m )
		{
			Container pack = m.Backpack;

			if ( pack == null )
			{
				pack = new Backpack();
				pack.Movable = false;

				m.AddItem( pack );
			}

			PackItem( new RedBook( "a book", m.Name, 20, true ) );
			PackItem( new Gold( 1000 ) ); // Starting gold can be customized here
			PackItem( new Dagger() );
			PackItem( new Candle() );

[B]			string tag = ((Account)m.Account).GetTag( "AllowYoung" );

			NewPlayerTicket playerticket = new NewPlayerTicket();
			
			if ( tag == "1" || tag == null )
			{
    				m.AddToBackpack( playerticket );
			}[/B]



		}


add the code in bold to this method in your charactercreation.cs
 

Saxum

Wanderer
cward said:
I've not looked at this script so I'm not sure. You would need to do a check for the young player account tag.

This is how I did it on my young system I've been working on.

Code:
NewPlayerTicket playerticket = new NewPlayerTicket();
playerticket.Owner = newChar;

if ( account tag check here )
{
    newChar.AddToBackpack( playerticket );
}

I tried pretty much everything and I don't manage to get it working.. Any more help perhaps?
 

Saxum

Wanderer
Posted at the same time as you and this solved my problem! Thanks a lot man!

I think this should be added to the installation file because in the real youngplayer system such ticket exist.
 

bean56

Wanderer
You need to change the line to this jaynigs.
Code:
this.PrivateOverheadMessage( Network.MessageType.Label, 187, true, name, this.NetState);
 

bean56

Wanderer
Also I noticed in moongate.cs you said to put this
Code:
if ( from is PlayerMobile && ((PlayerMobile)from).YoungPlayer )
			{
				from.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
				
				return false;
			}
but if you do that then as you can see any young player will not be able to use a moongate so I think you need a Map.Felucca check in there too or take it out all together since the previous function also has something to stop them from going to felucca.
 

jaynigs

Wanderer
bean56 said:
Also I noticed in moongate.cs you said to put this
Code:
if ( from is PlayerMobile && ((PlayerMobile)from).YoungPlayer )
			{
				from.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
				
				return false;
			}
but if you do that then as you can see any young player will not be able to use a moongate so I think you need a Map.Felucca check in there too or take it out all together since the previous function also has something to stop them from going to felucca.


Yes thanks been thats now all been sorted in version 1.31 beta and ive added your pre aos code also
:D
 

bean56

Wanderer
That sounds good dude, but one thing. With your new version you just took out the ilsh region. True this would prevent players from being moved in ilsh, but then it would still search 200 tiles then 1000 then 5000 etc so it would be a big waste of resources. Why don't you just check this.Map != Map.Ilshenar in each if?
 

jaynigs

Wanderer
bean56 said:
That sounds good dude, but one thing. With your new version you just took out the ilsh region. True this would prevent players from being moved in ilsh, but then it would still search 200 tiles then 1000 then 5000 etc so it would be a big waste of resources. Why don't you just check this.Map != Map.Ilshenar in each if?


yes it was just a quick fix as i was concentrating on something else, i will add that check in future, it was just a last minute edit that i included..

The fact is im not happy with that entire part of the code and plan to rewrite it
 

bean56

Wanderer
Understandable because the fact is it seems like a horrible way to do it, but it does work well. I'm confused if players don't get teleported in ilsh why do they get teleported in malas? Also if they can't get to felucca then you can take out the felucca town check. If you did the map check like that you could also take out the ilshtown check like you did.
 

bean56

Wanderer
Change it to
Code:
PrivateOverheadMessage( MessageType.Regular, 187, false, name, from.NetState );
I'm such an idiot.

I would also like to add that currently there is no code so young players insta log. There is nothing for ondisconnect or onlogout.

would a simple this.Map = Map.Internal do?

I'm also curious is the 24 hour account time check in the help gump correct?
 

jaynigs

Wanderer
bean56 said:
Change it to
Code:
PrivateOverheadMessage( MessageType.Regular, 187, false, name, from.NetState );
I'm such an idiot.

I would also like to add that currently there is no code so young players insta log. There is nothing for ondisconnect or onlogout.

would a simple this.Map = Map.Internal do?

I'm also curious is the 24 hour account time check in the help gump correct?

Young players insta log, i missed a part of code on playermobile

:eek:


Here it is if you need it


Code:
                 public override TimeSpan GetLogoutDelay()
		{
			if ( this.YoungPlayer )
				return TimeSpan.Zero;
			else
				return base.GetLogoutDelay();
		}

This now added to v 1.32


as for your other question the 24 hours is for advanced characters only....
 

bean56

Wanderer
jaynigs said:
as for your other question the 24 hours is for advanced characters only....
What about regular young characters then? There is no check for them to get the young gump if they are still young.
 

jaynigs

Wanderer
bean56 said:
What about regular young characters then? There is no check for them to get the young gump if they are still young.

I dont understand what you are saying, regular youngs get 40 hours of young play and advanced characters get 24
 
Hey, i thought the player mobile changed... because it's not in the zip. The zip contains "Jaynigs Young Player System Beta 1.32.txt", "Recall.cs", "SacredJourney.cs", "DungeonGump.cs", and "RenounceGump.cs". I was just wondering if there's supposed to be more, or if your didn't put it in or something... because atm i'm kinda screwed if my shard crashes... lol, i replaced all the files, and i'm a little lazy to go off and change em all back :p
 
Top