PDA

View Full Version : Language understanding



whosursensei
October 14th, 2012, 04:32
I was wondering if there is something that makes it so the GM can set a language to their persona, and itll detect if each person can understand said language? If players cant understand the language they just get gibberish. If the GM doesnt set anything its just common.

If there isnt, this would be something i could really use if someone could point me in the right direction of making it?

Trenloe
October 14th, 2012, 06:24
If you're using the 3.5E/PFRPG or 4E ruleset there are language extensions that do this:

3.5E/PFRPG: https://www.fantasygrounds.com/forums/showthread.php?t=15561
4E: https://www.fantasygrounds.com/forums/showthread.php?t=16723

If you use another ruleset you can use these as your basis for modifying to be compatible with the ruleset - with the original developer's permission of course (if you plan to distribute it - which would be nice for the community).

The main changes would be the language list in extension.xml and the "DB.findNode("charsheet." .. target .. ".languagelist")" code in fontchat.lua that extract all of the languages that the PC speaks from the character sheet.

whosursensei
October 15th, 2012, 02:43
Ok thank you, and for me to install a ext i just put it in extensions in my data folder?

Trenloe
October 15th, 2012, 03:05
Ok thank you, and for me to install a ext i just put it in extensions in my data folder?
Yes, then (if you are running a ruleset which the extension supports) it will be available as an option to select when you start/create your campaign.

Tarostar
October 15th, 2012, 19:32
I'd love to adapt this extension to my ruleset (or as a general extension). It all seems very straight forward, except for "OOBManager.registerOOBMsgHandler".

I have no idea what this is and I can't find any documentation in the reference guide, forums or with google. I kind of get it is something specific to the 3.5/4e rulesets and I'll need to replace it, but that is as far as I get. Can someone tell me how it works or where to look?

Trenloe
October 15th, 2012, 19:43
As this extension is made for the 3.5E or 4E ruleset (depending which one you use) you will need to check the relevant ruleset for the OOB code. Unzip the 4E or 3.5E .PAK file that contains the ruleset to get access to the code and see how to replicate in your ruleset.

What ruleset are you using?

Tarostar
October 15th, 2012, 20:43
As this extension is made for the 3.5E or 4E ruleset (depending which one you use) you will need to check the relevant ruleset for the OOB code. Unzip the 4E or 3.5E .PAK file that contains the ruleset to get access to the code and see how to replicate in your ruleset.

What ruleset are you using?

Ah, now it make sense. Just needed a push to make me realise that this wasn't some new object oriented message handler. Got it working, thanks a bunch for the help and for your work on this brilliant little extension (and not least Tenian for creating it!).

I'm adapting it for Fantasy Dice (see https://www.RadicalApproach.co.uk). I'll share the new version of the extension (with the author's permission of course) once I've released the FD ruleset, for now I'm going to get to work modifying it for the languages in Crimson Exodus, and I might also attempt to do a partial translate for rudimentary knowledge of a language - something like every 2nd or 3rd word perhaps.

damned
October 15th, 2012, 22:13
thats a seriously cool extension!

Tarostar
October 16th, 2012, 13:39
Small question Trenloe if you don't mind. Do you know why the sender does not receive a translated message? I've only had a quick look, but as far as I can see it sends the translated message to everyone, but sender never receives one and I think it is important to be able to check what your wrote. :)

Trenloe
October 16th, 2012, 23:06
Small question Trenloe if you don't mind. Do you know why the sender does not receive a translated message? I've only had a quick look, but as far as I can see it sends the translated message to everyone, but sender never receives one and I think it is important to be able to check what your wrote. :)
It works in the 3.5E(PFRPG) extension I am using. This is a screenshot from a player who typed "/lang Elven Hi There!":

3115

Tarostar
October 18th, 2012, 11:28
It works in the 3.5E(PFRPG) extension I am using. This is a screenshot from a player who typed "/lang Elven Hi There!":

Thanks, I was messing up my implementation of deliverOOBMessage, but it is working now. I've extended it as languages are rated in Fantasy Dice and it now scrambles the translation based on the speaker and receiver's language ability.

This is THE extension that I never knew I always wanted!

Trenloe
October 18th, 2012, 11:42
... and it now scrambles the translation based on the speaker and receiver's language ability.
What kind of scrambling have you done? There's a way for players who don't speak the language to "cheat" and see the translated text in the current extension. I'm not going to say how that can be done here, so sneaky players don't know how... ;) But, scrambling the text would counter this.

damned
October 18th, 2012, 12:55
would this extension work in other rulests - eg Castles&Crusades?

Tarostar
October 18th, 2012, 13:13
What kind of scrambling have you done? There's a way for players who don't speak the language to "cheat" and see the translated text in the current extension. I'm not going to say how that can be done here, so sneaky players don't know how... ;) But, scrambling the text would counter this.

I'm not too concerned about cheating as this is more of an immersion tool, but I guess I might as well scramble the font text to prevent it.

I scramble on a word-per-word basis and if a word is not understood then I just scramble the letters randomly in that word. How much is understood depends on the language skill and is determined in percentage chance to understand each word (percentageUnderstood):


local understands = "";

-- extract the language name which is in brackets as we don't want to scramble that, e.g. (Dwarven)
local prefix_length = string.find(spoken, ")");
if prefix_length then
if prefix_length > 0 then
understands = string.sub(spoken, 1, prefix_length);
spoken = string.sub(spoken, prefix_length + 1);
end
end

-- scramble what is spoken
for word in spoken:gmatch("%w+") do
if math.random(100) < percentageUnderstood then
-- word is understood, just add it to the translated sentence
understands = understands .. " " .. word;
else
-- add a space before next word
understands = understands .. " ";

-- add scrambled letters according to word length
local wordlength = string.len(word);
for i = 1, wordlength do
-- generate a random letter from the alphabet (use decimal so x61 is 91 and add 0 to 25)
local random_character = string.format('%c', 97 + math.random(25));
understands = understands .. random_character;
end
end

end

return understands;

Trenloe
October 22nd, 2012, 20:57
would this extension work in other rulests - eg Castles&Crusades?
The current extension uses the OOB Message functionality that I believe came into the 3.5E and 4E rulesets in 2.9 or 2.9.1 - see https://www.fantasygrounds.com/refdoc/Comm.xcp

The original extension from Tenian uses ChatManager commands to deliver the messages, so you may want to look at that if OOB Messages cannot be used in the C&C ruleset: https://www.fantasygrounds.com/forums/showthread.php?t=12842

You will also need to change where the extension gets the list of languages the PC understands - see post #2 in this thread.