All it did was give lizardmen the common language again, so the ch->race == RACE_LIZARDMAN is the needed check to remove the common language right off the bat. Attempting now to see how to set practicing languages based on race, not on having the tongue in a class file. Thanks anyways guys. :)
-Toy the Grateful
It's always good to know how far you are willing to go to be the best...
Actually, because you have the return in the lizardman check, if they are a lizardman and it is common, it will return 0, and just stop there, not dropping down to set everyone else to common.
Actually, with that setup I think you still get lizardmen learning common because the common language is set to 100 *after* being set to 0 for lizards.
Try
if ( ch->race != RACE_LIZARDMAN && IS_SET(language, LANG_COMMON) )
for that last check and destroy the existing lizardman check where the language is set to 0.
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Thanks Nick, you were right. I totally overlooked act_comm.c. I was able to get it so Lizardmen can only use the reptile language with this:
if ( !IS_NPC(ch) && IS_IMMORTAL(ch) )
return 100;
if ( IS_NPC(ch) && !ch->speaks ) /* No langs = knows all for npcs */
return 100;
if ( IS_NPC(ch) && IS_SET(ch->speaks, (language & ~LANG_CLAN)) )
return 100;
/* Make so Lizardman cannot learn common */
if ( ch->race == RACE_LIZARDMAN && IS_SET(language, LANG_COMMON) )
return 0;
/* everyone but Lizardman KNOWS common tongue */
if ( IS_SET(language, LANG_COMMON) )
return 100;
Thanks.
-Toy
It's always good to know how far you are willing to go to be the best...
Try using 'grep common *.c' - this is what I found ...
/*
* Language support functions. -- Altrag
* 07/01/96
*
* Modified to return how well the language is known 04/04/98 - Thoric
* Currently returns 100% for known languages... but should really return
* a number based on player's wisdom (maybe 50+((25-wisdom)*2) ?)
*/
int knows_language( CHAR_DATA *ch, int language, CHAR_DATA *cch )
{
sh_int sn;
if ( !IS_NPC(ch) && IS_IMMORTAL(ch) )
return 100;
if ( IS_NPC(ch) && !ch->speaks ) /* No langs = knows all for npcs */
return 100;
if ( IS_NPC(ch) && IS_SET(ch->speaks, (language & ~LANG_CLAN)) )
return 100;
/* everyone KNOWS common tongue */
if ( IS_SET(language, LANG_COMMON) )
return 100;
Doh.. I seriously need to keep an eye on how I word things. I was creating the character and getting common still, not just loggin in. ;p
And I removed the second ifcheck, as per your advice. Still, however, the lizardman race still gets both the common and reptile language. This is how the code looks now for nanny:
if ( (iLang = skill_lookup( "common" )) < 0 )
bug( "Nanny: cannot find common language." );
else
/* Added so Lizardmen could not use common - Toy*/
if ( ch->race == RACE_LIZARDMAN )
ch->pcdata->learned[iLang] = 0;
else
ch->pcdata->learned[iLang] = 100;
for ( iLang = 0; lang_array[iLang] != LANG_UNKNOWN; iLang++ )
if ( lang_array[iLang] == race_table[ch->race]->language )
break;
if ( lang_array[iLang] == LANG_UNKNOWN )
bug( "Nanny: invalid racial language." );
else
{
if ( (iLang = skill_lookup( lang_names[iLang] )) < 0 )
bug( "Nanny: cannot find racial language." );
else
ch->pcdata->learned[iLang] = 100;
Any other reasons anyone can think of on why it's still giving the common language?
-Toy
It's always good to know how far you are willing to go to be the best...
Amended on Fri 05 Mar 2004 10:04 PM (UTC) by David Haley
Message
a) If I'm not mistaken that code is run upon character creation, not character login, so you can't test it by just logging in
b) By adding in the second ifcheck to the racial section, you just made sure that Lizardmen don't get ANY language - and especially, not their racial one.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
For one, just put an ifcheck that doesn't set it to 100% if the player race is lizardman.
I also don't think that languages naturally get better with time as you use them (unlike skills), but that could be something we changed on my MUD a long time ago and I forgot about.
What those lines are doing is as simple as looking up the skill number associated with "common" language, if that is smaller than zero report an error, else, set the player's language level to 100.
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
Hmm, I see what you're saying about that bit of code giving all players their natural language plus the common language. What I'm looking to do is this:
The race wood-elf has the natural language Sylvan plus common to start. The bit number for the language is 128. Say I want to have wood-elf's also know the Pixie langauge, bit number 8, right from the start, but instead of having it at 100% like common starts at, I'd like it to be 20%, making the player have to practice using it to get it right through normal talking.
Also, I have a Lizardman race who's intelligence is too low to understand anything but their own. So I need to set up an IF check to make sure that the Lizardmen don't learn common right off the bat. What confuses me if this line though:
I've been looking over the class files, and I've noticed that the languages you can practice are based on your class. I'm looking to change that, so certain races will be able to speak different langauges right from the start. I peeked in comm.c and noticed that nanny handles giving the common language to all characters in this bit:
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.