|
|||||||
This is a discussion on "Race Restring" in the Top Mud Sites MUD Coding forum : 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.... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#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.
|
|
|
|
#2 |
|
Member
Join Date: Sep 2002
Location: Canada
Posts: 73
![]() |
What exactly do you mean by 'race restring'? What's it supposed to do?
Are you trying to change all the members of one race into another? Or just one member? How is it different from just creating a new race, and then having certain characters change to the new race (for a while maybe). Sorry for dumping so many questions on you, but I think better to come up with correct answers to the right questions. |
|
|
|
|
|
#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.
|
|
|
|
#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. |
|
|
|
|
|
#5 |
|
Posts: n/a
|
yes, i am a loser. I am having issues with putting it in the do_who and do_whois. What line would I put in? tried using if's, but that didn't compile right, and then...grr..help? Also, where do I put it in recycle? that confuses me a little lot. that is why i need help
|
|
|
|
#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.
|
|
|
|
#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. |
|
|
|
|
|
#8 |
|
Posts: n/a
|
thanks, I got it
|
|
![]() |
| 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 |
|
|