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]

Reggie

Wanderer
no thats not what a wanna do i dont wanna mix it all i wanna do is to edit a current region with the region controller ingame
 

DarkeWolf

Sorceror
first off, I wanna say that this, along with so many of the others that you've posted, is truely awesome! I just installed it, so I still have some playing to do with it to really learn how to use it. but so far, I have a suggestion or two.

how about adding a property so that the region controller can be set for active/inactive? that way, if we had a region set up that we wanted to use for events, and wanted it under control JUST for those events, it would make it a lot easier, to just turn the region back on, than having to set the region up all over again for the next event.

the music control is cool, and a really nice touch, but it lacks just one thing. an option for no music. like, just adding "none" or "null" to the list.

Very greatly appreciate all of the work that you've put into this one, truely awesome!!!
 

Jtheisen31

Wanderer
I love this script, thank you! I was always wondering how to make "Safe Zones" for Felucca for the people that die from Pking in my shard....i like how you can use one Region Controller for multiple locations ( i have little "safe Zones" around the bank in my shard so people can bank safley :) ) I just dont know what i would do without it.....((by the way, i hope you can make some more great scripts :D
 

Froman2686

Wanderer
I searched this thread for "Music" so if someone else said this, it didn't come up and I apologize.

When tinkering with the music setting of the controller, I've found that the majority of the entries play the same song (that being the one that plays at the UO:3D login screen) and those that play different songs are improperly labeled. It seems to only draw playable songs from the 'digital' folder. I scoured the scripts for a 'music' entry, but was only able to find the part that sets it, not the part that lists it. I would very much like to figure out a solution to this, as I find music to be an integral part of any gaming experience.

This program is great. Keep up the good work.
 

Froman2686

Wanderer
I've been trying to figure out how to control music with this myself...how skilled are you, Hello Kitty? Perhaps we can join forces and figure this out. Let me know.
 
W

walmart

Guest
hmm your right dont have the new music tokuno but this might be hard to fix
 

ASayre

RunUO Developer
walmart said:
hmm your right dont have the new music tokuno but this might be hard to fix

This uses the Core Enum for music. Wehnt he next Version of RunUO comes out, this is automatically adjusts and lets you choose the new music.
 

akrondar

Wanderer
Hey, maybe too late to say thanks, but great script and thanks!!!!! :)

I only have one question, about adding spells.. There is any way to add them without deleting every controller? :)

PS: To create a new region add the controller and then double lcick it, two menus will open, in one you can define the squares of your region, and the other offers you a lot of options to customize your region.. ;) . If you want to modify or add more changes like music and others, just [props the controller (here is the priority of the region by the way :p ) xD
 

Khaz

Knight
Just to bring this back to life...
no, just kidding. I thought I might report an error. With Bushido and Ninjitsu, the server crashes if you try to load the Restrict Skills gump. Just the array list I guess. I'll fix it my end, and post it if no one else has by the time I do.
Code:
Exception:
System.ArgumentOutOfRangeException: Index was out of range.  Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.BitArray.Get(Int32 index)
   at Server.Gumps.RestrictGump..ctor(BitArray ba, RestrictType t)
   at Server.Gumps.RegionControlGump.OnResponse(NetState sender, RelayInfo info)
   at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)
 

A_Li_N

Knight
First let me say ... Lovely system you got here. :)
We had this in on a B36 server with about 30 different regions, and when we updated we got both those crashes (spells and skills) and found that support/updates to fix this without killing the regions is not given (that I could find). So, I devised my own work-around. I will share it here. A warning to you all though, this requires a double replacement of files and 2 restarts of the server :)
I have both Druid and Cleric systems installed and Registered, so I will be basing my regions off of a Spell list count of 700.

So, let's get started...

First, open RestrictGump.cs
Find the two locations that have "100 : 500" (Lines 74 and 90)
Change the 500 to 800.
Save and exit that script.

Next, MAKE A COPY/BACKUP OF YOUR RegionStone.cs
Then, open up the RegionStone.cs
Go to case 1 of the Deserialize method (lines 477-490)

CHANGE :
Code:
				case 1:
				{
					Coords = ReadRect2DArray( reader );
					m_Priority = (CustomRegionPriority) reader.ReadInt();
					m_PlayerLogoutDelay = reader.ReadTimeSpan();

					m_RestrictedSpells = ReadBitArray( reader );
					m_RestrictedSkills = ReadBitArray( reader );
            
					m_Flags = (RegionFlag)reader.ReadInt();

					m_RegionName = reader.ReadString();
					break;
				}

TO :

Code:
				case 1:
				{
					Coords = ReadRect2DArray( reader );
					m_Priority = (CustomRegionPriority) reader.ReadInt();
					m_PlayerLogoutDelay = reader.ReadTimeSpan();
/*Transfering all spells/skills to new BitArray of correct size/locations*/
					BitArray SpellTemp = ReadBitArray( reader );
					BitArray SkillTemp = ReadBitArray( reader );

					m_RestrictedSpells = new BitArray( SpellRegistry.Types.Length );
					m_RestrictedSkills = new BitArray( SkillInfo.Table.Length );

					for( int i = 0; i < SpellTemp.Count; i++ )
					{
[color=blue]						if( i > 400 && i < 413 )
						{
							m_RestrictedSpells[i+200] = SpellTemp[i];
							m_RestrictedSpells[i] = false;
							continue;
						}[/color]
						m_RestrictedSpells[i] = SpellTemp[i];
					}

					for( int i = 0; i < SkillTemp.Count; i++ )
					{
						m_RestrictedSkills[i] = SkillTemp[i];
					}
/*Transfering all spells/skills to new BitArray of correct size/locations*/

					m_Flags = (RegionFlag)reader.ReadInt();

					m_RegionName = reader.ReadString();
					break;
				}

Let me explain the code in Blue...
If your initializer has NOT changed, you do not need this.
If your initializer has changed for addition of new spells, this is where you would set the new numbers as being restricted....(kinda confusing, I know)
My old Cleric spells were registered at 401-412, but the new abilities for SE will be on there, so I had to re-register them at a different number...I chose 601-612. So you see how I changed the bitarray locations with that if statement in blue.
Code:
						if( i > 400 && i < 413 )
						{
							m_RestrictedSpells[i+200] = SpellTemp[i];
							m_RestrictedSpells[i] = false;
							continue;
						}
the numbers in the if statement are the old registry entries. The 200 in m_RestrictedSpells[ i+200 ] is the OFFSET that would make it equal the NEW registry. 401 + 200 = 601.


Once you have done that code to your needs, save and start the server. Find one of your RegionControls and see if you can click on the Restrict Spells AND Restrict Skills button. If you can without a crash, you were successful!

SAVE the server and close it down.
Replace your edited RegionStone.cs with the ORIGINAL one that you backed up and load the server and everything should be dandy!

Hope this helps everyone that has been having crashes!


(Suggests to ASayre8 that this could be avoided by using a different method of storing the values) - aka a new value that stores the name of the spell AND the bool, stored in an ArrayList....(just a quick off-the-top-of-my-head suggestion)

Have fun and good luck everyone!
 

nitewender

Wanderer
I am using runuo 1.0.0, with RC0 everything was fine but now when I click restricted skills in the gump it crashes the server. Is there a fix for this? Thanks!
 

A_Li_N

Knight
nitewender said:
I am using runuo 1.0.0, with RC0 everything was fine but now when I click restricted skills in the gump it crashes the server. Is there a fix for this? Thanks!
Read my post right before yours for something that works.
I think I remember seeing an easier fix somewhere in the support forums. Might try doing a search for it there too.
 
Top