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!

In-game Customizable Regions in a Box [V3.6]

sidsid

Sorceror
Avelyn said:
Asayre8, this is such an awesome script. I would let you have my first born if you could somehow find a way to override a housing region!

This is not the correct forum for offering your first born. Read the rules or risk being banned.


hahah... JUST KIDDING

:D :eek: :cool:
 

ASayre

RunUO Developer
Avelyn said:
Asayre8, this is such an awesome script. I would let you have my first born if you could somehow find a way to override a housing region! This script is exactly what I need for so many ideas except that a badly placed house in the middle screws it all up! Also, is there any way you could add a visual reference while setting the area? When you try to make a big bounding box you can really get lost. I know the XML spawner uses the flamestrike anim outline the spawn area, anything like that to show the box to Admins would be incredibly helpful even if it's just for a min or so after creating the area so you could run around and make sure it gets everything in you need it to.

Thanks!

Well, unofurnately, The housingRegion const thing for the value is in the core. So I can't change the Thing from within the core to change all instances of it. If you Want to edit HouseRegion.cs yourself to make it have a lower priority, replace
Code:
Priority = Region.HousePriority;
with
Code:
Priority = 140;

Then You can set the RegionInABox PRiority to HighestPriority which would be greater than 140, thus overriding the houseregion.


Can you tell me more bout the XML Flamestrike thing? like post a code snippit of where it does that?
 

Dracarys

Wanderer
ASayre8 said:
Can you tell me more bout the XML Flamestrike thing? like post a code snippit of where it does that?

I added that myself. It's just a function that plays an animation (ParticleEffect) in the 4 corners of the region. I tried making this permanent but it lags awfully if you do. So I just added a button that displays the corners by playing the animation.

Code:
void SendLocationEffect( IPoint3D p, Map map, int itemID, int duration, int speed, int hue, int renderMode )

I didn't like the Flamestrike thingie so it looks like this in code for me: (Of course you need to play the effect 4 times for each region part)

Code:
Effects.SendLocationEffect( m_point, m_map, 0x3779, [B]17[/B], 1, 36, 3 );

You can replace the bold 17 with any number dividable by 17 to increase the duration of the effect. I just wanted a quick visual reminder so 17 was enough for me.
 

bleis

Sorceror
It seem like the guard settings still go back to true, even after I have downloaded last version,.......Still happens after a restart
 

Avelyn

Sorceror
ASayre8 said:
Well, unofurnately, The housingRegion const thing for the value is in the core. So I can't change the Thing from within the core to change all instances of it. If you Want to edit HouseRegion.cs yourself to make it have a lower priority, replace
Code:
Priority = Region.HousePriority;
with
Code:
Priority = 140;

Then You can set the RegionInABox PRiority to HighestPriority which would be greater than 140, thus overriding the houseregion.


Can you tell me more bout the XML Flamestrike thing? like post a code snippit of where it does that?



Here is the method for the show boundry Area for the XML spawner. This code was posted by ArteGordon and he gets the credit for it.

Code:
 [CommandProperty( AccessLevel.GameMaster )]
        public bool ShowBounds
        {
            get{ return ( this.m_ShowBoundsItems.Count > 0 ); }
            set
            {
                if( ( value == true ) && ( this.ShowBounds == false ) )
                {
                    // Boundary lines
                    int ValidX1 = this.m_X;
                    int ValidX2 = this.m_X + this.m_Width;
                    int ValidY1 = this.m_Y;
                    int ValidY2 = this.m_Y + this.m_Height;

                    for( int x = 0; x <= this.m_Width; x++ )
                    {
                        int NewX = this.m_X + x;
                        for( int y = 0; y <= this.m_Height; y++ )
                        {
                            int NewY = this.m_Y + y;

                            if( NewX == ValidX1 || NewX == ValidX2 || NewX == ValidY1 || NewX == ValidY2 || NewY == ValidX1 || NewY == ValidX2 || NewY == ValidY1 || NewY == ValidY2 )
                            {
                                // Add an object to show the spawn area
                                Static s = new Static( ShowBoundsItemId );
                                s.MoveToWorld( new Point3D( NewX, NewY, this.Z ), this.Map );
                                this.m_ShowBoundsItems.Add( s );
                            }
                        }
                    }
                }

                if( value == false )
                {
                    // Remove all of the items from the array
                    foreach( Static s in this.m_ShowBoundsItems )
                        s.Delete();

                    this.m_ShowBoundsItems.Clear();
                }
            }
        }
        private ArrayList m_ShowBoundsItems = new ArrayList();

        [CommandProperty( AccessLevel.GameMaster )]
        public Point3D X2_Y2
        {
            get{ return new Point3D( ( this.m_X + this.m_Width ), ( this.m_Y + this.m_Height ), this.Z ); }
            set
            {
            	int X2;
            	int Y2;

                int OriginalX2 = this.m_X + this.m_Width;
                int OriginalY2 = this.m_Y + this.m_Height;
                // now determine based upon the entered coordinate values what the lower left corner is
                // lower left will be the min x and min y
                // upper right will be max x max y
                if(value.X < OriginalX2){
                    // ok, this is the proper x value for the lower left
                    this.m_X = value.X;
                    X2 = OriginalX2;
                } else {
                    this.m_X = OriginalX2;
                    X2 = value.X;
                }
                
                if(value.Y < OriginalY2){
                    // ok, this is the proper y value for the lower left
                    this.m_Y = value.Y;
                    Y2 = OriginalY2;
                } else {
                    this.m_Y = OriginalY2;
                    Y2 = value.Y;
                }

                this.m_Width = X2 - this.m_X;
                this.m_Height = Y2 - this.m_Y;

                if(this.m_Width == this.m_Height)
                    this.m_SpawnRange = this.m_Width/2;
                else
                    this.m_SpawnRange = -1;

                if( this.m_HomeRangeIsRelative == false )
                {
                    int NewHomeRange = ( this.m_Width > this.m_Height ? this.m_Height : this.m_Width );
                    this.m_HomeRange = ( NewHomeRange > 0 ? NewHomeRange : 0 );
                }
                //ARTEGORDONMOD
                //original test was for less than 1, changed it to less than zero (zero is a valid width, its the default in fact)
                // Stop the spawner if the width or height is less than 1
                if( ( this.m_Width < 0 ) || ( this.m_Height < 0 ) )
                    this.Running = false;

                InvalidateProperties();

                // Check if the spawner is showing its bounds
                if( this.ShowBounds == true )
                {
                    this.ShowBounds = false;
                    this.ShowBounds = true;
                }
            }
        }
 

ASayre

RunUO Developer
Sorry I hae'nt posted an update ina few days. Been preoccupied with other stuff.

Anwyays, I fixed the Guarded Bug thingy 7& I'll upload the fix after I get back home from class.

About the region display thing... gonnas post some ideas here just so I don't forget 'em by the time I get home.

Have a command, [ShowRegionArea, that when run, could either target a Mobile or a RegionControl item thing.

Should it target a mobile, it'd use the Effect thingies to outline the Region that the mobile is currently in. (Any region, not just CustomRegions)

Should it target a RegionControl Item, have it outline with the effect the bounds of the Region control.
 

ASayre

RunUO Developer
Updated V 3.5

4/21 [3.5]:
Fixed the other half of Guard Bug. Should be 100% fixed and bug free now.

Added command [RegionBounds . This command will work for ANY Region. Just target a Mobile to display the bounds for that Mobile, or Target a RegionControl to display the bounding areas for that.

That features uses effects and not an actual item to reduce lag and so it's not permanent. This is intended.

Because of this features, Scripters can use the static methods in there to show bounds of ANY region or ANY rectangle2D that they want. Just use Functions ->

Code:
static void ShowRegionBounds( Region r )
static void ShowRectBounds( Rectangle2D r, Map m )

As always, Please post any more suggestions or Bugs, Yaada yaada!
 

Dracarys

Wanderer
ASayre8 said:
That features uses effects and not an actual item to reduce lag and so it's not permanent. This is intended.


 

KillerBeeZ

Knight
I noticed a few things

1 - this may be just the client, but it sounds like many of the songs listed are the same

2 - the option: cannotlootOWNcorpse is opposite, with True they can loot their own corpse, with this at false they cant. should say "Can loot own corpse"
Not much of a bug but can be confusing to some GM's and players might lose a lot while they figure it out.

I also tried over laping with one at low priority and one with high but whichever one I add last seems to take priority, maybe I'm just doing that wrong.
 

bleis

Sorceror
KillerBeeZ said:
I noticed a few things



I also tried over laping with one at low priority and one with high but whichever one I add last seems to take priority, maybe I'm just doing that wrong.

I´m trying to figure it out, but havent had any luck yet, but overlapping zones, no matter what priority or when they where added according to other, get messed up...
I have even tryed to remove my xml made regions, but thet dont help either
 

Chandral

Wanderer
I attepted to set it where no spells of any kind would be allowed in a certain area, but it isnt doing it. Only thing it did was make it to where when a rune is marked and u try to recall off of that rune, it gives a messge that location is blocked. Am I doing something wrong with the gump?
 

smoksalot

Wanderer
Any way we could make it so You can only place certain houses in the zone,

Like fore example, //No castle can be placed here
but you can place other houses...
 

ASayre

RunUO Developer
KillerBeeZ said:
I noticed a few things

1 - this may be just the client, but it sounds like many of the songs listed are the same

-> Yup, client.

2 - the option: cannotlootOWNcorpse is opposite, with True they can loot their own corpse, with this at false they cant. should say "Can loot own corpse"
Not much of a bug but can be confusing to some GM's and players might lose a lot while they figure it out.

-> Oops, forgot a ! operator. Fxied,w ill updated after I check all this other stuff out

I also tried over laping with one at low priority and one with high but whichever one I add last seems to take priority, maybe I'm just doing that wrong.

-> I'll look into this...
 

ASayre

RunUO Developer
Chandral said:
I attepted to set it where no spells of any kind would be allowed in a certain area, but it isnt doing it. Only thing it did was make it to where when a rune is marked and u try to recall off of that rune, it gives a messge that location is blocked. Am I doing something wrong with the gump?


Yea, you prolly didn't pree the Okay Button, or, You were staff when you tried to cast the spell.

Any way we could make it so You can only place certain houses in the zone,

Like fore example, //No castle can be placed here
but you can place other houses...

Prolly not. If so, it's not something I wanna include in because I'd prolly hafta make a new gump for it and I hate making gumps! =P
 

Protius73

Sorceror
For those of you doing the testing and what not for the regions...
If you make spell dampened regions and skill damnpened regions... you must be on a Player Level character to see the effects.. Admins and staff are unaffected by the custom regions.... Just a note :D
 

Debbie

Wanderer
Just downloaded the lastest version and still having problems with it not saving the is guarded option. After a server restart it defaults back to true.
 

Chandral

Wanderer
ASayre8 said:
Yea, you prolly didn't pree the Okay Button, or, You were staff when you tried to cast the spell.



Prolly not. If so, it's not something I wanna include in because I'd prolly hafta make a new gump for it and I hate making gumps! =P


Okay, that explains it then. It seems that no matter if on my admin account or on another, on same puter, it gives me priviledges that other dont have. Thanks for your quick response!

BTW, I love the script! Only wish I could script 1/100th that well. :D
 

ASayre

RunUO Developer
4/21 [3.6]:
/sigh. I DID have the guarded bug fixed, but, when I uploaded it, I didn't upload the working file with the fix. So. Here it is. Tested and everything. (For once)

Also fixed the priority bugs, Wans't a bug with priority, just the region not updating at the right times... I think I tested it all accordingly and stuff and it all seemed to work.. so, test it out for me & tell me! :)

Fixed bug where Showbounds didn't have the top-right corner piece.

ShoBounds will now tell you teh region priority of the region if you target a mobile.
 
Top