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

Gammon Software Solutions 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?
(New message)
Subject: languages!
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Mopop   (115 posts)  [Biography] bio
Date Sat 04 Feb 2006 03:35 PM (UTC)  quote  ]
Message
I guess I need to do my homework cause I am not sure ;_;
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Fri 03 Feb 2006 04:22 AM (UTC)  quote  ]
Message
Oookkk... tell me then what needs to happen for the character to be speaking their racial language. What data field needs to be set? By now you should have that understanding, and if you don't, you need to do your homework and figure it out. You're doing things hard enough that it's not enough to just go in hacking and slashing and hoping for the best. :)

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 Fri 03 Feb 2006 03:44 AM (UTC)  quote  ]
Message
Ok well I added this back in at comm.c

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


When I made a new char common was highlighted. What I want to happen is thier racial language to be highlighted. And common not to even exsist unless they learn it. Its not showing up on prac also, unless you are an imm I even went into skill.dat and changed all the levels to 1.
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Thu 02 Feb 2006 10:43 PM (UTC)  quote  ]
Message
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1945

This topic may help even though its geared for SWR. If you wish to remove/add a language successfully it will point you to the right files to edit.

Keep in mind you need to create/delete the skill in order for it to work as well.

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 02 Feb 2006 10:29 PM (UTC)  quote  ]
Message
Where what is? The racial language is set to 100 in the very lines of code you showed me.

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 Thu 02 Feb 2006 10:20 PM (UTC)  quote  ]
Message
ugh I greped that and speaking, I looked over comm.c and act_comm.c I dont know where this would be located exactly. Do you know :(? I tried ;_;
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 02 Feb 2006 07:48 PM (UTC)  quote  ]
Message
I think that setting a character to speaking=0 sets them to common. I believe that characters are set to speaking=0 on character creation, which is in the function init_char or something like that.

Basically, when you set their language to 100, you also want to set their speaking field to that same language.

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 Thu 02 Feb 2006 06:23 PM (UTC)  quote  ]
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

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 02 Feb 2006 05:39 PM (UTC)  quote  ]
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 Thu 02 Feb 2006 05:26 PM (UTC)  quote  ]
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   Moderator
Date Thu 02 Feb 2006 03:45 PM (UTC)  quote  ]
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 Thu 02 Feb 2006 03:00 PM (UTC)  quote  ]
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   Moderator
Date Thu 02 Feb 2006 08:50 AM (UTC)  quote  ]
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 Thu 02 Feb 2006 06:10 AM (UTC)  quote  ]
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   Moderator
Date Thu 02 Feb 2006 05:48 AM (UTC)  quote  ]
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

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.


4,947 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]