Top Mud Sites Forum Return to TopMudSites.com
  Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Read-only archive
The Top Mud Sites forum is closed.
Posting, registration and logins are disabled.

 
Old 05-06-2003, 03:06 PM   #1
Verboden Faction
 
Posts: n/a
When I change someone's title using string title, or any other means, the title resets when they level up. I have looked at the code, and can't seem to find where it does that. I still want it to change when they level up if it's not a custom title, but if an immortal changes the title, i want it to stay.

[code]
[60 HUM INV] [KNIGHT] Sir Veratio L'Anel the Invoker
[/quote]
but I changed the title to
[code]
[60 HUM INV] [KNIGHT] Sir Veratio L'Anel the
[/quote]
but when I level, it changes to the title of the next level, and doesn't keep the one I set. But if I don't change my title, i want it to change with the levels, but not reset when I set it myself.
 
Old 05-06-2003, 03:19 PM   #2
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Question

Grep for 'title' or whatever the variable that contains the title is called in your sources. Excluding the database operations, look where it is set. Bonus points if you see a reference to a table that contains 'the Invoker' or whatever level-based titles your mud has. Simply jump around setting the title in this place if their title is not one that was set by them levelling up (i.e., it's not in the table of level titles).
 
Old 05-11-2003, 08:50 PM   #3
Verboden Faction
 
Posts: n/a
yea, couldn't find that
 
Old 05-12-2003, 07:09 AM   #4
Yui Unifex
Senior Member
 
Join Date: Apr 2002
Location: Florida
Posts: 323
Yui Unifex is on a distinguished road
Question

You couldn't find grep? Or were you unable to do grep title *.c? Is the title named something differently? You can easily find the exact name in whatever command sets it (do_title?), of course. If you are indeed grepping for the correct variable name, then your being unable to find it is simply a result of your not trying hard enough =). You can probably cross-reference your search by grepping for a string that is only output to the player when he levels up.
 
Old 05-15-2003, 10:33 PM   #5
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Unhappy

Assuming you find the location in code where it sets the title...

a bit of a hack, but you could have a plr flag that toggles if their title is set by an immortal, or not, then you could use the same data in the struct to store it, but if it is set by an immortal, then handle it differently (maybe a control code to mark the end of the static part of the title?)

alternatively you could write a parser for their title string, if they have a string set, look for control codes and replace them with appropriate information (same as is done for colour codes) eg: &sC -> class
[code] title L'Anel the &sC[/quote]
could then pase that string and when it finds an occurance of &s (I use & for colour codes, but do not have a code for s, but the control code is up to you) look at the next char and react based on that, ie: [code] case 'C';
  // insert into string (possibly the middle so there are some extra issues here) class_title[GET_CLASS(ch)];[/quote]

resulting in...
[code] 60 HUM INV] [KNIGHT] Sir Veratio [B]L'Anel the Invoker[/B][/quote]

You just have to remember that string operations can be computationaly(sp?) expensive.
 



Title reset - Similar Threads
Thread Thread Starter Forum Replies Last Post
OtherSpace: Arc XVIII title announced Brody Advertising for Players 0 12-03-2003 09:15 AM
Next reset time Cogline Bugs and Suggestions 1 10-02-2002 12:57 PM


All times are GMT -4.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022