Viking Conquest's list of variables and module syntax for translation

Currently viewing this thread:

Fabiano_il_Capo

Sergeant
WBVC
Best answers
0
Hello everyone, I'm completing the italian translation for VC (here: https://forums.taleworlds.com/index.php/topic,336781.0.html) but I've encountered many sentences where is impossible to make sense and not being completely absurd without knowing the gender of who's talking, and stuff like this.
So I'm forced to introduce conditions in strings that don't need them in english.

Here's my question:
Is there some sort of list or dictionary of conditions/variables that I can use while translating, related specifically to Viking Conquest?

I tried to search for it here on the forum and also outside of it, but I've had no luck. To be honest I'm not even sure about what I have to search; Module Syntax? Variables List? Should I look into the Source Code, and if yes, how can I find these informations?

I'm making an example to be totally clear: in the sentence "I'm concerned about your command style." in english you don't need to know if who's talking is male or female, while in italian yes, you need it. The problem is that I don't know what number I have to put after the {reg to distinguish the two cases.

Thanks in advance for your help, and I'm sorry if a topic about this already existed.  :facepalm:
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Best answers
36
Fabiano Caputo said:
but what about knowing a NPC's gender?
check the skin, it is the same idea used for the player, but you will need to add code for that and use another variable like regxx on your dialogs/strings/etc.

game code is available for download, so check the modding section to learn more about it.

see this example you can find on module_dialogs.py

Code:
      (troop_get_type, reg65, "$g_talk_troop"),
      (val_mod, reg65, 2),
      (try_begin),
        (faction_slot_eq,"$g_talk_troop_faction",slot_faction_leader,"$g_talk_troop"),
        (str_store_string,s64,"@{reg65?my Lady:my Lord}"), #bug fix
        (str_store_string,s65,"@{reg65?my Lady:my Lord}"),
        (str_store_string,s66,"@{reg65?My Lady:My Lord}"),
        (str_store_string,s67,"@{reg65?My Lady:My Lord}"), #bug fix
      (else_try),
        (str_store_string,s64,"@{reg65?madame:sir}"), #bug fix
        (str_store_string,s65,"@{reg65?madame:sir}"),
        (str_store_string,s66,"@{reg65?Madame:Sir}"),
        (str_store_string,s67,"@{reg65?Madame:Sir}"), #bug fix
      (try_end),
see module_skins.py. You will see that order goes male/female/male/female/... , and that is why you can use MOD for the gender

5 MOD 2 = 1 = female = "baja" = short female skin
6 MOD 2 = 0 = male = "nino" = boy skin

https://en.wikipedia.org/wiki/Modulo_operation


 

Fabiano_il_Capo

Sergeant
WBVC
Best answers
0
Ok that's very interesting, thanks for your tips, I'll try looking for the code download. I tried on Viking Conquest's website but the link doesn't work.
The fact is I'm pretty sure that there are other regXX already that are used in some dialogues to determine things like the the gender of some NPC, for example {reg51? for a NPC you're trying to convince, and thus I wanted to see if it was possible to use the already existing ones without adding nothing via code.

But maybe for any single text string a specific part of code is needed?  I mean, if I introduce a reg59 in a string that didn't previously have it, it works fine. So I'm supposing that one can simply call a check for a variable from the text line, is it correct?
 

kalarhan

Python Saint
Count
WBNWVCWF&S
Best answers
36
put your definition on this dialog (4th). Currently it already has the {reg65} for that, so you wouldnt need to do anything besides using that on dialogs.

Code:
  [anyone ,"start", [
      (store_conversation_troop, "$g_talk_troop"),
      (store_conversation_agent, "$g_talk_agent"),
you can replicate that code for menus, presentations, etc. Those are not related to dialogs and thus they will not test and update the {reg65} variable in case you have some situation outside of a dialog. If a string or quick string (strings.txt and quick_strings.txt) are used in a dialog you dont need to do anything.

you can see the VC code http://download2.taleworlds.com/Viking_Conquest_Source_2044.zip, I just tested it and it works working.

to learn about modding you can visit the Forge or the modding section for tutorials, etc.
 

Daneel53

Sergeant Knight
WBVC
Best answers
0
Hello,

I'm currently working on the french translation and this subject is touchy. Because we are here talking about Viking Conquest, two statements to be done for the gender of the player's character.

First, the usual syntax {for man/for woman} DO NOT WORKS into Viking Conquest. All the mods that I've translated up to now use it (and I've translated more than five mods, from Native to ACOK) and it always works, but for a reason that I don't know this syntax is not well interpreted into VC (when it was done even into Brytenwalda). In fact, it is accepted, but it is the "for man" part that is always displayed, so it don't works.

Second, to replace the {for man/for woman} syntax, the devs in VC use the syntax {reg59?for woman:for man}. This means that the variable reg59 is always loaded with the right value depending the player's character gender and that you can use it everywhere, even in sentences where it is not used in English: it always works. The other consequence is that, if you want to play with the .py files to change scripts, you must not use and change the variable reg59 for another purpose.

Now, talking about a NPC's gender, the same syntax is used but with another variable. Kalarhan shows an example with reg65 ({reg65?My Lady:My Lord}), but in the thousand of lines of text into VC other variables are used, often reg51 as in However, {reg51?she:he} still expresses doubts but also reg3 as in {s45} says {reg3?she:he} is the rightful heir to the throne. But you must understand that the reg variable in this case is not set definitely for a certain NPC but is set before each sentence to be displayed. So this time you cannot use this syntax for a NPC into a sentence where this syntax does not exists in the English text, because that means that the variable has not been set and its value is random. Moreover, as you can see, the variable may change from a sentence to another (reg65, reg51, reg3...), so which one to use?

To summurize, in the example you gave in your first message, Fabiano :
  • If this case is relative to a NPC talking to the player's character who commands, you can write (in Italian) I'm concerned about {reg59?your female command style:your male command style} and it will works, because reg59 is always set with the player's gender.
  • If the person who command is a NPC, you cannot write I'm concerned about {reg51?your female command style:your male command style} because the reg51 variable has not been set for this sentence in the English text. Generally the better (and only) solution is to reformulate in order to avoid gender grammary errors.
 

Fabiano_il_Capo

Sergeant
WBVC
Best answers
0
Hello Daneel,

thanks a lot for your detailed reply. I confirm every single word you said, because later after making this topic I asked to a friend of mine who's a developer, and he helped me figuring this out.
Here in the picture we can see the .py file that contains all the registries and others variables used in VC (which you can find in VC source code files) and we can see that the only one reserved is indeed the reg59. Everything else changes continuously during the game.



To make a really nice job, I wouldn't mind to add a bit of code where necessary, as soon as I understand how to do it  :smile:
But yes, maybe it's wiser to just avoid those kind of distinctions, since if I mod something via code, I should then check that in every future update the edits I did still work.

PS just FYI:  In my example sentence "I'm concerned about your command style", in italian the distinction regards the word "concerned", not the command style. But thanks again for your help
 

Daneel53

Sergeant Knight
WBVC
Best answers
0
Hi Fabiano,
if I mod something via code, I should then check that in every future update the edits I did still work.
This is the real issue. First you will have to deliver, in more of all the .csv files in Italian, all the .txt files that are modified by the regeneration of the .py that you would have changed. And second, each time a new version of VC will be distributed, you will have to redo your changes into the new .py files and redeliver the .txt, if not the ancient .csv Italian filles won't match anymore. This is a heavy and long term task  !

This is why, in French translations, we reformulate and, if really we cannot find a text able to avoid the gender error, we write the text for a man because most of the NPC are men. In the end, there are finally few arrors due to NPC gender, but when they occur, we know that we did our best ! And, from me to you, there are generally many spelling mistakes and grammar errors in the mods' translated files, so a simple gender error is peanuts compared to much more bad things...  :wink: