Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 01-06-2003, 02:05 AM   #1
Verboden Faction
 
Posts: n/a
Unhappy

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.
  Reply With Quote
Old 01-06-2003, 11:37 PM   #2
jornel
Member
 
Join Date: Sep 2002
Location: Canada
Posts: 73
jornel is on a distinguished road
jornel is offline   Reply With Quote
Old 01-07-2003, 12:24 AM   #3
Verboden Faction
 
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.
  Reply With Quote
Old 01-07-2003, 11:58 AM   #4
Yuki
Member
 
Join Date: Jun 2002
Location: My laptop, my apt, Columbus, Ohio, USA
Posts: 42
Yuki is on a distinguished road
Send a message via ICQ to Yuki
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.
Yuki is offline   Reply With Quote
Old 01-07-2003, 05:45 PM   #5
Verboden Faction
 
Posts: n/a
  Reply With Quote
Old 01-08-2003, 12:07 AM   #6
Verboden Faction
 
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.
  Reply With Quote
Old 01-08-2003, 12:57 AM   #7
Yuki
Member
 
Join Date: Jun 2002
Location: My laptop, my apt, Columbus, Ohio, USA
Posts: 42
Yuki is on a distinguished road
Send a message via ICQ to Yuki
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.
Yuki is offline   Reply With Quote
Old 01-08-2003, 01:00 AM   #8
Verboden Faction
 
Posts: n/a
  Reply With Quote
Reply


Thread Tools


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 04:52 AM.


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