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!

FAQ Tutorial: Adding more AccessLevels

Khaz

Knight
Trying, I don't think what you suggest would be gods-awfully hard to do, but if I understand your goal correctly, you want to tag the PlayerMobile, no? I'd say go for it, and I'll see if I can pull up anything my end but please don't hold me to it (lots of stuff on the ToDo list).

I didn't know about the project creator from the Third Party Program forum either. I think it was one of the Announcement topics that I found out about it in. =/ Anyway, that and Project Generation are very promising.

Hopefully I can get that guide updated with some more promising ways of updating the access levels. :rolleyes:
 

Phantom

Knight
A really nice trick you can do is the following:

Make all your Mobiles a Player since that value won't change.

You won't have to do any sort of lame conversion.
 

Khaz

Knight
Ha...ha...

Actually, I'm adapting Outkast's example code and will be testing that later tonight.
 

Trying

Sorceror
Heyyyyyyy now... LOL...! as I said earlier I would`nt have a clue where to start, Sure I can throw in some suggestions, but thats about my limit, though today I must confess I have bent over backwards to help many out on the forums with connection issues etc.. but scripting is something which seems to me takes a life time to learn and one is never able to master... :p

Curiousity and all of that led me to watch this topic with intrest to see where it was going... but as far as scripting anything.. still out of my depth at the moment im afraid...

But to try perhaps cut a corner or two, the idea of having "Tags" rather than altering everything was one of them flash bangs that just pops into our heads from time to time... not sure if it was even do`able and to be honest I expected to be laughed at... :p

Just an idea that may or may not be of any use to anyone that was thinking about perhaps looking at adding levels....
 

Jarrod

Sorceror
I followed the steps to a tee, only modified a skillname and added Developer over Administrator as an access level.

it builds fine, however when i try to start the .exe, it runs through most of the way, but then exits with a windows error.

I assume that its because when i installed the Sharp application, it dropped a 1.0.3705 version of .NET over my 1.1 installation.

Did anyone else have this happen, and should i be able to just remove the 1.0.3705, then reinstall 1.1 without any negative side effects?
 

sirens song

Wanderer
Remove all instances of .Net Just in case somehow you have both installed. Its not likely but it is very well possible. Then reinstall .Net Framework 1.1. This will have no negative side effects what so ever.
-Jamie
 

Crepti

Wanderer
Okay, so here's what I did.

-Followed the above instructions to make an Owner AccessLevel - Compiled with no problems.
-Ran with no problems (fresh world, so to speak).
-It asks me to make an Admin account, I go ahead.

Then, as an admin, I change my AccessLevel to Owner.

Now, if I want to restrict certain commands to Owner, I can't just change AccessLevel.Administrator to AccessLevel.Owner, can I?
Well, I can, but it wouldn't work well... As any Admin I add can easily change their own AccessLevel to Owner.

So how do I stop them from doing this? Is there a way in the source code for it to create an Owner account on a fresh install rather than Admin, and change it so that Admin can't change themselves to Owner?
 

Kamron

Knight
There is a check for the minimum accesslevel requird to change accesslevels.. I am not sure if its the commandproperty attribute of the AccessLevel property, or somewhere else.
 

Khaz

Knight
As Spider said, the check does exist and it is similar to that of the commands.

Around about line 5673 in the core Mobile.cs, you'll find this:
Code:
		[CommandProperty( AccessLevel.Counselor, AccessLevel.Administrator )]
		public AccessLevel AccessLevel
		{
			get
			{
				return m_AccessLevel;
			}
			set
			{
				AccessLevel oldValue = m_AccessLevel;

				if ( oldValue != value )
				{
					m_AccessLevel = value;
					Delta( MobileDelta.Noto );
					InvalidateProperties();

					SendMessage( "Your access level has been changed. You are now {0}.", GetAccessLevelName( value ) );

					ClearScreen();
					SendEverything();

					OnAccessLevelChanged( oldValue );
				}
			}
		}
Change the first line there to reflect your desire.
Code:
[CommandProperty( AccessLevel.Counselor, AccessLevel.Administrator )]
should now become
Code:
[CommandProperty( AccessLevel.Counselor, AccessLevel.Owner )]

I think that's right. If I'm wrong, someone please correct me, but if I remember right this is how I did it on my end.
 

Avelyn

Sorceror
Trying said:
I`m reading this topic with great intrest, but one thing is bugging me, on the official OSI servers, they brought in the companions, as you will well know... but when they brought this in, they had a great number of levels.. this being Companion, Senior companion, Regional senior companion, and Arch companion.. they had a simular structure with the counselors as well, what confuses me here, is that we have 0-4 for access levels, but everyone of the above had different access commands determined by there rank... so am I right in persuming that re-wrote the entire structure and "added" in the companion ranks... or was it a case of a "check" to see what rank they were at and then allowed/dis-allowed certain commands...

Im only curious, about how you would persume they went about this, as I cannot see OSI re-writing the entire structure to add all the above said ranks...

OSI servers are not written in C#. RunUo is an emulator and the devs wrote in what they thought they needed when they did it. On an OSI server a seer is below a GM however on RunUo they are higher. Just because something is on OSI doesn't mean it got coded into RunUo that way. Without seeing the code and the language the OSI servers are written in, it would be hard to say how they did it, but it could be a bit more flexible. Talking to a old OSI Dev at one of the Counselor bashes in Texas years ago they explained to me the servers were written on Unix platforms using a PERL like language on machines set up in tandom (Hense the serverlines).
 

Crepti

Wanderer
Sorry for digging up an old topic, but I was wondering if anyone's gotten any futher with this?

Here my current position:

My Access Levels look like this...
Code:
Player = 0,
Counselor = 1,
GameMaster = 2,
Seer = 3,
Administrator = 4

I've changed them to look like the following:
Code:
Player = 0,
Donator = 1,
Counselor = 2,
GameMaster = 3,
Seer = 4,
Administrator = 5,
God = 6

Now, when I compile and put Server.exe where my old one was, and log in, my Admin character is now a Seer (because Admin was value 4, and now Seer is, correct?).
So, how do I change it so my admin character is either Admin (5) or God (6)? That's the only one I need to change... Once I've changed it, I can do the rest ingame.

Any help? :)

EDIT:
Okay, small edit... I've sorted that problem. I just did a series of compiles, here are the steps I took:
- Created God (5) access level and compiled.
- Set in-game access level to God (5).
- Created Donator access level (1). Access Level God becomes Administrator. Compiled.
- Set in game access level to God (6).
- Changed the part about setting access levels, so only Gods can. Compiled.

Now then... New problem! On the [admin gump, it doesn't acknowledge that the Donator and God access levels are there. For example, where I am, it says "Unknown" for my access level. And where you have the option to change an account's access level (which I was planning to use for setting up Donators), it has neither Donator nor God in the list.

How can I make it recognise the access levels, and include the in the list? :confused:
 

Khaz

Knight
It'd have been quicker to simply make a new character on your head administrator account (automatically an administrator access level character) and then set the accesslevels that way. Nonetheless, good enough the way you did it.

For the admin gump, as well as the who gump, find the scripts for those and change them accordingly. If you go through the code you'll easily find the methods that declare what you need them to, as well as the colors of the names. I think both are located in the Gumps directory.
 

Crepti

Wanderer
I found the Admin gump script and everything on there's working fine now (apart from if I try to set an account to God, it shows me that account's IP addresses instead, but I'll never use set to God anyway :p).

I'll look into the Who gump.

Thanks for your help!
 

Crepti

Wanderer
Hmm, I just noticed something else. My Donators are showing ingame with Purple names, instead of blue. Where can I change this?
 

Khaz

Knight
You want to use a project creator to combine all the Core scripts. Check the 3rd Party Utilities forum for the project creator submissions, and follow the directions there. Once you combine all the Core scripts, load the .prjx or .cmb file into SharpDevelop.
 
Top