Full Version : Escortables...
xmlspawner >>Scripting Support >>Escortables...
<< Prev | Next >>
ArteGordon- 02-11-2006
based on this

QUOTE
Region.AddRegion( GuardedRegion.Disable( new TrammelTown( "Stary Oboz" ) ) );

the region should report as a town like
Stary Oboz: Your region is the town of Stary Oboz;
not like

QUOTE
Stary Oboz: Your region is Stary Oboz;

Have you defined another region with that name?
Galfaroth- 02-11-2006
As you see in my Regions.xml I didn't define anymore Stary Oboz region and this is all point...
ArteGordon- 02-11-2006
the region definition would be in a region definition script, like towns.cs or dungeons.cs or perhaps somewhere else.
It would involve another AddRegion call with a region with that name in a script somewhere.
It could also be a custom region that you have added by hand using region in a box or some other tool.
The regions.xml file just specifies the configuration of regions that have already been created in a region script, it doesnt actually add the regions.
Galfaroth- 02-11-2006
Arte you were again right... Why does Sekta worked Look on this:

CODE
using System; using System.Collections; using Server; using Server.Mobiles; using Server.Spells;
namespace Server.Regions
{
public class NoHousingRegion : Region
{
public static void Initialize()
{
/* The first parameter is a boolean value:
* - False: this uses 'stupid OSI' house placement checking: part of the house may be placed here provided that the center is not in the region
* - True: this uses 'smart RunUO' house placement checking: no part of the house may be in the region
*/
Region.AddRegion( new NoHousingRegion( false, "", "Britain Graveyard", Map.Felucca ) );
Region.AddRegion( new NoHousingRegion( false, "", "Wrong Entrance", Map.Felucca ) );
Region.AddRegion( new NoHousingRegion( false, "", "Covetous Entrance", Map.Felucca ) );
Region.AddRegion( new NoHousingRegion( false, "", "Despise Entrance", Map.Felucca ) );
Region.AddRegion( new NoHousingRegion( false, "", "Despise Passage", Map.Felucca ) );
Region.AddRegion( new NoHousingRegion( false, "", "Jhelom Islands", Map.Felucca ) );
Region.AddRegion( new NoHousingRegion( false, "", "Stary Oboz", Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", "Nowy Oboz", Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", [b]"Oboz Sekty"[/b], Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", "Klasztor Innosa", Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", "Klasztor Adanosa", Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", "Klasztor Mrocznych Sztuk", Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", "Oboz Orkow", Map.Trammel ) );
Region.AddRegion( new NoHousingRegion( false, "", "Crystal Cave Entrance", Map.Malas ) );
Region.AddRegion( new NoHousingRegion( true, "", "Protected Island", Map.Malas ) );
}
private bool m_SmartChecking;
public bool SmartChecking{ get{ return m_SmartChecking; } }
public NoHousingRegion( bool smartChecking, string prefix, string name, Map map ) : base( prefix, name, map )
{
m_SmartChecking = smartChecking;
}
public override bool AllowHousing( Mobile from, Point3D p )
{
return m_SmartChecking;
}
public override void OnEnter( Mobile m )
{
}
public override void OnExit( Mobile m )
{
}
}
}

I wrong named the Sekta - Oboz Sekty and it didn't define any region: Sekta so it worked. Now when I remove lines like: Stary Oboz etc. from this script escorts will work BUT... How to disallow player to build houses in those towns? Because if we delete those lines from this scripts - escorts will work and player would build houses, but I don't want them to build them on these regions. Have I define region in region and name it different, or I don't need to change my Regions.xml?
ArteGordon- 02-11-2006
One important thing to recognize about regions is that you can only have one active at any given location. So even if you did add both of those regions, only one would actually be applied anyway. That is what the priority is for. It determines which will apply.
When you make guarded regions, housing is disabled by default anyway. In guardedregion.cs

QUOTE
public override bool AllowHousing( Mobile from, Point3D p ) { return false; }