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 |
Not that I know of.. however, you can script a skill check. Something along the lines of this method:
Code:
if ($text=~/hail/i) { |
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 |
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 |
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 |
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. |
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.
|
@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 |
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. |
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 |
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. |
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! |
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"); Code:
if($langid == 3) { |
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 Code:
Current Language is Elvish. (2) 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 |
Strangely, with Rev492 $langid is now returning 3.
Code:
Welcome to EverQuest! |
All times are GMT -4. The time now is 05:24 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.