Thread: Title reset
View Single Post
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.
karlan is offline   Reply With Quote