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!

Make all players login to to same location.

zolo888

Sorceror
Hello.

I am trying to make it so that anyone that logs in will be teleported to a certain location.

Is this something someone has done?

Needs to be new players and old players. Login - Teleport to xx yy coordinates.

Thanks in advance - long live RunUO!
 

LFFPicard

Sorceror
Not at my computer at the moment but In Scripts\Misc\CharacterCreation.cs, look for the line that starts "CityInfo city".

There will be code something like:

Code:
CityInfo city = GetStartLocation( args, young );
//CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

You can change this by switching the comments and changing the location on the second line. So you end up like this:

Code:
//CityInfo city = GetStartLocation( args, young );
CityInfo city = new CityInfo( "StartPlace", "Start Here", xxxx, yyyy, zz, Map.Trammal );
 

Dian

Sorceror
Think he is asking for any character, new or old, login to one single spot no matter what.

You could just look in PlayerMobile for the OnLogin method, and add a starting location.
 

LFFPicard

Sorceror
I thought the above was for that, the first statement:
Code:
CityInfo city = GetStartLocation( args, young );
Is referring to a start location for "Young" which would be someone choosing a premade template. So uncomment for "Young" only or comment out for all new players.
The second statment:
Code:
CityInfo city = new CityInfo( "StartPlace", "Start Here", xxxx, yyyy, zz, Map.Trammal );
Would be the start location.

Mind you, I am no coder :)

But if he is indeed referring to any player regardless, so even if the player logs out in their house they will relog at this location then yes the Playermobile is best place to look.
 

Dian

Sorceror
What you posted only handles newly created characters when they first enter the game world. But is half of what he is looking to change.

Honestly though, if I was forced to a certain starting location every time I logged in, I would get annoyed very fast. But Im sure you have a good reason for it.


If you have trouble with adding the code to PlayerMobile OnLogin, just let us know.

You would want to start by looking to add MoveToWorld code I believe.
 

pooka01

Sorceror
Code:
using System;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Server.Mobiles;
namespace Server
{
 //add the const keyword so it can't be changed?
 private static Point3D m_LoginLocation = new Point3D(X, Y, Z);
 private static Point3D m_LoginMap = Map.<ENTER MAP HERE>; //Map. or MapDefinition. not sure.
 
 public class PlayerLoginMover
 {
  private static void World_Login( LoginEventArgs args )
  {
   ((PlayerMobile)args.Mobile).MoveToWorld( m_LoginLocation, m_LoginMap );
  }
 }
}

there you go if it's what you need.
 

zolo888

Sorceror
First - Thanks for the replies... Most apprectaited.

I am looking to move everyone who logs in to a set location, new and old players.

I will try the above script and add the location Map.etc

Do i need to add this to a script or create a new one eg speciallogin.cs ?
 

zolo888

Sorceror
I get an error on lines 10 and 11 Expected class, delegate, enum, interface, or struct????

What does mean? //add the const keyword so it can't be changed?
 

zolo888

Sorceror
I get an error on lines 10 and 11 Expected class, delegate, enum, interface, or struct????

What does mean? //add the const keyword so it can't be changed?
 

pooka01

Sorceror
Code:
using System;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Server.Mobiles;
namespace Server
{
public class PlayerLoginMover
{
  //add the const keyword so it can't be changed?
  private static Point3D m_LoginLocation = new Point3D(X, Y, Z);
  private static Point3D m_LoginMap = Map.<ENTER MAP HERE>; //Map. or MapDefinition. not sure.
 
  private static void World_Login( LoginEventArgs args )
  {
  ((PlayerMobile)args.Mobile).MoveToWorld( m_LoginLocation, m_LoginMap );
  }
}
}

my bad.
not sure about the const thing, that's why i placed it there.
 

pooka01

Sorceror
You made me look again at my codes xD
thanks :p

i forgot that:
Code:
  public static void Initialize()
  {
  EventSink.Login += new LoginEventHandler( World_Login );
  }

And no i didn't try it, i have a similar script tho.
 

Dian

Sorceror
:p

I was trying not to sound rude.. not my intent, at all.. especially with so few people here helping others these days :(
 
Top