[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  languages!
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

languages!

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Mopop   (115 posts)  [Biography] bio
Date Thu 02 Feb 2006 02:17 AM (UTC)
Message
Hi I removed something where it said all races know common. I do not want all races to know common! Whenever they start the mud they speak common off the bat. I want them to speak the language I have set for them.
See it doesnt even give them thier language at all!

<22hp 100m 110mv> prac
(none)
----------------------------------Skills----------------------------------
(none)
----------------------------------Weapons----------------------------------
(none)
----------------------------------Tongues----------------------------------
You have 2 practice sessions left.

but they do have thier language

<20hp 100m 100mv> lang
mithra

Another strange problem is... well I'll show you.

<20hp 100m 100mv> lang
mithra

speak moomba
You now speak moomba.

<22hp 100m 110mv> lang
mithra

They dont even know the language! Yet they can select it >_<;;; I tried my best to assert the problem before asking for you guys knowledge =P As always I thank you
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Thu 02 Feb 2006 04:22 AM (UTC)
Message
The problem is that common isn't really set up as a language, if I remember correctly. The notion of common is so built into the game, I'm not sure if getting rid of it is a simple matter of removing some stuff.

Just what did you remove? Without knowing what you've done, it's hard to know what could be wrong. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #2 on Thu 02 Feb 2006 04:28 AM (UTC)
Message

/*
    * everyone KNOWS common tongue 
    */
   if( IS_SET( language, LANG_COMMON ) )
      return 100;

  if( ( iLang = skill_lookup( "common" ) ) < 0 )
               bug( "%s", "Nanny: cannot find common language." );
            else
               ch->pcdata->learned[iLang] = 100;


I removed those 2 bits there, I also removed the clan language as well...Dont know if that might mess with anything or not! I dont think it did but yeah.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Thu 02 Feb 2006 05:07 AM (UTC)
Message
Where do those come from?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #4 on Thu 02 Feb 2006 05:07 AM (UTC)
Message
first one is act_comm.c

second is comm.c
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #5 on Thu 02 Feb 2006 05:30 AM (UTC)
Message
I meant, if you could provide a little more context, that would be useful. It's hard to know what the effect of removing lines of code is, if you don't know what they were originally meant to do.

And are you sure that's all you removed?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #6 on Thu 02 Feb 2006 05:37 AM (UTC)
Message
Well I removed everything for LANG_CLAN but how would that mess with I guess is do_speak and nanny setting racial languages?
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #7 on Thu 02 Feb 2006 05:48 AM (UTC)
Message
It'd help if you listed precisely what you did -- you never know... :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #8 on Thu 02 Feb 2006 06:10 AM (UTC)
Message
Well I dont really remember all I removed dealing with LANG_CLAN...

If you could just pin point it maybe? pretty please? Like a diagnostic of where the problem may lie? I am learning so bear with me, I am still reading up lessons online. But I am trying to give it my all heh.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #9 on Thu 02 Feb 2006 08:50 AM (UTC)
Message
Err... how am I supposed to just pin-point where the problem is? :P

Let me make an analogy. You've just bought a very complex car, and are starting to tinker with it to make custom modifications. You do something, and the car stops working. You come to me with the question:
"I did something to the engine, now it's not working anymore. Why not?"

Surely you don't expect me to be able to answer without knowing more about the problem? I'm not being deliberately obtuse in any of this. I honestly have no idea why your code isn't working, and that's why I've been trying to get you to tell me what you've done so that maybe something will shed light on the issue.

At the moment, the problem could be virtually anywhere in between the interpreter and the language functions, passing through nanny and character creation, and the skill system and skill tree. Telling you that is like telling you that the problem lies somewhere in your code.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #10 on Thu 02 Feb 2006 03:00 PM (UTC)
Message
Well then...I showed you what I removed for common. As I said over again I removed everything with LANG_CLAN did I do it right? I have no clue...I heard about using something called CVS to keep track of what you edited. Is there a way to use it on Cygwin? But I will show you where I think the problem may lie.

This is the part of nanny that says its suppose to give it thier racial language and set it to 100

ch->height =
               number_range( ( int )( race_table[ch->race]->height * .9 ), ( int )( race_table[ch->race]->height * 1.1 ) );
            ch->weight =
               number_range( ( int )( race_table[ch->race]->weight * .9 ), ( int )( race_table[ch->race]->weight * 1.1 ) );

            if( ch->Class == CLASS_PALADIN )
               ch->alignment = 1000;

            /* Give them their racial languages */
            if( race_table[ch->race] )
            {
               for( iLang = 0; lang_array[iLang] != LANG_UNKNOWN; iLang++ )
               {
                  if( IS_SET( race_table[ch->race]->language, 1 << iLang ) )
                   {
                     if( ( uLang = skill_lookup( lang_names[iLang] ) ) < 0 )
                        bug( "%s: cannot find racial language [%s].", __FUNCTION__, lang_names[iLang] );
                     else
                        ch->pcdata->learned[uLang] = 100;
                  }
               }
            }


And here is my do_speak


void do_speak( CHAR_DATA * ch, char *argument )
{
   int langs;
   char arg[MAX_INPUT_LENGTH];

   argument = one_argument( argument, arg );

   if( !str_cmp( arg, "all" ) && IS_IMMORTAL( ch ) )
   {
      set_char_color( AT_SAY, ch );
      send_to_char( "Now speaking all languages.\r\n", ch );
      return;
   }
   for( langs = 0; lang_array[langs] != LANG_UNKNOWN; langs++ )
      if( !str_prefix( arg, lang_names[langs] ) )
        {
             if( knows_language( ch, lang_array[langs], ch ) )
            ch->speaking = lang_array[langs];
            set_char_color( AT_SAY, ch );
            ch_printf( ch, "You now speak %s.\r\n", lang_names[langs] );
            return;
         }
   set_char_color( AT_SAY, ch );
   send_to_char( "You do not know that language.\r\n", ch );
}


If there is anything else you need to see let me know. I'm trying my best here lol.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #11 on Thu 02 Feb 2006 03:45 PM (UTC)
Message
I don't know if this is The Problem, but it's probably wrong. From do_speak:
             if( knows_language( ch, lang_array[langs], ch ) )
            ch->speaking = lang_array[langs];
            set_char_color( AT_SAY, ch );
            ch_printf( ch, "You now speak %s.\r\n", lang_names[langs] );
            return;
You probably want a { after the if, and a } after the return.

Otherwise, you will tell the player they're speaking a language, even if they're really not. It looks like you moved around the braces, because the SMAUG source I'm looking at has them correctly.


When the speaking-all case, you did not want to remove ch->speaking = ~LANG_CLAN. That means: ch->speaking = everything but clan.

I know you're learning and all that but maybe you should try starting with something simpler. Since you're not carefully writing down EXACTLY what you changed, you will have a hard time undoing your changes in case you need to. It is possible to use CVS on Cygwin; there is plenty of documentation on how to do that lying around. It's probably overkill at your stage, though.

What you need is to either comment exactly what you do, or to keep original source files around and diff them against your versions.

But, to go back to what I was saying: it'll be a much more rewarding experience for you if you start with something simpler. Learn how the code works, learn what things mean before you start yanking things out and ripping functions apart. It'll be a lot more fun for you, and you'll learn better and a lot faster.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #12 on Thu 02 Feb 2006 05:26 PM (UTC)
Message
Awesome it worked! I hate braces x_x

I must of over looked it when I was comparing the stock code.

Now with the creation of a new character? How would I have it so they get their racial language at the start??
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #13 on Thu 02 Feb 2006 05:39 PM (UTC)
Message
What happens at creation? Do you get a bug message, or...? In other words: how, precisely, do you know that it's not working?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Mopop   (115 posts)  [Biography] bio
Date Reply #14 on Thu 02 Feb 2006 06:23 PM (UTC)
Message
Well at creation there is no bug, but they are set to speak common. Yet they do not know common. Once they go to thier racial language, they cannot go back to speak common. So somewhere at creation is is setting chars to speak common.
[Go to top] top

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.


10,573 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]