Need some help with rulepaks

Started by BTAxis, November 23, 2020, 05:00:02 AM

Previous topic - Next topic

BTAxis

Specifically, I'm trying to make use of the Dutch language worker code. Consider a grammar rule like

    <li>r_logentry->[INITIATOR_definite]'s [WEAPON_projectile_label] [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets].</li>

When I add the label of an animal to WordInfo/Gender/Neuter.txt, I expect the definite article for that animal to be the neutral definite article (i.e. "het"), but it doesn't work. It always seems to use the gender of the actual animal rather than the gender of the animal's label.

I've experimented with conditionals like INITIATOR_label_gender==Neuter, but nothing so far has worked. Can someone explain how it's supposed to work?
"The megasloth ducked behind the nearest piece of cover"

b606

Hi,
As far as I know, the animal in vanilla languageWorker and and grammarresolver always get the physical gender. That is why I developped patches to deal with that for French and Spanish. Some features are listed here https://github.com/b606/RimWorld-LanguageWorker_Spanish. If you want, we can define one custom languageworker for Dutch where all animal gender should be neuter (PS: how about tamed and named animal ? ex a female cat named Kitty: would it be neuter or female ?).
b606


Make the French RimWorld Translation at maximum quality.
French Optimisation Mod

BTAxis

Well, it's still necessary to get the physical gender. I guess that's the tricky part here.

In Dutch, when we have a sentence like "The horse wagged its tail", we write "Het paard zwaaide met zijn staart". The definite article at the start of the sentence ("het") is the neuter definite article, because the word "paard" is not gendered, but the pronoun "zijn" in this sentence is the male pronoun, because the actual horse is male (in this case).

So, what I need is a way in the rulepak grammar to reason about the animal's label's gendered-ness explicitly, without affecting the existing logic that reasons about the pawn gender.
"The megasloth ducked behind the nearest piece of cover"

b606

Yes that is tricky. If I understand correctly, what you need in the rulepacks are rules for RECIPIENT_definite (testing for animal or not). Something similar to:
<li>my_definite(PawnKindDef==Human)->[PAWN_definite]</li>
<li>my_definite(PawnKindDef!=Human)->het [PAWN_label]</li>

The prefix "PAWN" needs to be adapted, and you might need to check if "PawnKindDef" is the correct one and that it is disponible as a constant. PAWN_gender stays the same as it is now.
b606


Make the French RimWorld Translation at maximum quality.
French Optimisation Mod

b606

Checked with the grammar log turned ON:
For a melee combat the PawnKind is not listed in the CONSTANTS, so what I said above would not apply.

INCLUDES
Damage_Flame
Combat_ExplosionImpact
Combat_WoundIncludes
Combat_MeleeDamageIncludes
Combat_MeleeIncludes
CONSTANTS
recipient_part0_destroyed              False
recipient_part0_gender                 Male
recipient_part_damaged0_outside        True
recipient_part_damaged0_gender         Male
recipient_part_count                   1
recipient_part_destroyed_count         0
recipient_part_damaged_count           1
deflected                              False
INITIATOR_faction                      Ancients
INITIATOR_flesh                        Normal
INITIATOR_gender                       Male
RECIPIENT_faction                      Ancients
RECIPIENT_flesh                        Normal
RECIPIENT_gender                       Male
b606


Make the French RimWorld Translation at maximum quality.
French Optimisation Mod

BTAxis

I'm still trying to find a solution for this. I need some way to tell the grammar which definite article to use, based on which word is used (so not based on any property of the pawn at all).
"The megasloth ducked behind the nearest piece of cover"