Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to make them public domain. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 07-01-2006, 07:59 AM   #1 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default [RunUO 2.0 RC1] Custom Regions in a Box V4.0

Custom Regions in a Box V4.0

Description:
This is a rewrite/update for RunUO 2.0 of Asayre8's extremely popular Custom Regions in a Box script for RunUO 1.0. This is also a compilation of changes made by Rift in his re-release of Custom Regions in a Box.
Along with updating this to 2.0 I have included Rift's mods and quite a few changes of my own to improve upon what Asayre started.
Please visit the following threads to familiarize yourself with the background of Custom Regions in a Box and a more in-depth description:

Asayre's Original CustomRegions in a Box V3.6
Rift's Mod [V3.6a]

Installation:
Download the Custom Regions in a Box v4.0.zip below.
Unzip the Custom Regions folder from the zip into your Scripts folder (preferrably a Custom folder or the Engines folder)
Restart your server and you are ready to go.

Usage:
[add RegionControl in game to add a RegionControl.
Visit the links in the Description section above to see the previous features.
Read my Changelog below for V4.0 to discover the new features and changes from previous versions. The Changelog is also included in the Zip file.

V4.0 Changelog:

- Renaming of RegionStone.cs
- RegionStone.cs renamed to RegionControl.cs to properly reflect the name of the Class. (functionality is still the same)

- New RegionControl Constructors
- RegionControl(Rectangle3D rect) to create a RegionControl with an optional area specified by a Rectangle3D.
- RegionControl(Rectangle2D[] rects) to create a RegionControl with an optional area specified by a Rectangle2D array.
- RegionControl(Rectangle3D[] rects) to create a RegionControl with an optional area specified by a Rectangle3D array.

- New "Active" Property for RegionControl
- Set RegionControl.Active to TRUE (Default) then the Region is active.
- Set RegionControl.Active to FALSE then the Region is inactive.

- Changes to Rift's Custom Region Mods
- NoPlayerCorpses has been split up into DeletePlayerCorpse and DeleteNPCCorpse, to allow more customization.
- NoItemDrop has been split up into NoPlayerItemDrop and NoNPCItemDrop, to allow more customization.

- New RegionControl Flags
- EmptyNPCCorpse, if set to TRUE all the items from an NPC's corpse, on death, will be placed outside of the corpse on to
the ground.
- EmptyPlayerCorpse, if set to TRUE all the items from a Player's corpse, on death, will be placed outside of the corpse on to
the ground.
- DeleteNPCCorpse, if set to TRUE any NPC's corpse, on death, will be deleted.
- DeletePlayerCorpse, if set to TRUE any Player's corpse, on death, will be deleted.
- ResNPCOnDeath, if set to TRUE any NPC that dies will have a new instance created in the spot that it died.
- ResPlayerOnDeath, if set to TRUE any Player that dies will be resurrected in the spot that they died.
- MoveNPCOnDeath, if set to TRUE any NPC that dies will be moved to a spot you designate.
- Set MoveNPCToLoc to the Point3D that you wish to move the NPC to.
- Set MoveNPCToMap to the Map that you wish to move the NPC to.
- MovePlayerOnDeath, if set to TRUE any Player that dies will be moved to a spot you designate.
- Set MovePlayerToLoc to the Point3D that you wish to move the Player to.
- Set MovePlayerToMap to the Map that you wish to move the Player to.
- NoPlayerItemDrop, if set to TRUE any Player that dies will not drop their backpack Items to their corpse.
- NoNPCItemDrop, if set to TRUE any NPC that dies will not drop their backpack Items to their corpse.

- Changes to [RegionBounds command
- Targeting a Mobile shows their Region outlined in blue still.
- Targeting a RegionControl that has its Active property set to TRUE outlines the region in green.
- Targeting a RegionControl that has its Active property set to FALSE outlines the region in red.

- Changes to RegionControl Flags
- CannotLootOwnCorpse property changed to CanLootOwnCorpse
- CannotEnter property changed to CanEnter

- Fixed some spelling mistakes
- All instances of "AllowBenifit" changed to "AllowBenefit".

- Prevention of identical RegionName
- On Deserialize, if a region control has the same RegionName as another the region it will have a 1 or 2 etc. added to its
name to distinguish it.
For eg. If a region is called "Custom Region" and another region is already called "Custom Region" it will get called "Custom
Region 1", if "Custom Region 1" already exists too then it will be called "Custom Region 2" etc. This is because of the new way that
Regions are registered on to maps in RunUO 2.0.
- On creation, a new Region Control will be called "Custom Region" and as before each new "Custom Region" will have a
number added after its name.
- On setting of RegionName, if a Region Control already exists with the RegionName that the user tries to specify by using
[props etc. the RegionName will not be changed and a Warning will be displayed in the Console.

Approval Status:
- Have PMed Asayre before starting work to ask permission, I receieved no reply .
However after reading posts from him saying about his lack of time due to his time being commited to the main RunUO 2.0 release I decided I wanted to do Custom Regions in a Box justice and release it for all the fans for 2.0.
- If Asayre himself or a Mod has a problem with this post then please either PM me and I will remove it or remove it yourself but please send me a PM telling me you have done so and your reasons. Thanks

Comments/Suggestions/Bugs:
Please provide me with any feedback you wish, either in this thread or as a PM. Please also provide me with any Bugs you may find and try to include as much detail in your posts as you can so I can fix them.
I have started a list below of possible features that I would personally like to add to this, please reply in this thread with your comments on these features and also with your own ideas that I will also consider.
Thanks everyone.

Possible Future Updates:
- Export/Import command
An Export command for RunUO 1.0 to export details about all your pre-existing Region Controls. An Import command for RunUO 2.0 to import your exported 1.0 Region Controls into your RunUO 2.0 Server.

- Region Control Profiles
- Profiles for each Region Control so that it can be reused for different things according to different profile sets. An example for this is to use a Region Control for an Event Arena that can hold different Events, different profiles for the Region Control would relate to different Events, so the arena can easily be switched from one Event to another.

- Overhaul of Gumps
Redesigning the Gumps, this would especially be needed if the Region Control Profiles were to be implemented.
Attached Files
File Type: zip Custom Regions in a Box V4.0.zip (13.1 KB, 2036 views)
__________________
David's Sig is my Sig. He always says it best.

Last edited by tobyjug; 03-01-2007 at 01:57 PM.
tobyjug is offline   Reply With Quote
Old 07-01-2006, 08:02 AM   #2 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

Update(dd/mm/yy)

Update (30/06/06)
- Fixed a bug with Music not playing.

Update (31/07/06)
- Fixed a bug with being unable to set IsGuarded.
- Fixed a bug with "Map already contains a Region with that name" Warning when setting IsGuarded on a region (related to above fix).

Update (10/02/07)
- Fixed a bug with being unable to set NoNPCItemDrop.
- Implemented Irian's suggestion of a CustomGoLocation.

Update (01/03/07)
- Fixed a bug with CustomGoLocation not setting properly/resetting on restart.

__________________
David's Sig is my Sig. He always says it best.

Last edited by tobyjug; 03-01-2007 at 01:58 PM.
tobyjug is offline   Reply With Quote
Old 07-01-2006, 09:09 AM   #3 (permalink)
Forum Novice
 
Prohor Meletevich's Avatar
 
Join Date: Jan 2006
Location: Ashkelon, Israel
Age: 27
Posts: 143
Send a message via ICQ to Prohor Meletevich Send a message via Skype™ to Prohor Meletevich
Default

I have some suggestions for you. For using your regions like an arena another two options would be cool:

1) Move corpse after death to specified location (enqueued with customizable timer)

2) Keep criminal status for all players in region to prevent increasing of kills count.
Prohor Meletevich is offline   Reply With Quote
Old 07-04-2006, 04:23 PM   #4 (permalink)
Forum Novice
 
Join Date: Dec 2004
Age: 16
Posts: 111
Default

Do customs spells work in these areas yet?
Shadow82 is offline   Reply With Quote
Old 07-05-2006, 01:27 AM   #5 (permalink)
Forum Newbie
 
Join Date: Nov 2003
Posts: 41
Default

Is it just me or is there a noticeable problem with the script detecting changes in the z-axis?
It seems in the regioned supp-room I run, on all the stairs (to go upon "gate" platforms(z=5)), the region does not recognize the tiles and thus does not register when people attempt to cast spells that should otherwise be uncastable in said region.
GPXtC02 is offline   Reply With Quote
Old 07-05-2006, 03:09 AM   #6 (permalink)
Forum Expert
 
Join Date: Oct 2004
Location: San Diego, CA
Age: 39
Posts: 281
Send a message via AIM to dracana Send a message via MSN to dracana
Default

Quote:
Originally Posted by GPXtC02
Is it just me or is there a noticeable problem with the script detecting changes in the z-axis?
It seems in the regioned supp-room I run, on all the stairs (to go upon "gate" platforms(z=5)), the region does not recognize the tiles and thus does not register when people attempt to cast spells that should otherwise be uncastable in said region.
yes, I have this problem as well. I tried starting at a low z and ending on top z when adding bounds... this worked on a few areas, but in a couple of my areas, I just can't seem to get it to recoginze every z level
__________________
Dracana
dracana is offline   Reply With Quote
Old 07-14-2006, 10:39 PM   #7 (permalink)
Master of the Internet
 
Anti-Basic's Avatar
 
Join Date: Dec 2005
Age: 20
Posts: 12,927
Default

Quote:
Originally Posted by GPXtC02
Is it just me or is there a noticeable problem with the script detecting changes in the z-axis?
It seems in the regioned supp-room I run, on all the stairs (to go upon "gate" platforms(z=5)), the region does not recognize the tiles and thus does not register when people attempt to cast spells that should otherwise be uncastable in said region.
I am having this as well. When I walk across a bridge that is elevated it leaves the region, when I get to other side, it reenters. Also some of the songs loop, and some dont. Stones (best UO song ever) doesnt loop . Also not all songs are listed. Walking isnt. It also lists some songs that were only avail when the music was MIDI.
__________________
Quote:
Originally Posted by madmadmax3 View Post
I didn't insult anyone dumpass
Anti-Basic is offline   Reply With Quote
Old 07-14-2006, 11:04 PM   #8 (permalink)
Forum Novice
 
Join Date: May 2006
Posts: 260
Default

How come it doesn't work in houses? Atleast custom houses.
Big Cheez-it is offline   Reply With Quote
Old 07-15-2006, 10:50 AM   #9 (permalink)
Forum Expert
 
Icedddragon's Avatar
 
Join Date: May 2005
Age: 18
Posts: 270
Default

because a house is a region itself... therefore the custom region doesnt apply over it.
__________________
Burning Venganc
Icedddragon is offline   Reply With Quote
Old 07-15-2006, 04:56 PM   #10 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: Florida
Age: 33
Posts: 544
Default

The new server uses 3D rectangles instead of 2D so the Z matters for setting the region now and you have to accomodate for that in the script. Hopefully Tobyjug or Asyre will update this properly if you are having these problems.
Avelyn is offline   Reply With Quote
Old 07-15-2006, 07:43 PM   #11 (permalink)
Forum Novice
 
Join Date: May 2006
Posts: 260
Default

Quote:
Originally Posted by Icedddragon
because a house is a region itself... therefore the custom region doesnt apply over it.

Is there a way to get around it some how?
Big Cheez-it is offline   Reply With Quote
Old 07-15-2006, 09:27 PM   #12 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: Florida
Age: 33
Posts: 544
Default

Quote:
Originally Posted by Big Cheez-it
Is there a way to get around it some how?
Yes, but you need to change to default region value of a housing region. If you wish to do this, I believe it's in basehouse.cs somewhere.
Avelyn is offline   Reply With Quote
Old 07-15-2006, 10:22 PM   #13 (permalink)
Forum Expert
 
Draegen's Avatar
 
Join Date: Jun 2006
Posts: 280
Default

feature that would be great that should be added

ghosts cant enter region

please add this as a feature would rock so much
Draegen is offline   Reply With Quote
Old 07-15-2006, 11:32 PM   #14 (permalink)
Master of the Internet
 
Anti-Basic's Avatar
 
Join Date: Dec 2005
Age: 20
Posts: 12,927
Default

Quote:
Originally Posted by Avelyn
Yes, but you need to change to default region value of a housing region. If you wish to do this, I believe it's in basehouse.cs somewhere.
So basically if this is rewritten to fix the z axis problem, it will require a change in a distro file? Or is there an easier way around it?
__________________
Quote:
Originally Posted by madmadmax3 View Post
I didn't insult anyone dumpass
Anti-Basic is offline   Reply With Quote
Old 07-16-2006, 05:14 AM   #15 (permalink)
Forum Expert
 
Draegen's Avatar
 
Join Date: Jun 2006
Posts: 280
Default

problem with this if you make two regions and forget to rename the region it will start throwing a double region error in your consolor and cause server to freeze

like i forgot to change two regions had them both named custom region and it was throwing double region error froze up runuo2.0
Draegen is offline   Reply With Quote
Old 07-17-2006, 07:33 AM   #16 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

Quote:
Originally Posted by Draegen
problem with this if you make two regions and forget to rename the region it will start throwing a double region error in your consolor and cause server to freeze

like i forgot to change two regions had them both named custom region and it was throwing double region error froze up runuo2.0
Hmm that shouldn't happen... I put in code to make sure that two Region Controls can't have the same Region Name. If you can please provide me with steps of how you are able to name them both the same and get the "Map already has a region registered with that name" problem. Will help me to identify if a problem exists in my code.

Quote:
Originally Posted by Anti-Basic
I am having this as well. When I walk across a bridge that is elevated it leaves the region, when I get to other side, it reenters. Also some of the songs loop, and some dont. Stones (best UO song ever) doesnt loop . Also not all songs are listed. Walking isnt. It also lists some songs that were only avail when the music was MIDI.
I'm afraid there's nothing I can do about the music, the enum that holds all of the different Music is declared in the Core, so if you know all the names of the music that should be there it might be worth adding it to the RunUO Bug Tracker to get them added to the enum!?
Also with the songs looping that could only be either a Core or a Client problem, all my code needs to do is send the selected constant from the MusicName enum to the constructor of the region. So the Region.cs in the core takes care of the Music... If you know which songs should loop try some tests to see if they do and if they don't then I think it might be worthwhile to submit it to the RunUO Bug Tracker, I'm sure the Devs could tell u then if its a Core or Client prob.


Quote:
Originally Posted by Avelyn
The new server uses 3D rectangles instead of 2D so the Z matters for setting the region now and you have to accomodate for that in the script. Hopefully Tobyjug or Asyre will update this properly if you are having these problems.
This is correct, the Z values are v. important now and I have allowed for that in my code. For example if you mark out an area on flat land that starts with a Z value of 0 and an end Z value of 0, then if you just use those Z values the region will not work because the region will have no depth. So what my code should do, for the example above, is make it have a start Z value of -1 and an end Z value of +1.
I'm not too sure why there are problems with the Z values, my code should be allowing for it. I would be grateful if people can do some test on places on the normal Map that you have had problems with, then tell me where you have set up the region, how you did it and what problems are occuring. Thanks!
__________________
David's Sig is my Sig. He always says it best.
tobyjug is offline   Reply With Quote
Old 07-17-2006, 11:09 AM   #17 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

Quote:
Originally Posted by Ajax2000
Im having the Z axis problem as well. I flattened out an area for a town that I made, all ground level is 0, and its adding the -1 and +1 just as you say, the problem is if I go upstairs in a building or whatever, I leave the region.
This must be what everyone is doing, you need to choose your Z values very carefully.
I think that when you are drawing out your region you have all been starting on the flat and finishing on the flat so its not counting the variation in Z values.
When it asks you to target the first part of the bounding box you personally need to be at the lowest Z value for that area. Then when targeting the second part of the area you need to personally have your character go to the highest Z value for that area.
__________________
David's Sig is my Sig. He always says it best.
tobyjug is offline   Reply With Quote
Old 07-17-2006, 11:34 AM   #18 (permalink)
 
Ajax2000's Avatar
 
Join Date: Mar 2006
Posts: 97
Default

Quote:
Originally Posted by tobyjug
This must be what everyone is doing, you need to choose your Z values very carefully.
I think that when you are drawing out your region you have all been starting on the flat and finishing on the flat so its not counting the variation in Z values.
When it asks you to target the first part of the bounding box you personally need to be at the lowest Z value for that area. Then when targeting the second part of the area you need to personally have your character go to the highest Z value for that area.
Is there a reason you couldn't just make the region Z say +100 instead of +1 so that buildings and such are taken into account?

I guess Im not clear on the reason you made the z of the region only +1.
Ajax2000 is offline   Reply With Quote
Old 07-17-2006, 11:36 AM   #19 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,764
Send a message via Yahoo to Lord_Greywolf
Default

porblem is that many spots - the corners of the box are not at the lowest and highest points

so what i would do is to temp put in a "tile" at the one corner below ground level and then one at the opposite corner and set it to +30 ground level and target those - then delete them (or make them hidden from players - in case you need to use them again)
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 07-17-2006, 12:11 PM   #20 (permalink)
Forum Expert
 
Join Date: Feb 2004
Age: 27
Posts: 1,834
Default

too much work imo... then I rather change the script to do the same as in normal regions. Set one z sbyte.MinValue and the other sbyte.MaxValue + 1.
Kamuflaro is offline   Reply With Quote
Old 07-17-2006, 01:31 PM   #21 (permalink)
 
Ajax2000's Avatar
 
Join Date: Mar 2006
Posts: 97
Default

I have a question about this.

I was noticing that there is a region priority property.

Does this allow me to place a region within a region and pick which one takes precedence? Or how does this work?

What I would like to do is place a large no housing region, then inside that have a smaller guarded region (for a town), then inside that have a region for an arena with different rules.

Is this possible with the region priority property? If so, how do I set which takes precedence?
Ajax2000 is offline   Reply With Quote
Old 07-17-2006, 03:36 PM   #22 (permalink)
Forum Expert
 
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
Default

Quote:
Originally Posted by Lord_Greywolf
porblem is that many spots - the corners of the box are not at the lowest and highest points

so what i would do is to temp put in a "tile" at the one corner below ground level and then one at the opposite corner and set it to +30 ground level and target those - then delete them (or make them hidden from players - in case you need to use them again)
I agree, it is a good way to do it to make sure you include all the Z values needed.
I'm thinking of making the Rectangle3D in the script a CommandProperty so that on the .props menu you can see it and change the Z values manually, as well as being able to target the region like it is now. Good idea!?

Quote:
Originally Posted by Kamuflaro
too much work imo... then I rather change the script to do the same as in normal regions. Set one z sbyte.MinValue and the other sbyte.MaxValue + 1.
That's also another approach... if you create a region control with a Rectangle2D passed in the constructor this is how it works, so that every Z value for that area is included by setting the start point to the lowest Z and the highest point to the max Z. I don't personally like this approach because it means that you HAVE to include all the Z values for that area, where you might actually want certain heights (or lows) in that area to not be under the influence of the region.

Quote:
Originally Posted by Ajax2000
I have a question about this.

I was noticing that there is a region priority property.

Does this allow me to place a region within a region and pick which one takes precedence? Or how does this work?

What I would like to do is place a large no housing region, then inside that have a smaller guarded region (for a town), then inside that have a region for an arena with different rules.

Is this possible with the region priority property? If so, how do I set which takes precedence?
Yes you can have regions within regions, the precedence is set by the magnitude of the region priority. However two regions can not act together. So if the guarded region had a priority of 20 and the no housing region had a priority of 10, where they overlapped, the no housing region would be ignored because the magnitude of it's priority value is lower than that of the guarded region. For the situation you described above it should work perfectly.
__________________
David's Sig is my Sig. He always says it best.
tobyjug is offline   Reply With Quote
Old 07-17-2006, 03:53 PM   #23 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,764
Send a message via Yahoo to Lord_Greywolf
Default

i like it where you could have a setting to set the z values, instead of it including all z values

this way if you have different levels of a dungeon above and below each other - can have different region names, settings, etc
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 07-17-2006, 04:21 PM   #24 (permalink)
 
Ajax2000's Avatar
 
Join Date: Mar 2006
Posts: 97
Default

Quote:
Originally Posted by tobyjug
I agree, it is a good way to do it to make sure you include all the Z values needed.
I'm thinking of making the Rectangle3D in the script a CommandProperty so that on the .props menu you can see it and change the Z values manually, as well as being able to target the region like it is now. Good idea!?
I would love to be able to adjust the Z manually. I think that would be by far the best option.


Quote:
Originally Posted by tobyjug
Yes you can have regions within regions, the precedence is set by the magnitude of the region priority. However two regions can not act together. So if the guarded region had a priority of 20 and the no housing region had a priority of 10, where they overlapped, the no housing region would be ignored because the magnitude of it's priority value is lower than that of the guarded region. For the situation you described above it should work perfectly.
Excellent! So the higher number takes precedence?
Ajax2000 is offline   Reply With Quote
Old 07-17-2006, 04:51 PM   #