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!

[2.0] Custom Regions in a Box V4.0

[2.0] 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 :D

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.


This Thread is now closed.

For the current release please go to:
http://www.runuo.com/forums/showthread.php?t=70808
 

Lord Neo

Sorceror
:D

Thanks, this has to be one of the most valuable systems for a Administrator to run a shard with. Thanks +++Karma for you

:D
 

Nam01

Wanderer
Error

i am getting this error


Errors:
+ Custom/Event Region/CustomRegion.cs:
CS0115: Line 82: 'Server.Regions.CustomRegion.AllowBenificial(Server.Mobile,
Server.Mobile)': no suitable method found to override

any idea's?
 
Make sure that you are using my version with RunUO 2.0 and NOT RunUO 1.0, AllowBeneficial was one thing that was changed for 2.0 because it was previously spelt wrong.
Make sure that you downloaded my Zip from the bottom of my first post and have extracted the files from there into your Scripts folder.
Make sure to delete the old versions of Custom Regions in a Box if you have already tried to place them into your 2.0 Scripts folder.
 

otimpyre

Sorceror
Thank you

Have been looking for this every day since release of 2.0 THANK YOU! I would put this script as #1 most useful script.
 

otimpyre

Sorceror
It would seem

Would seem music function *broke* Set up a custom region as I have before but, cant get the custom music to play tried many songs tried recall, go, ect and return wont play the selected track as previous 1.0 version did.
 

Sparkin

Sorceror
Oh nice... Was waiting on this one :) I cannot tell ya How much this script is needed.. thanks for updating it +karma

Good job~!!!!
 
otimpyre said:
Would seem music function *broke* Set up a custom region as I have before but, cant get the custom music to play tried many songs tried recall, go, ect and return wont play the selected track as previous 1.0 version did.

Ok Cheers for the report. I admit that I didn't actually test that bit as I've never been a fan of the UO Music :p
I'm afraid that I won't be able to take a look at it till after Wednesday next week either because I'm on holiday for a bit :D
 

Rift

Wanderer
geesh go figure :p ya post this and I just happen to finish the conversion myself only difference mine was still compatible with the 1.0 saves

think I'll take look at yours interested in the new props and to see if my method of keeping it old saves would be feasible here :D
 
Rift said:
geesh go figure :p ya post this and I just happen to finish the conversion myself only difference mine was still compatible with the 1.0 saves

think I'll take look at yours interested in the new props and to see if my method of keeping it old saves would be feasible here :D

Haha sorry, wasn't aware that you were redoing it, should have guessed really. I love this system though so I had to do it.
I have kept the old deserialization, so in theory I see no problems with my version with 1.0 Saves. However in my ideas section at the bottom of my post I have been thinking about writing an export/import command if its not compatible. But I've allowed for the old deser and it should update the old deser to my new system. It hasn't been tested though and from what it looks like most old 1.0 saves seems to be quite obsolete from what I can see... When I tried to put the distro 1.0 save into the distro 2.0 it had a ton of deser errors where it wanted to wipe loads of stuff...
 

Rift

Wanderer
no problem lol maybe I should have waited a few days would have saved me the trouble of redoing it myself lol I originally got mindblocked on it so started on Arya's BattleChess figured that out since ran into same prob I did in box so realized damn thats what I was missin lol.....

as for wipes hmmm thats funny I successfully converted a copy of very customized production shard.........nose deep in over 100 files of changes lol and no wipe :D Lucky I guess this and BattleChess I saved for last lol.
 

Liacs

Sorceror
question: can you deactivate already prefab regions with this? I have to admit I haven't had a good look at it, but I need to get all regions deleted that come with RUNUO.

Thanks for your help!

Lia
 

otimpyre

Sorceror
Ohhhh!!

no problem lol maybe I should have waited a few days would have saved me the trouble of redoing it myself lol I originally got mindblocked on it so started on Arya's BattleChess figured that out since ran into same prob I did in box so realized damn thats what I was missin lol.....

as for wipes hmmm thats funny I successfully converted a copy of very customized production shard.........nose deep in over 100 files of changes lol and no wipe Lucky I guess this and BattleChess I saved for last lol.
Gimme! Gimme! *Eagerly Await BattleChess updates with sweaty palms*. Most awesome script ever in my book. :D
 

ii.

Sorceror
Yea i got a small problem with mine it seems when i go to had a room it leaves out the last row of the bound and then when i add stairs or somthing it doesnt cover anything above z = 1 maybe its just me
 
ii. said:
Yea i got a small problem with mine it seems when i go to had a room it leaves out the last row of the bound and then when i add stairs or somthing it doesnt cover anything above z = 1 maybe its just me

You need to make sure that when you choose the region you start at the lowest z value and then end with the highest z value. So when choosing the region for your stairs you need to target the start of the bounding box at the bottom of the stairs and then target the end of the bounding box at the top of the stairs.
 
Update (30/06/06)
- Fixed a bug with Music not playing.

Please redownload the Zip file at the bottom of the 1st post. CustomRegion.cs need only be replaced, however replacing the other files will not do any harm.​
 
Top