New Race Gender References (Warband)

正在查看此主题的用户

SkyShadowing

Sergeant
I've modded a new race (male and female) into my game, and male members of my race keep getting referred to as "lady" and "her" and "she" (haven't really tested female). In addition, they can't try and marry free females.

Is there any way to fix it so that they are referred to as the proper gender, and treated the same as regular males? Same for the females (I did one playtest as female, and the sexist lords were as they should be).
 
The check for sex just checks for "race" value 0 (male, by default).  You need to alter all those sections of the Module System to check for values of 0,2 (male, male, I presume, in your setup).  Look at the dialogues.
 
I'm looking through the dialogues, and the only relevant check I can see is :is_female

I'm not very skilled with the Module System- I'm trying to fight my way through this by example, lol.
 
It's checked like this:

插入代码块:
  (troop_get_type, ":is_female", "trp_player"),
  (eq, ":is_female", 1),
The value is 0 for male, 1 for female, and 2 and 3 for your new races.  Simple as that.
 
Alright, most of it is working, but this one in particular seems to be giving me trouble. Everything is working, I have no idea what's wrong.

For reference, 0 and 1 are standard, 2 is undead (didn't want to cut that out), and 3 and 4 are my new race, male and female respectively.

Anything wrong?

插入代码块:
  [anyone,"lord_talk_ask_marriage_1", [
    (assign, "$marriage_candidate", -1),
	(try_begin),
		(troop_get_type, ":is_female", "trp_player"),
		(this_or_next|eq, ":is_female", 1),
		(eq, ":is_female", 4),
		(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),
		(assign, "$marriage_candidate", "$g_talk_troop"),
		(troop_get_type, ":is_female", "trp_player"),
	(else_try),	
		(troop_get_type, ":is_female", "trp_player"),
		(this_or_next|eq, ":is_female", 0),
		(eq, ":is_female", 3),
		(assign, "$marriage_candidate", -1),
		(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),
			(troop_slot_eq, ":lady", slot_troop_spouse, -1),
			(troop_slot_eq, ":lady", slot_troop_betrothed, -1),
			(call_script, "script_get_kingdom_lady_social_determinants", ":lady"),
			
			(eq, reg0, "$g_talk_troop"),
			
			(call_script, "script_troop_get_family_relation_to_troop", ":lady", "$g_talk_troop"),
			(assign, "$marriage_candidate", ":lady"),
			(str_store_troop_name, s14, "$marriage_candidate"),
			
			(str_store_string, s15, "str_it_is_our_custom_to_seal_any_such_alliances_with_marriage_and_in_fact_we_have_been_looking_for_a_suitable_groom_for_my_s11_s14"),

		(try_end),
	(try_end),
	(eq, "$marriage_candidate", -1),
  ],
   "It is our custom to seal any such alliances with marriage. Unfortunately, no one in my household is eligible to wed.",
   "lord_pretalk",[
   ]],
 
I made a couple of corrections.
插入代码块:
  [anyone,"lord_talk_ask_marriage_1", 
  [    
  (assign, "$marriage_candidate", -1),	# Need this once
  (troop_get_type, ":is_female", "trp_player"), # Get this once
  
  (try_begin),					
	(this_or_next|eq, ":is_female", 1),		
	(eq, ":is_female", 4),		
	(troop_slot_eq, "$g_talk_troop", slot_troop_spouse, -1),		
	(assign, "$marriage_candidate", "$g_talk_troop"),		
  (else_try),				
	(this_or_next|eq, ":is_female", 0),		
	(eq, ":is_female", 3),				
	(try_for_range, ":lady", kingdom_ladies_begin, kingdom_ladies_end),			
		(troop_slot_eq, ":lady", slot_troop_spouse, -1),			
		(troop_slot_eq, ":lady", slot_troop_betrothed, -1),			
		(call_script, "script_get_kingdom_lady_social_determinants", ":lady"),						
		(eq, reg0, "$g_talk_troop"),						
		(call_script, "script_troop_get_family_relation_to_troop", ":lady", "$g_talk_troop"),			
		(assign, "$marriage_candidate", ":lady"),			
		(str_store_troop_name, s14, "$marriage_candidate"),						
		(str_store_string, s15, "str_it_is_our_custom_to_seal_any_such_alliances_with_marriage_and_in_fact_we_have_been_looking_for_a_suitable_groom_for_my_s11_s14"),		
	(try_end),	
  (try_end),	
  (eq, "$marriage_candidate", -1),
  ],   
  "It is our custom to seal any such alliances with marriage. Unfortunately, no one in my household is eligible to wed.",   "lord_pretalk",
  []],
 
Implemented, built, still no luck on working.

Whenever I click on the topic in the game, it spins to my guy, and no matter how many times I click, it never advances. In case that one helps.
 
插入代码块:
(eq, "$marriage_candidate", -1),
It's basically setting up a situation where if you actually have a marriage partner in the previous code, then it won't let you pass  :lol:

Try:

插入代码块:
(neg, "$marriage_candidate", -1),
 
The condition was correct based on the Native script.

That's just one dialog that you modified. You need to modified all places that check for gender (including in other modules). Another dialog that I can find is:
插入代码块:
  [anyone|plyr,"lord_courtship_pre_permission", [
  (neg|troop_slot_ge, "trp_player", slot_troop_spouse, 1),
  (neg|troop_slot_ge, "trp_player", slot_troop_betrothed, 1),

  (troop_get_type, ":is_female", "trp_player"),
  (eq, ":is_female", 0),
  
  (str_clear, s15),
  (try_begin),
	(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
	(str_store_string, s15, "str_once_again_"),
  (try_end),
  ],
   "May I {s15}suggest that I be considered as a groom?",
   "lord_courtship_permission",[
   ]],
This is the place that you should advance to.
 
I've advanced everywhere. It's a distinct possibility that I have no idea what I'm doing. As an example, here's what I posted for that bit of code:

插入代码块:
  [anyone|plyr,"lord_courtship_pre_permission", [
  (neg|troop_slot_ge, "trp_player", slot_troop_spouse, 1),
  (neg|troop_slot_ge, "trp_player", slot_troop_betrothed, 1),

  (troop_get_type, ":is_female", "trp_player"),
  (this_or_next|eq, ":is_female", 0),
  (eq, ":is_female", 3),
  
  (str_clear, s15),
  (try_begin),
	(troop_slot_eq, "$g_talk_troop", slot_lord_granted_courtship_permission, -1),
	(str_store_string, s15, "str_once_again_"),
  (try_end),
  ],
   "May I {s15}suggest that I be considered as a groom?",
   "lord_courtship_permission",[
   ]],

With regards to the previous one, it's working again... they just always say they have nobody available to marry to me.

EDIT: Hold my horses, discovery! There's some text in between that calls the troop_get_type, but doesn't use :is_female.

I think I've found my problem. Will fix all these and test.

2EDIT: Yes, that was the problem. It's working as intended, minus a few bugs I also found were present in Native. But I still need a way to get referred to as the proper gender, if anybody has any suggestions.
 
There is a little trick to do that, though you must have your entries in module_skins sorted. They should be like this: male, female, male, female, male, female... etc.

So 0,2,4,6,8...  will be males.
And 1,3,5,7,9... will be females.

Then you'll need to search for every "troop_get_type" in dialogs and check what variable or register it uses (if I recall correctly most of the times in Native dialogs it was set to reg9). After "troop_get_type" line you'll need to add:

(val_mod, -register_or_variable_that_'troop_get_type'_used- , 2),

If the troop was male (no matter what race), then new value will be 0. If female, the new value will be 1. So with that you'll not have to change dialogs.
 
Is that for the marriage stuff (which, by the way, is working perfectly, thanks to everybody who helped), or the whole Ladies getting referred to as Sons type stuff?

EDIT: Implemented those fixes, went through scripts and made some changes, everything works as it should now. Thanks for all your help!
 
I was hoping someone could help me. I know this thread is from 2010, but I'm having similar issues that the OP did.
I added 2 new races (both male and female), but the females keep getting regarded to as males.

So I've read the thread quite a few times, trying to figure out how to fix this issue. But when I tried making the suggested changes I ran across problems. One, I use Diplomacy in my mod, and in module_dialogues it made changes to pretty much all the troop_get_type codes.
For instance,
插入代码块:
[anyone,"lord_ask_enter_service", [
##diplomacy start+
#(troop_get_type, ":type", "trp_player"),
#(eq, ":type", 1),
(lt, "$g_disable_condescending_comments", 2),
(call_script, "script_cf_dplmc_faction_has_bias_against_gender", "$g_talk_troop_faction", "$character_gender"),
##diplomacy end+

插入代码块:
##diplomacy start+
  #(troop_get_type, ":is_female", "trp_player"),##Get gender from a script instead
  (assign, ":is_female", "$character_gender"),
  (assign, ":faction_prejudiced", 0),
  (try_begin),
	(lt, "$g_disable_condescending_comments", 0),#<- OPTION: Extra prejudice
	(call_script, "script_cf_dplmc_faction_has_bias_against_gender", "$g_talk_troop_faction", ":is_female"),
	(assign, ":faction_prejudiced", 1),
	(val_div, ":vassal_potential", 2),
  (try_end),
  ##diplomacy end+

There is a little trick to do that, though you must have your entries in module_skins sorted. They should be like this: male, female, male, female, male, female... etc.

So 0,2,4,6,8...  will be males.
And 1,3,5,7,9... will be females.
I did this...

Then you'll need to search for every "troop_get_type" in dialogs and check what variable or register it uses (if I recall correctly most of the times in Native dialogs it was set to reg9). After "troop_get_type" line you'll need to add:

(val_mod, -register_or_variable_that_'troop_get_type'_used- , 2),
Then I wanted to do this, to see if it would work, but as I said Diplomacy changed most of the native code.

If it will help, here are my races:
(module_troops)
插入代码块:
# Races 
tf_male           = 0
tf_female         = 1
tf_elven_male     = 2
tf_elven_female   = 3
tf_dwarf_male     = 4

and header_troops
插入代码块:
#Troop flags
tf_male           = 0
tf_female         = 1
tf_elven_male     = 2
tf_elven_female   = 3
tf_dwarf_male     = 4
tf_dwarf_female   = 5
tf_undead         = 7
tf_dwarf_female   = 5

Yes I have gender and race defined

插入代码块:
slot_troop_gender				= 305 
slot_race                       = 306

Any help would be appreciated.
 
First call your gender detection script for every troop (male = set slot to 0, female = 1) right after selecting your race and gender so you don't have to do it over and over, but you'll also have to replace every (troop_get_type, [destination], [troop]), in the files with (troop_get_slot,[destination],[troop], slot_troop_gender),.
 
Dusk Voyager 说:
First call your gender detection script for every troop (male = set slot to 0, female = 1) right after selecting your race and gender so you don't have to do it over and over, but you'll also have to replace every (troop_get_type, [destination], [troop]), in the files with (troop_get_slot,[destination],[troop], slot_troop_gender),.
This is my current code
(Game_menus)
插入代码块:
[
      ("start_human_female",
      [],
      "Human Female",
      [
        (assign, "$race", 0), #(0 = Human race)
        (troop_set_type, "trp_player", 1), #(1 = Human female troop)
        (jump_to_menu, "mnu_start_character_1"),
      ]
      ),

      ("start_elven_female",
      [],
      "Elven Female",
      [
        (assign, "$race", 1), #(1 = Elven race)
        (troop_set_type, "trp_player", 3), #(3 = Elven female troop)
        (jump_to_menu, "mnu_start_character_1"),
      ]
      ),
	  
	  ("start_dwarven_female",
      [],
      "Dwarven Female",
      [
        (assign, "$race", 2), #(2 = Dwarven race)
        (troop_set_type, "trp_player", 5), #(5 = Dwarven female troop)
        (jump_to_menu, "mnu_start_character_1"),
      ]
      ),

      ("go_back",

Was I starting out wrong?
I couldn't quite understand what you meant with
First call your gender detection script for every troop (male = set slot to 0, female = 1) right after selecting your race and gender
Could you maybe explain with my code?
 
I'm assuming first the gender, then the race is chosen in your menus, so that code is fine. Just make sure you refer to the script in the first block of mnu_start_character_1, which is common to all races and genders.
  ("detect_gender_for_all_troops",
  [
    (try_for_range, ":troop", "trp_player", [the last troop]),
    (troop_get_type, ":type", ":troop"),
    (assign, ":gender", ":type"),
    (store_div, ":even_val", ":type", 2),
    (val_mul, ":even_val", 2),
    (val_sub, ":gender", ":even_val"),
    (troop_set_slot, ":troop", slot_troop_gender, ":gender"),
    (try_end),
  ]),
 
后退
顶部 底部