Senior Member
Join Date: Feb 2017
Posts: 119
|
Unfortunately, I haven't been able to find enough documentation on Configurables to figure out if what I'm trying to do is even possible.
Our group was discussing that putting a point in Linguistics gives you a language, but your understand of that language might be more rudimentary. While in this state, you might need some Linguistics checks to see if you understand it correctly or can communicate your idea properly. Taking the language a second time would grant mastery/fluency in that language. So what I envisioned is this: A Configurable with 2 list selections: Rudimentary Languages and Fluent Languages. A combination between INT bonus and Linguistic ranks would determine the number of 'Language Points' you have. You could either 'spend' that language point learning the fundamentals of a new language or upgrading a Rudimentary Language to Fluency. So the first selection should be all languages not already selected and the second one should be the selection list from the first selection. I created a configurable, but since everything on there is abilities, it doesn't seem to want to show languages as an option (my candidate expression returns no results for Component.BaseLang). Can anyone point me in the direction of the magic juju for Configurables or offer a suggested better way to accomplish what I described? |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Configurables do have a table devoted to adding languages, but just one. Is your intention to cut out adding languages on the background (starting languages) and personal (for linguistic ranks learned languages) completely?
If so, I would zero those out entirely (IIRC the totals for starting and learned languages are stored in herofields) then create a configurable which had two tables. The language table to choose whichever languages you like, and an ability table to add any number of copies of a single pick. The Single Pick would have a selector to choose among languages, and the Helper.Incrementer tag (which will show an incrementer for you to decide how many of your Language Points are spent toward the chosen language. It would also have an eval script to alter the livename of the chosen language, based on the value of the increenter, to append either "Rudimentary" or "Fluent" |
#2 |
Senior Member
Join Date: Feb 2017
Posts: 119
|
Your tips gave me a way to go after this. I created the configurable for Languages and an ability called Language Picker. Language Picker has a drop down to select a language, and an incrementer (the exact tag is Helper.Increment since it was made when the limit was still 10 characters). I've got an eval script that loops through all picks and totals the incrementers to set that value for cfgSpent1. I have another eval script that grabs herofield[tLangsSta].value and herofield[tLangsSpk].value, sets cfgMax1 to the sum of those values, then zeros them out. So high INT and points in Linguistics shift selections to the Languages tab.
Now I'm trying to figure out how to resolve automatically added languages. Example: certain human heritages will grant the regional language; elves, dwarfs, etc get their native language; druids get Druidic. Ideally, I could programmatically detect the presence of one of these languages (foreach pick in hero from BaseLang), add a Language Picker to the Languages tab, select the language and increment the incrementer by 2, then add 2 to the cfgMax1 field. Is this possible? |
#3 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
There is a toggle on the background tab for replacing the default languages for NPCs, I believe, giving free slots for each suppressed languages. IIRC, that is also connected to a herofield, but since it is a user field you'd have to do a "trustme" if you wanted to toggle it in a script. I'm also not 100% sure it would work for PCs, but I think it might.
If it turns out that the toggle is limited to NPCs, I can look into how it accomplishes that in the background and see if you can adapt that. |
#4 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Also, sorry for the wrong ID for the Helper tag, sometimes my memory fails me.
|
#5 |
Senior Member
Join Date: Feb 2017
Posts: 119
|
I looked into your idea. It was a good idea, but the toggle only replaces Common. So if your race is Elf granting you Elvish and Common, the checkbox only removes Common (leaving behind Elvish). Also if you choose a human ethnicity (like Varisian) that grants Common and Varisian, the toggle only removes Common leaving Varisian.
|
#6 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Wrong toggle, the one inside the Customize form (the button for it is just right of the race selection) clears all languages bootstrapped to the race, though it won't get ones bootstrapped from an ethnicity or something else.
The actual code for this triggers off a hero tag applied when the toggle is switched, and is run from the race component. First 50 Code:
~If we're customizing languages for this race, find the languages we ~bootstrap and disable them if (hero.tagexpr[Hero.NoPreSel | Hero.RacCstLang] <> 0) then var addlang as number foreach pick in hero from BaseLang where "!Helper.SpeakLang" if (eachpick.isroot <> 0) then if (eachpick.root.isidentity[thingid] <> 0) then perform eachpick.assign[Hide.Language] addlang += 1 endif elseif (eachpick.tagis[thingid.lCommon] <> 0) then perform eachpick.assign[Hide.Language] addlang += 1 endif nexteach field[rLangBonus].value += addlang ~ Customized races can replace the removed ones with any language perform assign[Language.Any] endif |
#7 |
Senior Member
Join Date: Feb 2017
Posts: 119
|
I noticed something similar looking at the tags on lCommon and another language when toggling the Hide Common toggle on the Background screen.
Thank you for the code snippet, it's always super useful to see what is going on behind the scenes. Any ideas for adding an instance of the Language Picker ability to the Configurable table and setting it to the hidden language? Also, is there a tag or field to limit the incrementer to 1 or 2? Right now it starts at 0 and could be any number. I've coded it for Rudamentary if 1 and Fluent if 2, Error if >2; but it would be much better if not even allowed. |
#8 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Quote:
Check the debug for the pick with the incrementer, and find out which field is being incremented. Do you see a similarly named field which mentions Min, or Max? If so, those are probably the fields you'd need to set. You'd need to set them early, before whatever bound scripts run for that field. |
|
#9 |
Senior Member
Join Date: Feb 2017
Posts: 119
|
Thanks for the tip for Min/Max. I'll take a look at that.
What I was asking about the adding an instance of the Language Picker is, let's say your race gets Elven automatically. I should be able to hide it and increase the allowed selections on the Configurable table to account for that. However, I'd like to take it a step further and automatically add a copy of the Language Picker to the Configurable table, set the drop down on that Language Picker to the same language disabled (Elven), and set the incrementer to 2. Basically, I want to 'move' the automatically granted language from the Background tab to the new Configurable. |
#10 |
|
|