01-06-2003, 02:05 AM | #1 |
Posts: n/a
|
ok, I need help. I need a snippet for race restring. I use rom2b4. I have color and OLC already in it if that helps. But I need race restring for some major RP. Thanks.
|
01-06-2003, 11:37 PM | #2 |
Member
Join Date: Sep 2002
Location: Canada
Posts: 73
|
|
01-07-2003, 12:24 AM | #3 |
Posts: n/a
|
race restring, what it does is make the race that is read in the who list different from the race a person really is. it's a command in a lot of muds. in score, a person is still elf, but on the who list, it'll say Boogie if I set it to that and it fits in the maximum string on the list. but only that person has it restrung.
|
01-07-2003, 11:58 AM | #4 |
Member
|
Put a new char pointer into pcdata, or chardata, depending which you know to do better.
char *raceRestring; Then in the do_who method, if your raceRestring isn't NULL and isn't "", have it print that instead of the actual race. Make a command to change it, and add raceRestring into save.c and recycle.c where needed. Fairly simple. |
01-07-2003, 05:45 PM | #5 |
Posts: n/a
|
|
01-08-2003, 12:07 AM | #6 |
Posts: n/a
|
rar, ok, i did it all, but i need help with the line in the do_who function, otherwise I got it. I need it to read what is in the pfile for raceR and put that in the place for race in the who list. But if that field is blank or doesn't exist, then it just uses the real race of the person.
|
01-08-2003, 12:57 AM | #7 |
Member
|
do_who I'm sure goes something like this:
sprintf(buf, "[%13s] %s%s", ...) or something like that. Of course, my do_who code is far-modified, so what you do is find the thing that is producing the string in the brackets, and change it. I can't remember what the name of it was, but I recall it being something like class or something, it's been years. Anyhow, it's what all the immortal titles are set to, so find that, then at the end where it is being added in... say the name of the variable is whoString... and your raceString is called raceString... put something akin to this right into the code... raceString == NULL || raceString[0] = '\0' ? ch->pcdata->raceString : whoString If that makes no sense to you, you shouldn't be coding yet. Grab a book on C++, read the first 4-5 chapters, don't bother reading about classes (stop right before it) then go back to mud coding. Get a book for reference. There's a snippet for this out there too, I'm sure. Kyndig.org I think has tons of snippets. I can't actually code it for you without looking at the stock rom code, which I really don't want to do... as for recycle.c, whenever you add in a string you should free the memory for it. |
01-08-2003, 01:00 AM | #8 |
Posts: n/a
|
|
Race Restring - Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Most interesting race you've played? | Brody | Roleplaying and Storytelling | 16 | 07-31-2005 05:45 PM |
Alternative race system | KaVir | Advanced MUD Concepts | 3 | 12-04-2004 08:00 AM |
Favourite race? | Santrilla | Tavern of the Blue Hand | 9 | 09-29-2002 12:45 AM |
It's a race! It's a race! | Enzo | Tavern of the Blue Hand | 15 | 08-24-2002 10:03 AM |
What race do you prefer? | Dionae | Tavern of the Blue Hand | 24 | 08-02-2002 10:40 AM |
|
|