Ludeon Forums

Ludeon Forums

  • April 21, 2021, 06:52:00 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Need some help with rulepaks  (Read 770 times)

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Need some help with rulepaks
« on: November 23, 2020, 05:00:02 AM »

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

Code: [Select]
    <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?
Logged
"The megasloth ducked behind the nearest piece of cover"

b606

  • Colonist
  • ***
  • Posts: 104
  • Refugee
    • View Profile
Re: Need some help with rulepaks
« Reply #1 on: November 24, 2020, 10:22:50 AM »

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 ?).
Logged
b606

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

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Re: Need some help with rulepaks
« Reply #2 on: November 25, 2020, 05:49:27 AM »

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.
Logged
"The megasloth ducked behind the nearest piece of cover"

b606

  • Colonist
  • ***
  • Posts: 104
  • Refugee
    • View Profile
Re: Need some help with rulepaks
« Reply #3 on: November 25, 2020, 12:13:14 PM »

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:
Code: [Select]
<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.
Logged
b606

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

b606

  • Colonist
  • ***
  • Posts: 104
  • Refugee
    • View Profile
Re: Need some help with rulepaks
« Reply #4 on: November 25, 2020, 12:24:41 PM »

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.

Code: [Select]
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
Logged
b606

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

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Re: Need some help with rulepaks
« Reply #5 on: January 09, 2021, 08:46:42 AM »

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).
Logged
"The megasloth ducked behind the nearest piece of cover"