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!

Stuff to try & know when requesting help (Common Problem Solutions).

TMSTKSBK

Lord
Stuff to try & know when requesting help (Common Problem Solutions).

I thought this might be helpful...

Table of Contents:
Preface: Thread Titles
1. Debug Mode & how to use it.
2. How to copy & paste compile errors.
3. Setting up a test server.
4. Interpreting Crash Reports.
5. What to include with a help request.
6. Editing Player Start Locations.
7. Editing Recall/Gate Allowed/Disallowed Regions.
8. FC/FCR Caps and editing them.
9. Disabling Reagents.
10. OMGZ WHERE ARE TEH COMMANDZ??
11. How to create a .cs file
12. How to diagnose a weird connection


Preface: TITLES OF THREADS!

This is in the Forum Rules. But I'm'a say it again.
A thread title such as "I DON'T KNOW WHAT'S GOING ON HELP MEEE!!!!?!?!?!"
does not help. Other examples include "I need help", "Problem", "Bug", "What's this", "EEEEEKK", "new, please help", "I don't know how to script, please help", and others of their ilk.

Make your thread titles MEANINGFUL, like -- "Problem setting up an array." or "Problem with weapon script.", "General question about gumps", "Question about *x*", "Question about *method/function/class/type*"

This way, the people that specialize in that area will see your predicament, and come to your rescue more swiftly!

1. How to run the server in Debug Mode:

Windows XP/2k:
First, get to your command prompt.
In all versions of Windows, there is a Start Menu item called "Run". Click this, and type in "cmd" (no quotes). Then, when the box comes up, type in "cd ../../". Then, type in "cd *your runuo path here*". At that prompt, type in "server.exe -debug". Then, when/if your server crashes, it will spit out a more detailed crash log that will help you find the errors faster.

Windows 9x/ME: (ty, Arvoreen)
If you use Windows 9x or ME, while you will still find Run on the Start menu, I do not believe you can use "cmd". You would need to type "command". cmd comes with Win XP/2K, in older versions it was still "command". XP/2K have "command" still, but it works like crap, "cmd" is the preferred choice. Just thought I'd add that.


2. How to copy and paste compile errors:

In the RunUO window, on the top-left side, there is a button with the RunUO logo on it. Click this button. Scroll to Edit > Mark. Then, use the arrow to highlight all the errors. Hit Enter. The errors are now on your clipboard.


3. How to set up a test server on your machine:

You have two options.
A. (recommended) Copy your working server's directory to another location. In ServerList.cs, change the port to another value (I recommend somewhere in the 5000s, for instance. DO !!NOT!! set the port value to something below 2593. Critical programs use ports below 2593, and it is STRONGLY recommended that you go UP, not down, from there. Why should you do this? Having a copy of the working server ensures that there are no name conflicts when you carry stuff over to the production shard.

B. (compile/test only) Get a new copy of RunUO and unzip it to a different location than your production shard. Change the port in ServerList.cs as outlined above.


4. Interpreting crash reports:

A crash from my system. FIXED said:
Exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayListEnumeratorSimple.MoveNext()
at Server.Items.StatStone.OnDoubleClick(Mobile from)
at Server.Mobile.Use(Item item)
at Server.Network.PacketHandlers.UseReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

A crash report is basically a call stack. It tells you where something went awry. The first entry:

at System.Collections.ArrayListEnumeratorSimple.MoveNext()

is where the crash actually occurred. A Debug Mode crash report will also tell you what line was at fault. The first few lines:

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

Tell you what kind of exception happened, and why. If these make no sense to you, I recommend you speed on over to www.msdn.com and look it up.

5. What to include with a help request:

When you come here to request help, we need information in order to be of any help to you. So, when you request help, Use the CODE TAGS! (which are like this [code ] *****code here ******* [/ code] (minus the spaces)), to put your script in the post. If you have errors, you can post those using the copy/paste error method above in #2.

THEN! That's not all! You need to tell us what is the problem with the script. If there are no errors, tell us what it's not doing correctly. If there are errors, tell us what you've tried to modify. If it's a from scratch script, tell us what you think the problem might be, and the desired solution. [ty, sotho tal ker] Also, it is expedient for you to mark where the problem may lie in the script.

6. Editing Player Start Locations:

Ok. So you want all your players to start at the same location.
Open the file Scripts>Misc>CharacterCreation.cs
Find the phrase "CityInfo".
You should see something like this (~line 655):
Code:
CityInfo city = GetStartLocation( args, young );
//CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

Here, change the lines to look like this:
Code:
//CityInfo city = GetStartLocation( args, young );
CityInfo city = new CityInfo( "Britain", "Sweet Dreams Inn", 1496, 1628, 10, Map.Felucca );

Then edit the CityInfo like this:
String 1 - "Britain" -- Change this to the general region of the location.
String 2 - "Sweet Dreams Inn" -- Change this to the name of the location.
Numbers - 1496, 1628, 10 -- the location's x, y, and z coordinates *in that order*
Map - Map.Felucca -- Change this to whatever map you need this to be. Note that you must prepend "Map.*name*" to the map's name.

7. Editing Recall/Gate Regions Allowed:
In Spells>Base>SpellHelper.cs, at line 460 in an unmodified file, you will see this:

Code:
private static bool[,] m_Rules = new bool[,]
			{
					/*T2A(Fel)		Ilshenar		Wind(Tram),	Wind(Fel),	Dungeons(Fel),	Solen(Tram),	Solen(Fel), CrystalCave(Malas),	Gauntlet(Malas),	Gauntlet(Ferry),	Stronghold */
/* Recall From */	{ false,		true,			true,		false,		false,			true,			false,		false,				false,				false,				true },
/* Recall To */		{ false,		false,			false,		false,		false,			false,			false,		false,				false,				false,				false },
/* Gate From */		{ false,		false,			false,		false,		false,			false,			false,		false,				false,				false,				false },
/* Gate To */		{ false,		false,			false,		false,		false,			false,			false,		false,				false,				false,				false },
/* Mark In */		{ false,		false,			false,		false,		false,			false,			false,		false,				false,				false,				false },
/* Tele From */		{ true,			true,			true,		true,		true,			true,			true,		false,				true,				true,				false },
/* Tele To */		{ true,			true,			true,		true,		true,			true,			true,		false,				true,				false,				false },
			};

This table is what you need to modify. To allow, set to true, to prevent, set to false.

8. FC/FCR Caps & How to Edit Them:
In Spells>Spell.cs, in the GetCastDelay() method (line 588), there is this code:
Code:
int fcMax = 2;

			if ( CastSkill == SkillName.Chivalry && m_Caster.Skills[SkillName.Magery].Value < 70.0 )
				fcMax = 4;

			int fc = AosAttributes.GetValue( m_Caster, AosAttribute.CastSpeed );

			if ( fc > fcMax )
				fc = fcMax;

			if ( ProtectionSpell.Registry.Contains( m_Caster ) )
				fc -= 2;

			int circleDelay = CastDelayCircleScalar * (1 + (int)Circle); // Note: Circle is 0-based so we must offset
			int fcDelay = -(CastDelayFastScalar * fc);

			int delay = CastDelayBase + circleDelay + fcDelay;

			if ( delay < CastDelayMinimum )
				delay = CastDelayMinimum;

You need to edit the "fcMax" to change Faster Casting. Also, on line 586, you need to modify this for FCR:
public virtual int CastDelayMinimum{ get{ return 1; } }. I'm not totally familiar with this method, play around with it to get the desired result.

9. Disabling Reagents:
This is a pretty easy mod. On line 155 in an unmodified Spells>Spell.cs, you will find

Code:
public virtual bool ConsumeReagents()
		{if ( m_Scroll != null || !m_Caster.Player )
				return true;

			if ( AosAttributes.GetValue( m_Caster, AosAttribute.LowerRegCost ) > Utility.Random( 100 ) )
				return true;

			Container pack = m_Caster.Backpack;

			if ( pack == null )
				return false;

			if ( pack.ConsumeTotal( m_Info.Reagents, m_Info.Amounts ) == -1 )
				return true;

			if ( GetType().BaseType == typeof( Spell ) )
			{
				if ( ArcaneGem.ConsumeCharges( m_Caster, 1 + (int)Circle ) )
					return true;
			}

			return false;
		}

Change all this to just:

Code:
public virtual bool ConsumeReagents()
{
	return true;
}

10. What commands are there?
RunUO comes with a file listing all commands available, along with the required access level to use the command. This is in: ~RunUO~>docs>commands.html It behooves you to go read this. If you're really bored, you can read the scripts for them at ~RunUO~>Scripts>Commands.


11. How to create a .cs file:
If creating a file in Notepad, or other basic text editor, you will need to do this:

File>Save As...

Click the bottom pull-down menu that says "Text Document .txt". Change this to "All Files *.*". In the name, put the name you want the file to have, followed by .cs.


12. How to diagnose a weird connection
If you suddenly cannot connect to your shard, after having a working setup for a while, there are a few questions you need to ask yourself:

1. Have I changed anything between me and the outside world?
If you've disconnected/reconnected wires, you may have a new IP address. Especially if you're on a home network with multiple computers. If you do not have a dynamic IP updating software, you will need to reconfigure either your router (on a home network) or UO Gateway (if your global IP has changed).

2. Do I have any new software?
If you've installed something recently, it may be conflicting with RunUO. Try to close whatever program it is and try connecting again.

3. Is my router properly configured?
If your router has a bad port or local IP address, it will not correctly forward to your computer (and thus RunUO) correctly.

4. Can I connect using a "localhost" or 127.0.0.1 IP/servername in UOGateway?
If you can connect doing this, it is not a problem with the server. Somewhere in your network configuration, something is fubar'd.

These are just a few ideas to get you started. There can be other problems.
 

Arvoreen

Sorceror
A lil different in 9x/ME than XP/2K

TMSTKSBK said:
In all versions of Windows, there is a Start Menu item called "Run". Click this, and type in "cmd" (no quotes).

If you use Windows 9x or ME, while you will still find Run on the Start menu, I do not believe you can use "cmd". You would need to type "command". cmd comes with Win XP/2K, in older versions it was still "command". XP/2K have "command" still, but it works like crap, "cmd" is the preferred choice. Just thought I'd add that. :)
 

phoo

Sorceror
Windows Vista/7

Start > All Programs > Accessories > RIGHT CLICK on Command Prompt Icon then LEFT CLICK on "Run as Administrator"
The user access control will prompt you to click continue or yes depending on version.
I know i necroed a several year old sticky thread but hope this helps on newer os versions.
 

Vorspire

Knight
How to run the server in debug mode on all Windows operating systems without the need for using command prompt (directly);

Create a new text file and name it "RunUO_Debug.bat" - make sure the file extension is ".bat" and not ".txt".
Right click and EDIT the batch file, it should open in notepad.

All you have to do now is add one line;
Code:
RunUO.exe -debug
(RunUO.exe may be under another name, like "Server.exe", but you should know this now)

Save the new batch file and close Notepad.
MOVE the batch file to the same folder as RunUO.exe.

Now whenever you need to run your server in debug mode, simply double-click the "RunUO_Debug.bat" file and it will load RunUO in debug mode.

Batch files (*.bat) are a nice quick way to interact with DoS Command Prompt without having to load an instance of Command every time you need to use it.


@Phoo - Necroing thread is fine, if the information you reply with is relevant or a genuine update to the main topic that will definitely help people with current problems, so don't worry about that :)
 
Top