Diplomacy dialog-script

Users who are viewing this thread

Hi! I'm struggling with my problem all the time. Unfortunately, the way to add a new breed failed. Each new breed is treated as a male does not matter skin number. I think that the scripts for diplomacy are exactly that ("script_cf_dplmc_troop_is_female",). Unfortunately, I do not know where the settings of this script are, so that I can add my race to this script. Maybe it would be possible to write a similar script, but I need help writing this script. Can someone help the skin number that they want to add is 2. The name of the skin - portrait. The entire variable is tf_pretty = 2. Thanks for viewing.
 
I think this Diplomacy script is responsible for race / gender. Someone knows how to edit it so that skin number 2 tf_pretty is treated the same as skin number 1 tf_female. Unfortunately, I do not know scripts. I was able to add a new skin in Character Creation. Which was relatively easy. Unfortunately, the setting tf_male = 0,  tf_female = 1, tf_undead = 2, tf_pretty = 3 does not work. Skins 2 and 3 are always treated as men, and I want skin number 2 tf_pretty to be treated as a woman. Currently set skin order
tf_male = 0
tf_female = 1
tf_pretty = 2
tf_undead = 3.

Diplomacy Script Floris Mod Expanded 2.53

##script_cf_dplmc_troop_is_female
  #
  #This exists to make it easy to modify this to work with mods that redefine the troop types.
  #See script_dplmc_store_troop_is_female
  #
  #INPUT: arg1: troop_no
  #OUTPUT: none
  ("cf_dplmc_troop_is_female",
  [
(store_script_param_1, ":troop_no"),
(assign, ":is_female", 0),
(ge, ":troop_no", 0),#Undefined behavior when the arguments are invalid.
(try_begin),
  (eq, ":troop_no", active_npcs_including_player_begin),
  (assign, ":troop_no", "trp_player"),
(try_end),
(troop_get_type, ":is_female", ":troop_no"),
#The following will make it so, for example, tf_undead does not appear to be female.
#Mods where this is relevant will likely want to tweak it, but this will work in at
#least one that I know of that has non-human lords.
(eq, ":is_female", tf_female),
  ]),

  ##script_dplmc_store_troop_is_female
  #
  #This exists to make it easy to modify this to work with mods that redefine the troop types.
  #
  #If you change this, remember to also change script_cf_dplmc_troop_is_female and
  #script_dplmc_store_is_female_troop_1_troop_2
  #
  #INPUT: arg1: troop_no
  #
  #OUTPUT:
  #      reg0: 1 is yes, 0 is no
  ("dplmc_store_troop_is_female",
  [
(store_script_param_1, ":troop_no"),
(try_begin),
  (eq, ":troop_no", active_npcs_including_player_begin),
  (assign, ":troop_no", "trp_player"),
(try_end),
(troop_get_type, reg0, ":troop_no"),
(try_begin),
(neq, reg0, 0),
(neq, reg0, 1),
(assign, reg0, 0),#e.g. this would apply to tf_undead
(try_end),
  ]),

  ("dplmc_store_troop_is_female_reg",
  [
(store_script_param_1, ":troop_no"),
(store_script_param_2, ":reg_no"),
(troop_get_type, ":is_female", ":troop_no"),
#The following will make it so, for example, tf_undead does not appear to be female.
#Mods where this is relevant will likely want to tweak it, but this will work in at
#least one that I know of that has non-human lords.
(try_begin),
(neq, ":is_female", 0),
(neq, ":is_female", 1),
(assign, ":is_female", 0),
(try_end),
##Can asign to registers 0,1,2,3, 65, or 4
(try_begin),
  (eq, ":reg_no", 4),
  (assign, reg4, ":is_female"),
(else_try),
  (eq, ":reg_no", 3),
  (assign, reg3, ":is_female"),
(else_try),
  (eq, ":reg_no", 2),
  (assign, reg2, ":is_female"),
(else_try),
  (eq, ":reg_no", 1),
  (assign, reg1, ":is_female"),
(else_try),
  (eq, ":reg_no", 0),
  (assign, reg0, ":is_female"),
(else_try),
  (eq, ":reg_no", 65),
  (assign, reg65, ":is_female"),
(else_try),
  ##default to reg4
  (assign, reg4, ":reg_no"),
  (display_message, "@{!} ERROR: called script dplmc-store-troop-is-female-reg with bad argument {reg4}"),
  (assign, reg4, ":is_female"),
(try_end),
  ]),
 
  ##script_dplmc_store_is_female_troop_1_troop_2
  #
  #This exists to make it easy to modify this to work with mods that redefine the troop types.
  #See script_dplmc_store_troop_is_female
  #
  #INPUT:
  #      arg1: troop_1
  #      arg2: troop_2 
  #OUTPUT:
  #      reg0: 0 for not female, 1 for female
  #      reg1: 0 for not female, 1 for female
  ("dplmc_store_is_female_troop_1_troop_2",
  [
(store_script_param_1, ":troop_1"),
(store_script_param_2, ":troop_2"),
(troop_get_type, ":is_female_1", ":troop_1"),
(troop_get_type, ":is_female_2", ":troop_2"),
#The following will make it so, for example, tf_undead does not appear to be female.
#Mods where this is relevant will likely want to tweak it, but this will work in at
#least one that I know of that has non-human lords.
(try_begin),
(neq, ":is_female_1", 0),
(neq, ":is_female_1", 1),
(assign, ":is_female_1", 0),
(try_end),
(try_begin),
(neq, ":is_female_2", 0),
(neq, ":is_female_2", 1),
(assign, ":is_female_2", 0),
(try_end),
(assign, reg0, ":is_female_1"),
(assign, reg1, ":is_female_2"),
  ]),
 
Nobody will help with this stupid script? Maybe someone knows how to fire it without breaking the rest of the module. I really don't know what to do anymore. I know someone must be overwhelmed. I don't mean writing the entire script. I just want to know what to change. Or how to set all skins except tf_male to be set as women. Sorry to impose myself, but I've been trying to figure out the skin problem for two weeks.
 
Thank you for your "help". It is a pity that no more experienced person looked at this thread. Minor changes in one script were enough. Yes, written in the script comment. Somehow I will have to suffer men's dialog lines. :cry:
 
I am sorry with the text, but I have no strength what to do about it. I've been trying to add skin for two weeks. I wanted a specific skin only for the player. One whacked script corrupts all dialogues. I don't even have a clue how to go about it. The game normally treats the new skin as a woman. Everything works. Only dialogues don't work. Skin is a woman and they treat the game as a man all the time. I know this is the script because I looked through the dialogues. There is no way to delete this script because then you can not compile. The best and probably the easiest way would be to run the script when the skin equals tf_pretty. Unfortunately I don't know Python or English well enough so all eg and neg don't tell me anything. I do everything by trial and error.

 
Would it be possible to rewrite this script so that every new skin would be treated as a woman? Currently, he treats every new skin as a man. I just don't know which variable it is responsible for. Scripts are black magic for me. Once again, I'm sorry, I didn't want to offend anyone for the previous comment.
 
Antar36 said:
Currently set skin order
tf_male = 0
tf_female = 1
tf_pretty = 2
tf_undead = 3.

Diplomacy Script Floris Mod Expanded 2.53
Code:
 ##script_cf_dplmc_troop_is_female
						  #
						  #This exists to make it easy to modify this to work with mods that redefine the troop types.
						  #See script_dplmc_store_troop_is_female
						  #
						  #INPUT: arg1: troop_no
						  #OUTPUT: none
						  ("cf_dplmc_troop_is_female",
						  [
							(store_script_param_1, ":troop_no"),
							(assign, ":is_female", 0),
							(ge, ":troop_no", 0),#Undefined behavior when the arguments are invalid.
							(try_begin),
							   (eq, ":troop_no", active_npcs_including_player_begin),
							   (assign, ":troop_no", "trp_player"),
							(try_end),
							(troop_get_type, ":is_female", ":troop_no"),
							#The following will make it so, for example, tf_undead does not appear to be female.
							#Mods where this is relevant will likely want to tweak it, but this will work in at
							#least one that I know of that has non-human lords.
							(eq, ":is_female", tf_female),
						  ]),

						  ##script_dplmc_store_troop_is_female
						  #
						  #This exists to make it easy to modify this to work with mods that redefine the troop types.
						  #
						  #If you change this, remember to also change script_cf_dplmc_troop_is_female and
						  #script_dplmc_store_is_female_troop_1_troop_2
						  #
						  #INPUT: arg1: troop_no
						  #
						  #OUTPUT:
						  #       reg0: 1 is yes, 0 is no
						  ("dplmc_store_troop_is_female",
						  [
							(store_script_param_1, ":troop_no"),
							(try_begin),
							   (eq, ":troop_no", active_npcs_including_player_begin),
							   (assign, ":troop_no", "trp_player"),
							(try_end),
							(troop_get_type, reg0, ":troop_no"),
							(try_begin),
								(neq, reg0, 0),
								(neq, reg0, 1),
								(assign, reg0, 0),#e.g. this would apply to tf_undead
							(try_end),
						  ]),

						  ("dplmc_store_troop_is_female_reg",
						  [
							(store_script_param_1, ":troop_no"),
							(store_script_param_2, ":reg_no"),
							(troop_get_type, ":is_female", ":troop_no"),
							#The following will make it so, for example, tf_undead does not appear to be female.
							#Mods where this is relevant will likely want to tweak it, but this will work in at
							#least one that I know of that has non-human lords.
							(try_begin),
								(neq, ":is_female", 0),
								(neq, ":is_female", 1),
								(assign, ":is_female", 0),
							(try_end),
								##Can asign to registers 0,1,2,3, 65, or 4
							(try_begin),
								  (eq, ":reg_no", 4),
								  (assign, reg4, ":is_female"),
							(else_try),
							  (eq, ":reg_no", 3),
							  (assign, reg3, ":is_female"),
							(else_try),
							  (eq, ":reg_no", 2),
							  (assign, reg2, ":is_female"),
							(else_try),
							  (eq, ":reg_no", 1),
							  (assign, reg1, ":is_female"),
							(else_try),
							  (eq, ":reg_no", 0),
							  (assign, reg0, ":is_female"),
							(else_try),
							  (eq, ":reg_no", 65),
							  (assign, reg65, ":is_female"),
								(else_try),
								  ##default to reg4
								  (assign, reg4, ":reg_no"),
								  (display_message, "@{!} ERROR: called script dplmc-store-troop-is-female-reg with bad argument {reg4}"),
								  (assign, reg4, ":is_female"),
								(try_end),
						  ]),
						  
						  ##script_dplmc_store_is_female_troop_1_troop_2
						  #
						  #This exists to make it easy to modify this to work with mods that redefine the troop types.
						  #See script_dplmc_store_troop_is_female
						  #
						  #INPUT:
						  #      arg1: troop_1
						  #      arg2: troop_2  
						  #OUTPUT:
						  #       reg0: 0 for not female, 1 for female
						  #       reg1: 0 for not female, 1 for female
						  ("dplmc_store_is_female_troop_1_troop_2",
						  [
							(store_script_param_1, ":troop_1"),
							(store_script_param_2, ":troop_2"),
							(troop_get_type, ":is_female_1", ":troop_1"),
							(troop_get_type, ":is_female_2", ":troop_2"),
							#The following will make it so, for example, tf_undead does not appear to be female.
							#Mods where this is relevant will likely want to tweak it, but this will work in at
							#least one that I know of that has non-human lords.
							(try_begin),
								(neq, ":is_female_1", 0),
								(neq, ":is_female_1", 1),
								(assign, ":is_female_1", 0),
							(try_end),
							(try_begin),
								(neq, ":is_female_2", 0),
								(neq, ":is_female_2", 1),
								(assign, ":is_female_2", 0),
							(try_end),
							(assign, reg0, ":is_female_1"),
							(assign, reg1, ":is_female_2"),
						  ]),
I am making a wild guess: The script cf_dplmc_troop_is_female is making one check for the female flag
Code:
(eq, ":is_female", tf_female),
Maybe you can edit that one to
Code:
(this_or_next|eq, ":is_female", tf_female),
(eq, ":is_female", tf_pretty),

Antar36 said:
Scripts are black magic for me.
For some people a reason to don't make big changes ^^
 
Antar36 said:
Scripts are black magic for me

Forge has tutorials to help you learn how to code in MBScript, did you check them? Also a Q&A thread where you can post questions when you need help.

Just keep in mind a few things:

1) Native is the usual reference. Not because it is the best or whatnot. Just because it is what everyone has.
2) Your question needs to have enough info. We cant see what you are doing. We cant look inside your computer or your head. So bring code, screenshots, etc and add them to your post. The clearer your question is, the easier to get a answer becomes
3) Use tags like "code", "spoiler", etc to compose your post
Code:
my code example here
4) Add links to your sources. Talking about a OSP? A tutorial? Another module? Dont expect people to know which one it is. The link to it plus whatever is necessary (like version) is needed it.
5) Modding is about doing stuff yourself. So it is easier to get help when you pass the impression you want to learn stuff, and harder when looks like you want people to do stuff for you
6) Logs, testing code, etc are important too

Warband allows you to change pretty much anything with your module. But it also requires a lot of time invested to learn all the ins and outs. Baby steps (do small things one at time) is a good policy.
 
try the small steps method all the time. First, I learned how to transfer items between mods. Then I learned how to add other skins. Now he is trying to use the PoP (pretty woman) skin and transfer it to Floris Expanded 2.53 to make it available only to the player. While the transfer of image files and skin.txt content has passed without a problem it is a problem with dialog lines. The game still considers the character as a man, not a woman as it should be. Although the game considers the character a woman. I found the guide, unfortunately it helped me too much, it contains everything that mod diplomacy. I tried to change the line: (assign, ": is_female", 0), zero to one. It also did not help this script enforces male sex on any skin other than tf_female. I don't know what else to convey.  Here is guide link:https://forums.taleworlds.com/index.php?topic=347961.0 .
 
I reviewed the moduledialogs.py file in Floris Expanded 2.53. I noticed an interesting thing that this script appears about 100 times. I have a question if the dialogs will still work if I delete the lines that run this script.
This is example:
##diplomacy start+ Get gender for troop
##OLD: #(troop_get_type, reg65, "$g_talk_troop"),
(assign, reg65, 0),
(try_begin),
(call_script, "script_cf_dplmc_troop_is_female", "$g_talk_troop"),
(assign, reg65, 1),
(try_end),

The rest is ok. However, these dialogues are annoying. Deleting the entire script is not an option. It's too nested. Removal would definitely get you out of the game.
 
read
https://forums.taleworlds.com/index.php/topic,142422.0.html
https://forums.taleworlds.com/index.php/topic,56798.0.html - pdf file
https://forums.taleworlds.com/index.php/board,12.0.html

those are the basics for MBScript.

a script that starts with "cf_" returns either 0 or 1 (false or true). CF means [can fail].

On the snippet above it is used to test gender. If the conditions inside it are valid (whatever they are), it pass and returns TRUE (1), so the next line is executed (thus reg65 = 1) and dialog uses female lines. If it fails for whatever reason, it returns FALSE (0) and reg65 = 0 for male lines.
 
Back
Top Bottom