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!

Adding Hue to [ this.say( "Text"()) ]

Sareus

Squire
Hello Sareus again Been floating around reading up a lot of some of the problems others have had and have gotten close to an answer for what I set out to accomplish today.

Im editing my BaseCreature so that the OnBeforeDeath string will reward players Artifacts based on a edited and reformatted KillerBeeZ system. The problem Im encountering is:

Code:
public override bool OnBeforeDeath()
        {
                      if (Fame <= 95000)
                {
                    int roll = Utility.Random( 10 );
                    if ( roll == 0 )
                        {
                            switch ( Utility.Random( 2 ))
                                {
                                    case 0: PackItem( new SnowGlobeOne ());
                                    this.Say( 1366, "You recieved a Snowglobe for your Valor!");
                                    this.PlaySound( Utility.RandomList( 0x64F ) );
                                    break;
                                    case 1: PackItem( new SnowGlobeTwo ());
                                    this.Say( 1366, "You recieved a Snowglobe for your Valor!");
                                    this.PlaySound( Utility.RandomList( 0x64F ) );
                                    break;
                                }
                        }
                    else // all other rolls *common*

The problem is Whenever Anything returns with the message Im getting the following error:

Alistair: Error (MegaCliloc) : Stringid Not Found : "Hue#"
Where Hue# = The HueID in the script being called.


I realize my problem is Im not using the proper Argument so would anyone like to give me a hand?:cool:
 

pooka01

Sorceror
npcs and player have a "speech hue" property, so thing.say says something of that color.
Avoi using "say" to do a message that is only for the player, as everyone around will see "you received...".

instead use the OverheadMessage, you can set the color and specify the speech.


Also, you are right, this is not the right argument.
It first see numbers so it takes in consideration that it is a cliloc number.
Tried moving the color after the text just to see?
 

Dian

Sorceror
Like pooka01 said, the.. this.say method is not what you want to use.
The PublicOverheadMessage is what you would want..
There are several different 'overloads' that you can choose from, but you would be most likely using one of those 6, like the following.

PublicOverheadMessage(MessageType type, int Hue, bool ascii, string text )

example;
this.PublicOverheadMessage(MessageType.Regular, 0x40, false, "hello world");

I dont know what color 0x40 is, but you get the idea. All you need to change is the 0x40 (whatever color hue number you like) and the text.
 

pooka01

Sorceror
The only problem is: players complaining about their hue speech constantly being changed without their conscent?
Dian's answer is the right one to use, as it won't mess with the players.
 

Mortis

Knight
Whatever. Overhead messages and player speech look the same to me in game. Words above my head.
To me both what Dian posted and I posted would look the same to me in game.

Just thought I would post an option. People can choose which one they prefer. Or use both depending on what they are trying to accomplish.

I have only used what I posted in a mob's script.
 

Sareus

Squire
Like pooka01 said, the.. this.say method is not what you want to use.
The PublicOverheadMessage is what you would want..
There are several different 'overloads' that you can choose from, but you would be most likely using one of those 6, like the following.

PublicOverheadMessage(MessageType type, int Hue, bool ascii, string text )

example;
this.PublicOverheadMessage(MessageType.Regular, 0x40, false, "hello world");

I dont know what color 0x40 is, but you get the idea. All you need to change is the 0x40 (whatever color hue number you like) and the text.

Thank You Beyond measure this fixed the problem, Ive been going crazy messing with customs maps that I forgot to post a reply. :confused:

You can use
Code:
 this.Say( "Die you scum" );
If you put above it
Code:
SpeechHue = 32;
32 is red.


This is actually helpful for something else Im coding so thank you as well! :cool:
 

Dian

Sorceror
Glad it worked out for you, and thanks for responding :) It is a little disappointing when help is given, and an OP does not respond afterwards, so thank you. Not that I loose any sleep over it, lol. But it does make helping people out a little more rewarding when at least a thank you is given, or status of the issue is given ;)
 
Top