|
||
|
|||||||
| Other Cant find a category above, use this one! Core mods not listed above go here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
I don't want to call this "fix" as the GM: prompt might show up to be something else than a thing for us to enter commands with.
Core Network/PacketHandlers.cs Add the line in red to the MessageType enum: Code:
public enum MessageType
{
Regular = 0x00,
System = 0x01,
Emote = 0x02,
Label = 0x06,
Focus = 0x07,
Whisper = 0x08,
Yell = 0x09,
Spell = 0x0A,
Encoded = 0xC0,
GM = 0x0F,
}
PlayerMobile.cs Add the lines in red to the PlayerMobile class: Code:
public class PlayerMobile : Mobile
{
public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
{
if ( type == MessageType.GM ) // If the message is of type GM
text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
}
|
|
|
|
|
|
#3 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
|
Quote:
Nope, this is a CORE mod
__________________
Quote:
Just a Simple Staff Tool You can leave me messages. Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else." |
||
|
|
|
|
|
#4 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
|
Quote:
BTW thanks ![]()
__________________
Quote:
Just a Simple Staff Tool You can leave me messages. Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else." |
||
|
|
|
|
|
#6 (permalink) |
|
Forum Expert
Join Date: Feb 2004
Age: 27
Posts: 2,047
|
If you're not completely sure on what you're doing, don't modify your core. You could really mess something up if it goes bad. Also, Run UO doesn't support modified cores, so if you did mess something up, you wouldn't get help putting it right again.
|
|
|
|
|
|
#8 (permalink) | |
|
RunUO Developer/Demise Person
Join Date: Mar 2003
Location: California
Age: 20
Posts: 1,700
|
Quote:
![]() (different way than above ofcourse)
__________________
Andre Sayre, Core Developer The RunUO Software Team The day we are born is the day Death inches ever closer... E-mail: ASayre ( AT ) RunUO ( Dot ) c o m I'm as graceful as a gazelle galloping over glistening green grass with it's head on fire. |
|
|
|
|
|
|
#9 (permalink) | |
|
Account Terminated
|
Quote:
|
|
|
|
|
|
|
#10 (permalink) |
|
An Army of One
|
Unless I'm missing something here I have no idea why someone would want to modify the core for this. All you have to do is go into Handlers.cs in the Commands directory and change this line:
Server.Commands.CommandPrefix = "["; All you have to do is change the default "[" to whatever u want the new comand to be. I just changed it to "{" and all is working just fine. Dan
__________________
Proud to serve in the US Army 1988-1992 101st Airborne Desert Shield/Desert Storm |
|
|
|
|
|
#11 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
|
|
|
|
|
|
|
#12 (permalink) |
|
Administrator
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,845
|
Here is a code snippet like the one above that does not require you to modify the core:
Scripts PlayerMobile.cs Add the lines in red to the PlayerMobile class: Code:
public class PlayerMobile : Mobile
{
public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
{
if ( (int)type == 0x0F ) // If the message is of type GM
text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
}
__________________
Zippy, Razor Creator and RunUO Core Developer The RunUO Software Team "Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal." ~The Cryptonomicon |
|
|
|
|
|
#13 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) ) type = MessageType.Regular; |
|
|
|
|
|
|
#15 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
Code:
if ( (int)type == 0x0F ) // If the message is of type GM Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) ) type = MessageType.Regular; Thus, when it arrives to PlayerMobile.DoSpeech the type is 0x00 (RegularSpeech) instead of 0x0F. You need to add the line I wrote into the core to prevent the core from changing type from 0x0F to 0x00. |
|
|
|
|
|
|
#16 (permalink) | |
|
Forum Expert
|
Quote:
Umm dude.. Zippy is a core developer .. why not just say thanks zippy for the assist and let it be.. sheesh
__________________
Do what you want with the women, but let me go :) |
|
|
|
|
|
|
#17 (permalink) | |
|
An Army of One
|
Quote:
Dan
__________________
Proud to serve in the US Army 1988-1992 101st Airborne Desert Shield/Desert Storm |
|
|
|
|
|
|
#18 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
|
|
|
|
|
|
|
#20 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
This is how it looks in the core: Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) ) type = MessageType.Regular; from.Language = lang; from.DoSpeech( text, keywords, type, Utility.ClipDyedHue( hue ) ); |
|
|
|
|
|
|
#22 (permalink) |
|
Join Date: Oct 2002
Age: 22
Posts: 4,689
|
Jakob is right, and Zippy was most likley not paying attention to the code he wrote (since he wanted to shut all of you up).
If you look at the core, the message type handling is done before the DoSpeech is called, therefore Zippy's code would not work. |
|
|
|
|
|
#23 (permalink) | |
|
An Army of One
|
Quote:
Dan
__________________
Proud to serve in the US Army 1988-1992 101st Airborne Desert Shield/Desert Storm |
|
|
|
|
|
|
#24 (permalink) |
|
Guest
Posts: n/a
|
Some of my players went to OSI and got the latest patch, then couldn't use the [chat command (Thank you Knives, we love your system)... and staff that patched wasn't able to pull up either, because the GM thing came up, too.
One of the players came up with an immediate work around. Type a space before you hit the [ and it'll recognize without issue. We haven't had to modify anything more than our typing. |
|
|
|
#25 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 34
Posts: 3,848
|
Quote:
yah but this was posted cause some people didnt like havint to have to add a " " ie Space before the [. Personally I did this mod, but for the most part I dont ask for much help. If I cant fix it right away Ill come up with it eventually, but I also use more then one prefix so fixing it didnt really matter to me. I just dont like when things get broke when its not my fault
__________________
Quote:
Just a Simple Staff Tool You can leave me messages. Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else." |
||
|
|
|