Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 05-07-2009, 12:29 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Question Can NPCs speak in other languages?

Is there any built-in functionality for quest NPCs to speak in /say in languages other than common? Like a quest::sayLang(12, "Hey, $name! I'm speaking in Elder Elvish!"); ? Players who were fluent in the language would see it properly, but others nearby would see a garbled message just like players speaking in unfamiliar tongues.

Also, on a related note, I know in EQLive there was at least one quest where the NPC only responded when spoken to in the proper language (Elder Dragon, I think it was). Is there currently any way for a quest script in EVENT_SAY to determine what language the player was speaking when they spoke?

Thanks in advance!

- Shendare
Reply With Quote
  #2  
Old 05-07-2009, 06:45 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Not that I know of.. however, you can script a skill check. Something along the lines of this method:

Code:
if ($text=~/hail/i) {
  if ($client->GetSkill(XX) > 50) {
    quest::say("Your skill is above 50, so you can understand me.");
  }
  else {
    quest::say("Gjoiwjf hoiaw oihaf 28? oi ahwue whiuhaw wewe=");
  }
}
Reply With Quote
  #3  
Old 05-07-2009, 09:49 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Thanks for the reply!

Yeah, when I couldn't find any built-in support for NPC languages after searching high and low, I had actually gone so far as to start putting together a full-on Perl-based speech scrambling system checking language skill and scrambling the text word by word based on (skill / 100) times word complexity based on each letter's frequency of use in English, ord() numeric hashes by each character for consistency instead of randomness, supporting different vocal sounds for different languages so each language would have its own distinct gibberish sound, etc. It was feeling pretty impressive!

Then I realized that if the NPC simply does a quest::say('Blah blah'), other players nearby who DO speak the language will get the scrambled message as well, even though it was only the player interacting with the NPC who didn't know the language (and vice-versa, those without the language could perfectly hear what the NPC said as long as someone else was talking to them).

So, I figured I'd use Client->Message, so that only the speaker got the language-based speech, but then everyone else around is going to be hearing a one-sided conversation, as though hearing someone talk on their cell phone. "Hail, NPC!" "What tasks?" "What Sword of Ultimate Power?"

So I thought maybe I could have the NPC check for all nearby players and do a skill check on each of them, sending a customized scrambled message to each one individually, but at that point I threw my hands up in the air and gave it up as a poor solution.

Even if I could manage to put it together somehow with the EntityList and Client classes and such, I'd basically be graduating from "a lot of work" to "completely reinventing the wheel on the Emu server's /say code" in order to do it, and it would probably take way too much server CPU power when you ended up with several dozen players interacting with NPCs, and just being near NPCs while others are interacting with them.

So, I came back to the forums hoping that either:

1) The functionality is already there, it's just not often used, so it isn't in the regular helpful tutorials and posts scattered around.

2) It's not there, but it shouldn't be too difficult to implement, and a Dev might be willing to look into it (related: is there any way to bribe a dev?).

But perhaps it would most likely end up being a third option.

3) Devs have their own tasks to work on. If you want the functionality added to the emulator then figure out SVN, check stuff out, and dig into the source code yourself to see what you can come up with.

The list ends up being in ascending order of how long it would likely end up taking to be able to get it working. LOL.

- Shendare
Reply With Quote
  #4  
Old 05-07-2009, 10:41 AM
jellyini
Fire Beetle
 
Join Date: Apr 2009
Location: ABQ
Posts: 28
Default

As I recall the frequency of the one-sided conversation was pretty high on live. i remember standing there wondering just what the heck was going on, and checked my chat log to see this or wingnut talking to themselves (like using /s when you mean to use/g or/t) or what. Sounds like your simplest bet.

J
__________________
Now and then we had a hope that if we lived and were good, God would permit us to be pirates.
- Life on the Mississippi

"And don't they wear the bulliest clothes! Oh no! All gold and silver and di'monds," said Joe, with enthusiasm.
- The Adventures of Tom Sawyer
Reply With Quote
  #5  
Old 05-07-2009, 11:03 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Perhaps, but for the sake of real Norrathian flavour, I'll probably end up going with #3 if #2 doesn't work out.

If I get a definitive "There is no current way to do that" answer, I'll try posting in the Feature Request forum and see what response I receive.

Thanks for the input!

- Shendare
Reply With Quote
  #6  
Old 05-07-2009, 11:03 AM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

hehe, just add this

quest::emote("whispers softly to $name.);

and then on the next one put something like

quest::emote("motions for $name to lower his voice and resumes whispering.");

and then lastly

quest::emote("rolls her eys in disgust and whispers gruffly.");

AR PEE and problem solved, win win! That way they look less silly and it still fits.
Reply With Quote
  #7  
Old 05-07-2009, 11:14 AM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

If no one beats me to it, I'll take a look at this and try to get some functions in over the next day or two. It'll just depend on how much work interferes with life.
Reply With Quote
  #8  
Old 05-07-2009, 11:29 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

@Dibalamin ... :P

@realityincarnate...

That's awesome! You mean you're a coder looking into adding something like a quest::sayLang() and a $lang export indicating the languageid being spoken by the player?

- Shendare
Reply With Quote
  #9  
Old 05-09-2009, 01:29 AM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

I finally got a chance to work on the language stuff a bit. Here's what I've got at the moment, tell me if it seems like what you need:

quest::say() is modified to take an optional second parameter that determines the language spoken. So quest::say("I'm speaking elvish", 3) would indeed be said in elvish. The only downsides are that anything with a language given (even if it's a zero for common) uses the regular say channel, so it won't trigger quest journalling and it is subject to client filters.

The events SAY, AGGRO_SAY, and PROXIMITY_SAY all export a variable $langid that holds the number of the language spoken by the player.

The players language skill is accessable (and always has been) through the $client->GetLanguageSkill() function.

I'd like to do some more testing before I commit, but if everything works well and this is what you're looking for, I'll add it in tomorrow.
Reply With Quote
  #10  
Old 05-09-2009, 01:45 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

That's phenomenal! The hard work is so much appreciated!

So nearby players who don't speak the language will get a regular garbled "Soandso says in an unknown tongue, 'Abweioa ford julkani spevna.'", while those who do will see the original intended message?

- Shendare
Reply With Quote
  #11  
Old 05-09-2009, 02:29 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

That's correct, it will appear garbled based on the player's skill, just as if another player had spoken it.

The functions are now in the SVN source as of revision 488.
Reply With Quote
  #12  
Old 05-10-2009, 12:44 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Bug Report: $langid always returns 0. We know it's exporting, at least, because it's returning 0 and not undef.

The speaking part is working flawlessly, however!
Reply With Quote
  #13  
Old 05-10-2009, 08:29 AM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

Could you give me an example of how you're using $langid? It seems to work fine for me, but my only tests have been simple things like
Code:
quest::say("Your language id is $langid");
and
Code:
if($langid == 3) {
type things.
Reply With Quote
  #14  
Old 05-10-2009, 01:04 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

I'm really sorry. It was just as I was drifting to sleep last night that I realized, "Bonehead! I didn't give him anything to go on beyond 'It's not working'!"

At any rate, this is my little test .pl file:

felwithea/Exterminator_Valern.pl
Code:
# Exterminator Valern, felwithea

sub EVENT_SAY
{
  my $langName = (
    !defined($langid) ? 'undefined' :
    ($langid < 0) ? 'undefined' :
    ($langid > 26) ? 'undefined' :
    ('Common Tongue', 'Barbarian'   , 'Erudian'    , 'Elvish'      , 'Dark Elvish' , 'Dwarvish'   , 'Troll'   , 'Ogre'          , 'Gnomish',             # 00 - 08
     'Halfling'     , 'Thieves Cant', 'Old Erudian', 'Elder Elvish', 'Froglok'     , 'Goblin'     , 'Gnoll'   , 'Combine Tongue', 'Elder Teir`dal',      # 09 - 17
     'Lizardman'    , 'Orcish'      , 'Faerie'     , 'Dragon'      , 'Elder Dragon', 'Dark Speech', 'Vah Shir', 'Unknown1'      , 'Unknown2')[$langid]); # 18 - 26

  quest::say("Hail, $name! You're speaking $langName ( $langid )!", 3);
}
And this is what I get:

Code:
Current Language is Elvish. (2)
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Common Tongue ( 0 )!'
Current Language is Elder Elvish. (4)
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Common Tongue ( 0 )!'
Current Language is Common Tongue. (1)
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Common Tongue ( 0 )!'
I tried with both the SoF and Titanium client, in case it was an SoF packet thing. Sorry again for the lack of information earlier!

I can try downloading and compiling the most recent rev and trying again. I believe it was Rev488 that I compiled for this run.

- Shendare
Reply With Quote
  #15  
Old 05-10-2009, 01:38 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

Strangely, with Rev492 $langid is now returning 3.

Code:
Welcome to EverQuest!
You have entered Northern Felwithe.
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Elvish ( 3 )!'
Current Language is Common Tongue. (1)
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Elvish ( 3 )!'
Current Language is Elvish. (2)
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Elvish ( 3 )!'
You say, '#reloadqst'
Clearing quest memory cache.
Current Language is Elder Elvish. (4)
You say, 'Hail, Exterminator Valern'
Exterminator Valern says, in Elvish, 'Hail, Palren! You're speaking Elvish ( 3 )!'
Changing the NPC's spoken language didn't change the $langid behavior, either.
Reply With Quote
Reply


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

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

Forum Jump

   

All times are GMT -4. The time now is 01:18 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3