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!

Resource icon

[2.x] List of semi-empty clilocs (7.0.34.6)

_Epila_

Sorceror
_Epila_ submitted a new resource:

List of semi-empty clilocs (7.0.34.6) (version 0) - semi empty clilocs for property list

Since the client does not allow users to use the same cliloc twice on the property list, I've modded my fiddler to search for every semi-empty cliloc
I define semi-empty cliloc every one that can hold a custom text without relevant information

1041522 ~1~~2~~3~
1042971 ~1_NOTHING~
1049150 LEATHER/HIDES(~1_AMT~)
1049644 [~1_stuff~]
1050039 ~1_NUMBER~ ~2_ITEMNAME~
1050045 ~1_PREFIX~~2_NAME~~3_SUFFIX~
1053099 ~1_oretype~ ~2_armortype~
1060451 ~1_skillname~ +~2_val~
1060452 ~1_skillname~ +~2_val~...

Read more about this resource...
 

tindo

Sorceror
Very nice!

Can you give an example of how these are filled with a value in a script?

Something like this?

string ~1_Nothing~ = "New Label";
list.Add(1042971, ~1_Nothing~);
 

_Epila_

Sorceror
Clilocs are localized strings inside the client files used to avoid the language problems, so instead of the developer create a huge internal server task to select the language for every player then send the string to the client, they've compiled every used string into one file for each language (english: Cliloc.enu), so the server only send the string code and is up to the client to find what string to use, and if needed, fill those 'gaps' with some value sent from the server

String 500014
English: That skill cannot be used directly.
German: Diese Fähigkeit kann nicht direkt eingesetzt werden.

String 3000264
English: [Spam detected, speech queued for ~1timeinseconds~ seconds]
German: [Junkmails entdeckt, Text für ~1timeinseconds~ Sekunden angehalten]

They're most used to send (System/Overhead)Messages, property list and localized gumps; every time you see a (6/7)-number length in your scripts, there is a huge change that it is a cliloc string. Most, if not every, RunUO scripts comes with a comment every time that a cliloc string is used, making the reading process easier than having only numbers

The usage is quite simple, you just have to look at your scripts, most of them contains examples of how to use them
Code:
m.SendLocalizedMessage( 1043283, owner.Name ); // I am following ~1_NAME~.
Code:
AddHtmlLocalized( 305, 405, 150, 18, 1061001, LabelColor, false, false ); // ENHANCE ITEM
Code:
public override void GetProperties( ObjectPropertyList list )
        {
            base.GetProperties( list );
 
            if ( m_Running )
            {
                list.Add( 1060742 ); // active
 
                list.Add( 1060656, m_Count.ToString()+@" / "+m_Spawned.Count.ToString() ); // amount to make: ~1_val~
                list.Add( 1061169, m_HomeRange.ToString() ); // range ~1_val~
 
                list.Add( 1060658, "group\t{0}", m_Group ); // ~1_val~: ~2_val~
                list.Add( 1060659, "team\t{0}", m_Team ); // ~1_val~: ~2_val~
 

tindo

Sorceror
Thank you. I knew what cliloc's were and how they are used in the scripts, I was just unclear how you can fill in the value but I think your first example of BaseHire.cs answered that.

When I want to replace the value that comes between the ~ ~, I can just use a comma and supply the variable or string that I want.

Thank you very much, I can see a lot of potential uses!
 

_Epila_

Sorceror
Thank you. I knew what cliloc's were and how they are used in the scripts, I was just unclear how you can fill in the value but I think your first example of BaseHire.cs answered that.

When I want to replace the value that comes between the ~ ~, I can just use a comma and supply the variable or string that I want.

Thank you very much, I can see a lot of potential uses!

It is and isn't just as simple as use a comma and supply the value to replace those tokens/gaps/~~ (whichever you name it), RunUO contains a lot of ways to handle and fill cliloc strings, I suggest you to read RunUO's docs or use VS to script; also clilocs can be filled with others clilocs

Code:
list.Add( 1060658, "group\t{0}", m_Group ); // ~1_val~: ~2_val~
A single string to fill two gaps, each item separated by '\t'
is equivalent to
Code:
list.Add( 1060658, "group", m_Group.ToString() ); // ~1_val~: ~2_val~

----

The number in the beginning of the gap, indicates what is going to fill there

Code:
string args = String.Format("{0}\t{1}\t{2}", from.Name, m_Creature.Name, to.Name);
from.SendLocalizedMessage(1043253, args); // You have transferred your pet to ~3_GETTER~.
to.SendLocalizedMessage(1043252, args); // ~1_NAME~ has transferred the allegiance of ~2_PET_NAME~ to you.

Your string 'args' contains 3 words (could be anything) separated by '\t', in the first case, only the third word will be used. In the second case, the first and second words are going to be used. In both cases, receive a 3-word argument

----

You can fill the gaps with others clilocs too
Code:
string args = string.Format( "#{0}", m_PlantSystem.GetLocalizedHealth() );
list.Add ( 1094702, args ); // ~1_HEALTH~ Sugar Canes
//will be something like: Healthy Sugar Canes
GetLocalizedHealth() will return a number and your 'args' string will look like: #123456
Every string passed as argument that is a '#' followed by a 6-7 digit number will be replaced by another cliloc. I don't know how it will behave if you fill the gap with another cliloc that also contains a gap
 

tindo

Sorceror
That was a HUGE help!

I really appreciate you taking the time to explain it out, that info should be in the tutorials!
 
Top