Kamras

Member
In the accounthandler.cs there is some options.

I would like to use custom text instead of relying on the collic. I'm not entirely sure how to go about that, does anyone have any suggestions? Below in is the content from accounthandler.cs that I wish to change and use custom descriptions.

Code:
        {
            new CityInfo("New Haven",    "New Haven Bank",    1150168, 3667,    2625,    0),
            new CityInfo("Yew", "The Empath Abbey",    1075072, 633,    858,    0),
            new CityInfo("Minoc", "The Barnacle", 1075073, 2476,    413,    15),
            new CityInfo("Britain",    "The Wayfarer's Inn",    1075074, 1602,    1591,    20),
            new CityInfo("Moonglow",    "The Scholars Inn",    1075075, 4408,    1168,    0),
            new CityInfo("Trinsic",    "The Traveler's Inn",    1075076, 1845,    2745,    0),
            new CityInfo("Jhelom", "The Mercenary Inn",    1075078, 1374,    3826,    0),
            new CityInfo("Skara Brae",    "The Falconer's Inn",    1075079, 618,    2234,    0),
            new CityInfo("Vesper", "The Ironwood Inn",    1075080, 2771,    976,    0)
        };
 
If you edit CityInfo and change the Description property from an int type to a TextDefinition type, you can use both cliloc and string literals when defining new CityInfo() objects.

When you make this change, you will have to change most references to cityInfo.Description to cityInfo.Description.Number or cityInfo.Description.String, depending on the usage context required.

You can also use static TextDefinition methods to short-hand the addition of TextDefinitions to things like Gumps or ObjectPropertyLists.

If you have Vita-Nex: Core installed, you can use cityInfo.Description.GetString() to resolve the cliloc number to its string representation - if the cliloc ID is 0, it will return the String value of the TextDefinition instead.
 
Thank you for your response, to be honestly I'm still a little confused on how I would incorporate vita nex core on this. Could you please give me a small example?
 
So I'm revisiting this issue and still failing to apply the suggestions above, by chance may I receive an example of what the code would look like in the CityInfo?
 
Usually it Ints LabelNumbers like the number after

new CityInfo("Jhelom", "The Mercenary Inn", 1075078<-, 1374, 3826, 0),
| This number is int Label number set as a string

new CityInfo("Jhelom", "The Mercenary Inn", <String Text Here>, 1374, 3826, 0), instead or

new CityInfo("Jhelom", "The Mercenary Inn", "in Felucca", 1374, 3826, 0), othger 3 numbers are the coords to the location
 
I tried the above and got this error during compilation

Code:
Errors:
+ Accounting/AccountHandler.cs:
    CS1502: Line 34: The best overloaded method match for 'Server.Network.CityInfo.CityInfo(string, string, int, int, int, Server.Map)' has some invalid arguments
    CS1503: Line 34: Argument 3: cannot convert from 'string' to 'int'
    CS1503: Line 34: Argument 6: cannot convert from 'int' to 'Server.Map'
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back