Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Zephilinox said:
Is it possible to add new food and trade goods without breaking clothing?

using modules that is easy. Just make sure:
1) You add them in the same area/order the others are now. So new goods with the old goods, and so on
2) Check the module_constants.py in case you change any range (this file has constants that tell the game when one thing starts and ends, like trade goods).
Code:
trade_goods_begin = "itm_spice"
trade_goods_end = "itm_siege_supply"
food_begin = "itm_smoked_fish"
food_end = "itm_siege_supply"
reference_books_begin = "itm_book_wound_treatment_reference"
reference_books_end   = trade_goods_begin
readable_books_begin = "itm_book_tactics"
readable_books_end   = reference_books_begin
books_begin = readable_books_begin
books_end = reference_books_end
horses_begin = "itm_sumpter_horse"

and many more
3) Recompile the entire game to update items, scripts, etc
4) Update your modules.ini to load any new brf you are adding (graphics, sounds)
 
The Dark Robin said:
Still no luck.

Code:
	("town_default",0,-1,
	 "Default town visit",[
		(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise), #player spawn
		(0,mtef_visitor_source,af_override_horse,0,1,[]), #random event spawn
		(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(8,mtef_scene_source,af_override_horse,0,1,[]),
		(9,mtef_scene_source,af_override_horse,0,1,[]),
		(10,mtef_scene_source,af_override_horse,0,1,[]),
		(11,mtef_scene_source,af_override_horse,0,1,[]),
		(12,mtef_scene_source,af_override_horse,0,1,[]),
		(13,mtef_scene_source,0,0,1,[]),
		(14,mtef_scene_source,0,0,1,[]),
		(15,mtef_scene_source,0,0,1,[]),
		(16,mtef_visitor_source,af_override_horse,0,1,[]),
		(17,mtef_visitor_source,af_override_horse,0,1,[]),
		(18,mtef_visitor_source,af_override_horse,0,1,[]),
		(19,mtef_visitor_source,af_override_horse,0,1,[]),
		(20,mtef_visitor_source,af_override_horse,0,1,[]),
		(21,mtef_visitor_source,af_override_horse,0,1,[]),
		(22,mtef_visitor_source,af_override_horse,0,1,[]),
		(23,mtef_visitor_source,af_override_horse,0,1,[]),
		(24,mtef_visitor_source,af_override_horse,0,1,[]),
		(25,mtef_visitor_source,af_override_horse,0,1,[]),
		(26,mtef_visitor_source,af_override_horse,0,1,[]),
		(27,mtef_visitor_source,af_override_horse,0,1,[]),
		(28,mtef_visitor_source,af_override_horse,0,1,[]),
		(29,mtef_visitor_source,af_override_horse,0,1,[]),
		(30,mtef_visitor_source,af_override_horse,0,1,[]),
		(31,mtef_visitor_source,af_override_horse,0,1,[]),
		
		#tavern OSP begin
		(1,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#32
		(2,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#33
		(3,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#34
		(4,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#35
		(5,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#36
		(6,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#37
		(7,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#38
		(8,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#39
		(10,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#40
	 ],[
		dedal_tavern_animations,
      (1, 0, ti_once, [], 
      [
        (store_current_scene, ":cur_scene"),
        (scene_set_slot, ":cur_scene", slot_scene_visited, 1),
        (try_begin),
          (eq, "$sneaked_into_town", 1),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
        (else_try),
          (eq, "$talk_context", tc_tavern_talk),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_tavern),
        (else_try),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town),
        (try_end),
      ]),
	  		  	        
      (ti_before_mission_start, 0, 0, [], 
      [
        (call_script, "script_change_banners_and_chest"),
        (call_script, "script_initialize_tavern_variables"),
	  ]),

      (ti_inventory_key_pressed, 0, 0, 
      [
        (set_trigger_result,1)
      ], []),
      
      #tavern - belligerent drunk leaving/fading out
      (1, 0, 0, 
      [
        (gt, "$g_belligerent_drunk_leaving", 0),
        (entry_point_get_position, pos0, 0),
        (agent_get_position, pos1, "$g_belligerent_drunk_leaving"),
        (get_distance_between_positions, ":dist", pos0, pos1),
        (le, ":dist", 150),
      ],
      [
        (agent_fade_out, "$g_belligerent_drunk_leaving"),
        (assign, "$g_belligerent_drunk_leaving", 0),
      ]),
      
      (ti_tab_pressed, 0, 0, 
      [
        (try_begin),
          (eq, "$g_main_attacker_agent", 0),
          (set_trigger_result, 1),
        (try_end),  
      ], []),

	  #tavern brawl triggers - drunk
      (2, 0, 0, 
      [
	    (neg|conversation_screen_is_active),

		(eq, "$talk_context", tc_tavern_talk),
		
		(neg|troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),		
		(troop_slot_eq, "trp_belligerent_drunk", slot_troop_cur_center, "$g_encountered_party"),		
		(eq, "$drunks_dont_pick_fights", 0),		
	  ], 
	  [	  
	    (try_begin),
	      (eq, "$g_start_belligerent_drunk_fight", 0),
	      (assign, "$g_start_belligerent_drunk_fight", 1),
	      
	      (try_for_agents, ":cur_agent"),
	        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
	        (eq, ":cur_agent_troop", "trp_belligerent_drunk"),
	        (assign, "$g_belligerent_drunk", ":cur_agent"),
	      (try_end),
	    (else_try),
	      (eq, "$g_start_belligerent_drunk_fight", 1),	 
	           
	      (agent_is_active, "$g_belligerent_drunk"),
	      (agent_is_alive, "$g_belligerent_drunk"),
	      (get_player_agent_no, ":player_agent"),
	      (agent_get_position, pos0, ":player_agent"),
	      (agent_get_position, pos1, "$g_belligerent_drunk"),
	      (get_distance_between_positions, ":dist", pos0, pos1),
	      (position_get_z, ":pos0_z", pos0),
	      (position_get_z, ":pos1_z", pos1),
	      (store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
	      (try_begin),
	        (le, ":z_difference", 0),
	        (val_mul, ":z_difference", -1),
	      (try_end),
	      (store_mul, ":z_difference_mul_3", ":z_difference", 3),
	      (val_add, ":dist", ":z_difference_mul_3"),
	      (store_random_in_range, ":random_value", 0, 200),
	      (store_add, ":400_plus_random_200", 400, ":random_value"),
	      (le, ":dist", ":400_plus_random_200"),
	      
 		  (call_script, "script_activate_tavern_attackers"),
  		  (start_mission_conversation, "trp_belligerent_drunk"),
  		  (assign, "$g_start_belligerent_drunk_fight", 2),
	    (try_end),  
	  ]),
	  	  
	  #tavern brawl triggers - assassin
      (2, 0, 0, [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),		
	  ], 
	  [
	    (try_begin),
	      (eq, "$g_start_hired_assassin_fight", 0),
	      (assign, "$g_start_hired_assassin_fight", 1),
	      
	      (try_for_agents, ":cur_agent"),
	        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
	        (eq, ":cur_agent_troop", "trp_hired_assassin"),
	        (assign, "$g_hired_assassin", ":cur_agent"),
	      (try_end),	      
	    (else_try),  
	      (eq, "$g_start_hired_assassin_fight", 1),

	      (agent_is_active, "$g_hired_assassin"),
	      (agent_is_alive, "$g_hired_assassin"),
	      (get_player_agent_no, ":player_agent"),
	      (agent_get_position, pos0, ":player_agent"),
	      (agent_get_position, pos1, "$g_hired_assassin"),
	      (get_distance_between_positions, ":dist", pos0, pos1),
	      (position_get_z, ":pos0_z", pos0),
	      (position_get_z, ":pos1_z", pos1),
	      (store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
	      (try_begin),
	        (le, ":z_difference", 0),
	        (val_mul, ":z_difference", -1),
	      (try_end),
	      (store_mul, ":z_difference_mul_3", ":z_difference", 3),
	      (val_add, ":dist", ":z_difference_mul_3"),
	      (store_random_in_range, ":random_value", 0, 200),
	      (store_add, ":400_plus_random_200", 400, ":random_value"),
	      (le, ":dist", ":400_plus_random_200"),

		  (call_script, "script_activate_tavern_attackers"),
		  (assign, "$g_start_hired_assassin_fight", 2),
		(try_end),  
	  ]),
	  	  
	  #Aftermath talks
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
				
		(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
		(agent_is_wounded, "$g_main_attacker_agent"),
		(try_begin),
		(neq, "$belligerent_drunk_will_ask_to_join", 3),
		(agent_is_wounded, "$g_main_attacker_agent"),
		#(display_message, "@he was wounded."),
		(store_random_in_range, ":belligerent_drunk_want_to_join", 0, 2),
		(eq, ":belligerent_drunk_want_to_join", 1),
		#(display_message, "@random works"),
		#(ge, "$player_honor", 0),
		#(display_message, "@honor enough he will join."),
		(assign, "$belligerent_drunk_will_ask_to_join", 1),
		(try_end),
      ],
      [
        (mission_enable_talk),
      
		(try_for_agents, ":agent"),
		  (agent_is_alive, ":agent"),
		  (agent_get_position, pos4, ":agent"),
		  (agent_set_scripted_destination, ":agent", pos4),
		(try_end),
		
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),	 
	  ]),
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$townsman_burst_in", 3),
		(store_normalized_team_count, ":count1", 1),
		(store_normalized_team_count, ":count2", 2),
		(this_or_next|lt, ":count1", 1),
		(lt, ":count2", 1),
      ],
      [
        (mission_enable_talk),
		(finish_party_battle_mode),
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),	 
	  ]),

	  
	  #Aftermath talks
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
		(main_hero_fallen),		
      ],
      [
	  (jump_to_menu, "mnu_lost_tavern_duel"),
	  (finish_mission,0)
	  
	  ]),	  
	  
	  
	  #No shooting in the tavern
      (1, 0, 0, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
		
		(get_player_agent_no, ":player_agent"),
		(agent_is_alive, ":player_agent"),
		
		(agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
		(is_between, ":wielded_item", "itm_darts", "itm_torch"),
		(neq, ":wielded_item", "itm_javelin_melee"),
		(neq, ":wielded_item", "itm_throwing_spear_melee"),
		(neq, ":wielded_item", "itm_jarid_melee"),
		(neq, ":wielded_item", "itm_light_throwing_axes_melee"),
		(neq, ":wielded_item", "itm_throwing_axes_melee"),
		(neq, ":wielded_item", "itm_heavy_throwing_axes_melee"),
      ], 
      [
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		##diplomacy start+
		#Turn of this !@#$%ing obnoxious and totally illogical restriction provided:
		(try_begin),
			#1) there is an actual fight
			(gt, "$g_main_attacker_agent", 0),
			(agent_is_alive, "$g_main_attacker_agent"),
			(neg|agent_is_wounded, "$g_main_attacker_agent"),
			#2) the player is the lord of this town, a mercenary captain in the kingdom's employ, or ruler of this kingdom
			(store_faction_of_party , ":center_faction", "$g_encountered_party"),
			(this_or_next|eq, ":center_faction", "$players_kingdom"),
				(eq, ":center_faction", "fac_player_supporters_faction"),
		(else_try),
		#Else, original behavior:
			(start_mission_conversation, ":tavernkeeper"),
		(try_end),
		##diplomacy stop+
	  ]),
	  	  	  
	  #Check for weapon in hand of attacker, also, everyone gets out of the way
      (1, 0, 0, 
      [
		(gt, "$g_main_attacker_agent", 0),	
      ],
      [
        (agent_get_wielded_item, ":wielded_item", "$g_main_attacker_agent", 0),
        (val_max, "$g_attacker_drawn_weapon", ":wielded_item"),               
        
        (call_script, "script_neutral_behavior_in_fight"),
      ]),	  
#Random event	  
      (3, 3, 3, 
      [
		(neg|conversation_screen_is_active),
	    (eq, "$g_main_attacker_agent", 0),
      ],
      [
	          (display_message, "@debug: trigger fired"),
	  (try_begin),
		(eq, "$townsman_burst_in", 0),	
        (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
        (gt, ":tavern_traveler", 0),
		#(store_random_in_range, ":random_chance_of_burst_in", 0, 3),
		#(eq, ":random_chance_of_burst_in", 1), #random chance disabled for now
		(assign, "$townsman_burst_in", 1),	
        (display_message, "@debug: in 9 seconds the theivery victim will appear"),
	  (else_try),	
	          (display_message, "@debug: global townsman_burst_in not 0"),
		(eq, "$townsman_burst_in", 1),
	          (display_message, "@debug: townsman_should burst_in"),
		#	  (entry_point_get_position, pos1, 0), #tried this, didn't work
		#(add_visitors_to_current_scene, pos1, "trp_townsman_whos_money_was_stolen", 1),
		(store_current_scene, ":cur_scene"),
        (modify_visitors_at_site, ":cur_scene"), #suggested by kalarhan
                 #(add_visitors_to_current_scene, 0, "trp_townsman_whos_money_was_stolen", 1, 0) 
		(add_visitors_to_current_scene, 0, "trp_townsman_whos_money_was_stolen", 1),
		(assign, "$townsman_burst_in", 2),	
	  (try_end),
      ]),	
	  (1, 0, 0, 
      [
		(neg|conversation_screen_is_active),
		(eq, "$townsman_burst_in", 2),	
	    (eq, "$g_main_attacker_agent", 0),
      ],
      [
        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
          (eq, ":troop_no", ":tavern_traveler"), 
          (agent_get_position, pos50, ":agent_no"),
        (try_end),
        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (eq, ":troop_no", "trp_townsman_whos_money_was_stolen"),
          (party_get_slot, ":tavern_traveler", "$current_town", slot_center_tavern_traveler),
          (gt, ":tavern_traveler", 0),
          (agent_set_scripted_destination, ":agent_no", pos50),
          (agent_get_position, pos1, ":agent_no"),
          (get_distance_between_positions, ":dist", pos50, pos1),
          (le, ":dist", 200),       
          (start_mission_conversation, ":troop_no"),
        (try_end),
      ]),	  	
    ] + bodyguard_triggers,
  ),
have you tried  others entry points ?
 
kalarhan said:
Zephilinox said:
Is it possible to add new food and trade goods without breaking clothing?

using modules that is easy. Just make sure:
1) You add them in the same area/order the others are now. So new goods with the old goods, and so on
2) Check the module_constants.py in case you change any range (this file has constants that tell the game when one thing starts and ends, like trade goods).
Code:
trade_goods_begin = "itm_spice"
trade_goods_end = "itm_siege_supply"
food_begin = "itm_smoked_fish"
food_end = "itm_siege_supply"
reference_books_begin = "itm_book_wound_treatment_reference"
reference_books_end   = trade_goods_begin
readable_books_begin = "itm_book_tactics"
readable_books_end   = reference_books_begin
books_begin = readable_books_begin
books_end = reference_books_end
horses_begin = "itm_sumpter_horse"

and many more
3) Recompile the entire game to update items, scripts, etc
4) Update your modules.ini to load any new brf you are adding (graphics, sounds)

Are you sure? that's exactly what I did, but then clothing for every troop got messed up, e.g. bandits were wearing lady clothing.
Code:
  # Food consumables
  ["smoked_fish","Smoked Fish", [("smoked_fish",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 130,weight(30)|abundance(100)|food_quality(50)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["cheese","Cheese", [("cheese_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 150,weight(12)|abundance(100)|food_quality(40)|max_ammo(60),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["honey","Honey", [("honey_pot",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 440,weight(10)|abundance(100)|food_quality(40)|max_ammo(60),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["sausages","Sausages", [("sausages",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 170,weight(20)|abundance(100)|food_quality(40)|max_ammo(80),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["cabbages","Cabbages", [("cabbage",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 60,weight(30)|abundance(100)|food_quality(40)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["dried_meat","Dried Meat", [("smoked_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 170,weight(30)|abundance(100)|food_quality(70)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["fruit","Fruit", [("apple_basket",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 88,weight(40)|abundance(100)|food_quality(40)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["raw_grapes","Grapes", [("grapes_inventory",0)], itp_merchandise|itp_consumable|itp_type_goods, 0, 100,weight(80)|abundance(100)|food_quality(20)|max_ammo(20),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["raw_olives","Olives", [("olive_inventory",0)], itp_merchandise|itp_consumable|itp_type_goods, 0, 150,weight(80)|abundance(100)|food_quality(20)|max_ammo(20),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["grain","Grain", [("wheat_sack",0)], itp_merchandise|itp_type_goods|itp_consumable, 0, 60,weight(60)|abundance(110)|food_quality(50)|max_ammo(50),imodbit_cheap|imodbit_fine|imodbit_exquisite|imodbit_large_bag],
  ["cattle_meat","Beef", [("raw_meat",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 160,weight(40)|abundance(100)|food_quality(80)|max_ammo(100),imodbits_none],
  ["bread","Bread", [("bread_a",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 100,weight(60)|abundance(110)|food_quality(40)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["chicken","Roast Chicken", [("chicken",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 200,weight(20)|abundance(110)|food_quality(40)|max_ammo(100),imodbits_none],
  ["pork","Pork", [("pork",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 150,weight(39)|abundance(100)|food_quality(70)|max_ammo(100),imodbits_none],
  ["butter","Butter", [("butter_pot",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 300,weight(12)|abundance(200)|food_quality(40)|max_ammo(60),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],

  ##BEAN BEGIN - Extra Trade Goods
  #["roast_fish","Roasted Fish", [("fish_roasted_a",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 130,weight(15)|abundance(200)|food_quality(50)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  #["gourd","Gourd", [("gourd",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 100,weight(20)|abundance(100)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  #["corn","Corn", [("maize_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 80,weight(20)|abundance(100)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  #["stew","Stew", [("plate_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 200,weight(40)|abundance(70)|food_quality(200)|max_ammo(20),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  #["turkey","Roast Turkey", [("chicken_roasted",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 300,weight(30)|abundance(100)|food_quality(80)|max_ammo(100),imodbits_none],
  ##BEAN END - Extra Trade Goods
 
Zephilinox said:
Are you sure? that's exactly what I did, but then clothing for every troop got messed up, e.g. bandits were wearing lady clothing.

Somebody said:
The important part is recompiling and starting a new game.

adding troops, items, etc is not savegame compatible. So you need to start a fresh game.

The game has the inventory of troops set with the savegame file. You add new items, thus changing theirs index value (armor xxx was item #999, now its item #1010). If you try to load the old file the game wont know that you changed that piece of gear and it will try to load the old #999 (now something else) for that troop armor.
 
kalarhan said:
Zephilinox said:
Are you sure? that's exactly what I did, but then clothing for every troop got messed up, e.g. bandits were wearing lady clothing.

Somebody said:
The important part is recompiling and starting a new game.

adding troops, items, etc is not savegame compatible. So you need to start a fresh game.

The game has the inventory of troops set with the savegame file. You add new items, thus changing theirs index value (armor xxx was item #999, now its item #1010). If you try to load the old file the game wont know that you changed that piece of gear and it will try to load the old #999 (now something else) for that troop armor.
Somebody said:
The important part is recompiling and starting a new game.

Ah I see, thanks. This is probably because I was reloading the module data instead of restarting warband. I'll try again later when I have time.
 
Zephilinox said:
instead of restarting warband. I'll try again later when I have time.

It is not about restarting the game or reloading modules.

You need to start over... fresh new character, cant continue a old save. New name, new city, level 1 again  :mrgreen:
 
kalarhan said:
Zephilinox said:
instead of restarting warband. I'll try again later when I have time.

It is not about restarting the game or reloading modules.

You need to start over... fresh new character, cant continue a old save. New name, new city, level 1 again  :mrgreen:

Okay, so this is what I've done and clothing is still messed up:

Code:
      (item_set_slot, "itm_roast_fish", slot_item_urban_demand, 16),
      (item_set_slot, "itm_roast_fish", slot_item_rural_demand, 16),
      (item_set_slot, "itm_roast_fish", slot_item_desert_demand, 16),
      (item_set_slot, "itm_roast_fish", slot_item_production_slot, slot_center_fishing_fleet),
      (item_set_slot, "itm_roast_fish", slot_item_production_string, "str_boats"),

      (item_set_slot, "itm_gourd", slot_item_urban_demand, 9),
      (item_set_slot, "itm_gourd", slot_item_rural_demand, 9),
      (item_set_slot, "itm_gourd", slot_item_desert_demand, 9),
      (item_set_slot, "itm_gourd", slot_item_production_slot, slot_center_household_gardens),
      (item_set_slot, "itm_gourd", slot_item_production_string, "str_gardens"),

      (item_set_slot, "itm_corn", slot_item_urban_demand, 8),
      (item_set_slot, "itm_corn", slot_item_rural_demand, 8),
      (item_set_slot, "itm_corn", slot_item_desert_demand, 8),
      (item_set_slot, "itm_corn", slot_item_production_slot, slot_center_household_gardens),
      (item_set_slot, "itm_corn", slot_item_production_string, "str_gardens"),

      (item_set_slot, "itm_stew", slot_item_urban_demand, 30),
      (item_set_slot, "itm_stew", slot_item_rural_demand, 30),
      (item_set_slot, "itm_stew", slot_item_desert_demand, -1),

      (item_set_slot, "itm_turkey", slot_item_urban_demand, 60),
      (item_set_slot, "itm_turkey", slot_item_rural_demand, 15),
      (item_set_slot, "itm_turkey", slot_item_desert_demand, -1),

Code:
      (item_set_slot, "itm_roast_fish", slot_item_food_bonus, 5),
      (item_set_slot, "itm_gourd", slot_item_food_bonus, 3),
      (item_set_slot, "itm_corn", slot_item_food_bonus, 2),
      (item_set_slot, "itm_stew", slot_item_food_bonus, 10),
      (item_set_slot, "itm_turkey", slot_item_food_bonus, 9),

Code:
  ["roast_fish","Roasted Fish", [("fish_roasted_a",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 130,weight(15)|abundance(100)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["gourd","Gourd", [("gourd",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 100,weight(20)|abundance(150)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["corn","Corn", [("maize_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 80,weight(20)|abundance(150)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["stew","Stew", [("plate_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 200,weight(40)|abundance(40)|food_quality(100)|max_ammo(20),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["turkey","Roast Turkey", [("chicken_roasted",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 300,weight(30)|abundance(60)|food_quality(100)|max_ammo(100),imodbits_none],

I placed the items after butter and before siege supplies. I restarted the game, new save, and when I'm in the first scene the bandit is wearing a crown and the merchant is wearing lady clothing.
 
So, remove all your new modifications , recompile and restart new game (new character...)
maybe it's not these new items that cause the problem, but  something you did before !

 
Zephilinox said:
kalarhan said:
Zephilinox said:
instead of restarting warband. I'll try again later when I have time.

It is not about restarting the game or reloading modules.

You need to start over... fresh new character, cant continue a old save. New name, new city, level 1 again  :mrgreen:

Okay, so this is what I've done and clothing is still messed up:

Code:
      (item_set_slot, "itm_roast_fish", slot_item_urban_demand, 16),
      (item_set_slot, "itm_roast_fish", slot_item_rural_demand, 16),
      (item_set_slot, "itm_roast_fish", slot_item_desert_demand, 16),
      (item_set_slot, "itm_roast_fish", slot_item_production_slot, slot_center_fishing_fleet),
      (item_set_slot, "itm_roast_fish", slot_item_production_string, "str_boats"),

      (item_set_slot, "itm_gourd", slot_item_urban_demand, 9),
      (item_set_slot, "itm_gourd", slot_item_rural_demand, 9),
      (item_set_slot, "itm_gourd", slot_item_desert_demand, 9),
      (item_set_slot, "itm_gourd", slot_item_production_slot, slot_center_household_gardens),
      (item_set_slot, "itm_gourd", slot_item_production_string, "str_gardens"),

      (item_set_slot, "itm_corn", slot_item_urban_demand, 8),
      (item_set_slot, "itm_corn", slot_item_rural_demand, 8),
      (item_set_slot, "itm_corn", slot_item_desert_demand, 8),
      (item_set_slot, "itm_corn", slot_item_production_slot, slot_center_household_gardens),
      (item_set_slot, "itm_corn", slot_item_production_string, "str_gardens"),

      (item_set_slot, "itm_stew", slot_item_urban_demand, 30),
      (item_set_slot, "itm_stew", slot_item_rural_demand, 30),
      (item_set_slot, "itm_stew", slot_item_desert_demand, -1),

      (item_set_slot, "itm_turkey", slot_item_urban_demand, 60),
      (item_set_slot, "itm_turkey", slot_item_rural_demand, 15),
      (item_set_slot, "itm_turkey", slot_item_desert_demand, -1),

Code:
      (item_set_slot, "itm_roast_fish", slot_item_food_bonus, 5),
      (item_set_slot, "itm_gourd", slot_item_food_bonus, 3),
      (item_set_slot, "itm_corn", slot_item_food_bonus, 2),
      (item_set_slot, "itm_stew", slot_item_food_bonus, 10),
      (item_set_slot, "itm_turkey", slot_item_food_bonus, 9),

Code:
  ["roast_fish","Roasted Fish", [("fish_roasted_a",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 130,weight(15)|abundance(100)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["gourd","Gourd", [("gourd",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 100,weight(20)|abundance(150)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["corn","Corn", [("maize_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 80,weight(20)|abundance(150)|food_quality(100)|max_ammo(100),imodbit_cheap|imodbit_fine|imodbit_exquisite],
  ["stew","Stew", [("plate_b",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 200,weight(40)|abundance(40)|food_quality(100)|max_ammo(20),imodbit_cheap|imodbit_fine|imodbit_well_made|imodbit_exquisite],
  ["turkey","Roast Turkey", [("chicken_roasted",0)], itp_merchandise|itp_type_goods|itp_consumable|itp_food, 0, 300,weight(30)|abundance(60)|food_quality(100)|max_ammo(100),imodbits_none],

I placed the items after butter and before siege supplies. I restarted the game, new save, and when I'm in the first scene the bandit is wearing a crown and the merchant is wearing lady clothing.

Place the new items before the last ].

However, I guess that these items are not the reason why your merchants are wearing lady clothes. It may be about their sexual preferences :grin:

If you didn't change the item that merchants wear in module_items.py, so probably you changed the item that merchants have in module_troops.py. Otherwise, it doesn't make sense that you added some new items and they changed what they wear :grin:
 
dragos said:
Otherwise, it doesn't make sense that you added some new items and they changed what they wear :grin:

It can happen if you do a partial compilation. Say you only update some files like item_kinds1.txt, but not the troops.txt.

Old troops.txt lists that the guard is wearing item #150. You added new stuff and the helmet is now item #161. But as you did not updated the troops.txt it will reference the wrong item, as it will try to use the #150... which is now a piece of cheese  :mrgreen:

Just a example on how things can go crazy if you don’t do a full compilation or you change something that is not savegame compatible.

 
kalarhan said:
dragos said:
Otherwise, it doesn't make sense that you added some new items and they changed what they wear :grin:

It can happen if you do a partial compilation. Say you only update some files like item_kinds1.txt, but not the troops.txt.

Old troops.txt lists that the guard is wearing item #150. You added new stuff and the helmet is now item #161. But as you did not updated the troops.txt it will reference the wrong item, as it will try to use the #150... which is now a piece of cheese  :mrgreen:

Just a example on how things can go crazy if you don’t do a full compilation or you change something that is not savegame compatible.

I know, that's why it is to better add new things to the end of py files before the last ] :smile:

Edit: What I mean there is that as you know, we give some weapons or armors to troops by using itm_blabla stuff. So if merchants have itm_abc, they should not care the item is placed as #150 or #300. Should they?
 
dragos said:
I know, that's why it is to better add new things to the end of py files before the last ] :smile:

if you do that you will break all the xxx_begin and xxx_end constants, so nope  :wink: . Must respect the order for each kind of stuff.
 
Thanks for the help everyone, I managed to find the issue. I misconfigured WRECK in such a way that it wasn't updating the ID files, so when I added in my new items the ID file for items was screwed up and that was causing the issue. It's all working well now :]
 
Greetings All,

This is not so much about modding as tweaking. I have used TweakMB in the past, but I have recently started using mods that TweakMB does not support. I would like to know how to find the party size and morale modifiers in scripts.txt. I have read tutorials on finding them, but the tutorial is a picture that shows their exact location, and that only works in the version described. I am asking how to find those values in any module. Is it just through experimentation, or is there a tool to use? Do I need the mod's source? Any and all help is greatly appreciated.

Respectfully,

Draconis
 
Imperator Draconis said:
Greetings All,

This is not so much about modding as tweaking. I have used TweakMB in the past, but I have recently started using mods that TweakMB does not support. I would like to know how to find the party size and morale modifiers in scripts.txt. I have read tutorials on finding them, but the tutorial is a picture that shows their exact location, and that only works in the version described. I am asking how to find those values in any module. Is it just through experimentation, or is there a tool to use? Do I need the mod's source? Any and all help is greatly appreciated.

Respectfully,

Draconis

mod source makes that easier as you can read the code and you will know what/where to make the changes.

With only text files you could try following the same tweak from native/other mods. If your current mod uses the same script it is easy to find what to change, otherwise you will have to go deep and learn about OPCODES and bitnum and masks and... in other words, not soo easy.

Find the script TweakMB changed. Then look at your mod file for the same script. When you see big number like 934324234234234 ignore the last 6ish numbers and it should be similar on both (in the example below the red numbers)

npc_get_troop_wage -1
14 21 1 1224979098644774912 2133 2 1224979098644774913 0 4 0 1507 1 1224979098644774912 5 0 2171 2 1224979098644774913 1224979098644774912  ....

You can also use REGEX to make a search/replace that will handle that.

TLDR: stuff in red changes, rest wont unless there is new code for the mod.

Cheers
 
kalarhan said:
Imperator Draconis said:
Greetings All,

This is not so much about modding as tweaking. I have used TweakMB in the past, but I have recently started using mods that TweakMB does not support. I would like to know how to find the party size and morale modifiers in scripts.txt. I have read tutorials on finding them, but the tutorial is a picture that shows their exact location, and that only works in the version described. I am asking how to find those values in any module. Is it just through experimentation, or is there a tool to use? Do I need the mod's source? Any and all help is greatly appreciated.

Respectfully,

Draconis

mod source makes that easier as you can read the code and you will know what/where to make the changes.

With only text files you could try following the same tweak from native/other mods. If your current mod uses the same script it is easy to find what to change, otherwise you will have to go deep and learn about OPCODES and bitnum and masks and... in other words, not soo easy.

Find the script TweakMB changed. Then look at your mod file for the same script. When you see big number like 934324234234234 ignore the last 6ish numbers and it should be similar on both (in the example below the red numbers)

npc_get_troop_wage -1
14 21 1 1224979098644774912 2133 2 1224979098644774913 0 4 0 1507 1 1224979098644774912 5 0 2171 2 1224979098644774913 1224979098644774912  ....

You can also use REGEX to make a search/replace that will handle that.

TLDR: stuff in red changes, rest wont unless there is new code for the mod.

Cheers

Hello again,

The native/other mods' values are different than the script I am talking about. I am playing Gekokujo, and I cannot find the same sequence of numbers as in Native. I am specifically asking where to find those values for Gekokujo. Note that I am not asking you to do it for me. I see this as a learning process. Do you have any recommendations for learning more about OPCODES, bitnum, and masks?

Respectfully,

Draconis
 
Status
Not open for further replies.
Back
Top Bottom