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!

Regions, Custom Maps, and Moongates...

Sythen

Sorceror
Regions, Custom Maps, and Moongates...

Okay I added the 'Iceland' custom (copy of tram) map and named it map32.mul and all is well... [added this info so Lord Greywolf will know what I did].

I then added a skill-stat moongate to the server and edited the script to teleport whoever goes through to Iceland. :D Even though I can use the '[go Iceland' command in game and get there that way as an admin.

I got a message saying: Server.Map does not recognize Iceland as a map.

So my suggested fix for this is: (and please tell me if I did this right)

/***************************************************************************
* Map.cs
* -------------------
* begin : May 1, 2002
* copyright : (C) The RunUO Software Team
* email : [email protected]
*
* : Map.cs 159 2007-02-11 22:15:14Z asayre $
*
***************************************************************************/

/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Server.Items;
using Server.Network;
using Server.Targeting;

namespace Server
{
[Flags]
public enum MapRules
{
None = 0x0000,
Internal = 0x0001, // Internal map (used for dragging, commodity deeds, etc)
FreeMovement = 0x0002, // Anyone can move over anyone else without taking stamina loss
BeneficialRestrictions = 0x0004, // Disallow performing beneficial actions on criminals/murderers
HarmfulRestrictions = 0x0008, // Disallow performing harmful actions on innocents
TrammelRules = FreeMovement | BeneficialRestrictions | HarmfulRestrictions,
FeluccaRules = None
}

public interface IPooledEnumerable : IEnumerable
{
void Free();
}

public interface IPooledEnumerator : IEnumerator
{
IPooledEnumerable Enumerable{ get; set; }
void Free();
}

[Parsable]

//[CustomEnum( new string[]{ "Felucca", "Trammel", "Ilshenar", "Malas", "Tokuno", "Internal" } )]

public sealed class Map : IComparable, IComparable<Map>
{
public const int SectorSize = 16;
public const int SectorShift = 4;
public static int SectorActiveRange = 2;

private static Map[] m_Maps = new Map[0x100];

public static Map[] Maps { get { return m_Maps; } }

public static Map Felucca { get { return m_Maps[0]; } }
public static Map Trammel { get { return m_Maps[1]; } }
public static Map Ilshenar { get { return m_Maps[2]; } }
public static Map Malas { get { return m_Maps[3]; } }
public static Map Tokuno { get { return m_Maps[4]; } }

//-------------------------Insert Your Custom Maps Below-------------------------//

:confused: //i.e, public static Map Iceland { get { return m_Maps[32]; } }//


//-------------------------------------------------------------------------------//

public static Map Internal { get { return m_Maps[0x7F]; } }

private static List<Map> m_AllMaps = new List<Map>();

public static List<Map> AllMaps { get { return m_AllMaps; } }

private int m_MapID, m_MapIndex, m_FileIndex;

private int m_Width, m_Height;
private int m_SectorsWidth, m_SectorsHeight;
private int m_Season;
private Dictionary<string, Region> m_Regions;
private Region m_DefaultRegion;

public int Season { get { return m_Season; } set { m_Season = value; } }

I added this line to show you where I think I need to add the new maps; also I browsed through the other parts of the script and they had no more mention of the map names; trammel, felucca, ilshenar, malas, and tokuno... so I suspect that it didnt need to be touched:

//-------------------------Insert Your Custom Maps Below-------------------------//

I figure by adding the names of the new maps it will register them in the game so we can go to predefined regions and areas within them via moongates or maybe I am wrong. Any Ideas?

I added this to this thread because this has a little to do with regions and travel etc. Plus this is one of those last minute edits I had to do to make a region work. LOL You know, when you start on one big project and it ends up becoming 5 or 6 mini projects that take the same amount of time and energy. :eek:
 

Sythen

Sorceror
Okay I Found The Answer To My Question... LOL

I do have 1 more question, (and I thought I figured this out lol),

Will this method work for referencing a script to a particular facet? because as you read above thats what the issue was.

m.map = map.Iceland

Console: Server.Map has no definition for Iceland ... yada yada yada
 
no idea why your gate wil not work, unless you did not set it up correctly

here is my MapDefinitions.cs - and all i have done is add the map there

and then i made a normal teleporter, changed the map to future world, set coords to be in green acres some where and walk on through and it takes me there

maybe you need to set up your skill teleporter differently, or your map def file differently - remember the new maps have to start at number 32, else they will not work

Code:
using System;
using Server;

namespace Server.Misc
{
	public class MapDefinitions
	{
		public static void Configure()
		{
			RegisterMap( 0, 0, 0, 7168, 4096, 4, "Felucca",		MapRules.FeluccaRules );
			RegisterMap( 1, 1, 0, 7168, 4096, 2, "Trammel",		MapRules.TrammelRules );
			RegisterMap( 2, 2, 2, 2304, 1600, 2, "Ilshenar",		MapRules.TrammelRules );
			RegisterMap( 3, 3, 3, 2560, 2048, 2, "Malas",		MapRules.TrammelRules );
			RegisterMap( 4, 4, 4, 1448, 1448, 4, "Tokuno",		MapRules.FeluccaRules );
			RegisterMap( 32, 0, 0, 7168, 4096, 0, "Future_World", 	MapRules.TrammelRules );

			RegisterMap( 0x7F, 0x7F, 0x7F, Map.SectorSize, Map.SectorSize, 1, "Internal", MapRules.Internal );

		}

		public static void RegisterMap( int mapIndex, int mapID, int fileIndex, int width, int height, int season, string name, MapRules rules )
		{
			Map newMap = new Map( mapID, mapIndex, fileIndex, width, height, season, name, rules );

			Map.Maps[mapIndex] = newMap;
			Map.AllMaps.Add( newMap );
		}
	}
}
 

Sythen

Sorceror
Thanks Lord Greywolf...

Perhaps it was just an old script... I found the Moongates already in RunUO and the Skill Teleporter both work nicely... but when I installed:

nacroms-class-gate-system

Thats when I got the Map.cs error....

Anyway what attracted me to this system was that I could set up a moongate for staff to go through and equip them with the items they can use on the server; I'm sure I'll find others... this system added a cool feature which teleported staff to a predefined location. :D

As always, thanks for your help! :D
 
in the script release secion is a nice travel book, that is easy to customize for more or lese places and such

do a search for travel book, and you should find it

it is straight forward for adding in more sections (like facets) and areas to go to, and it currently includes all the standard towns 7 dungeons
 
Top