Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
MadGuarang said:
1. Which kind of merchant you want to add? Somebody like Book Merchant (1a) or like Armor Merchant(1b)?
i know how to add someone like book merchant (i already have two persons made and added they sell information and secrets of families and ...etc)
and yes what i'm trying to add is someone like armor merchant (they have their own scenes here is another example : when you enter a town you shall see a menu " visit the temple" in there you will find some monks walking around ...etc and you will have the leader or the head of that temple near the statue(Buddha here) you can speak with him do things and as well buy stuff related to Buddha and to religion ...etc)

MadGuarang said:
2b - this is bit more tricky. Because his inventory is refreshable. To refresh inventory of this merchant you can check this script:

Code:
 # script_refresh_center_weaponsmiths
  ("refresh_center_weaponsmiths",
  [
    (reset_item_probabilities, 100),
    (set_merchandise_modifier_quality, 150),
    (try_for_range, ":cur_merchant", weapon_merchants_begin, weapon_merchants_end),
	  (store_sub, ":cur_town", ":cur_merchant", weapon_merchants_begin),
      (val_add, ":cur_town", towns_begin), 
	  (troop_clear_inventory, ":cur_merchant"),
      #(party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
	  (store_faction_of_party, ":cur_faction", ":cur_town"),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_musket, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bullets, 4),
	  
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"), 
      (store_troop_gold, reg6, ":cur_merchant"),
      (lt, reg6, 1000),
      
	 
	 #banks start
	  (assign, "$merchant_gold_bonus",0),
	 (try_for_range, ":cur_town", towns_begin, towns_end),
          (party_slot_eq, ":cur_town", slot_center_has_bank, 1),
	      (val_add, "$merchant_gold_bonus",1000),
	 (try_end),
	 (store_random_in_range, ":new_gold", 250, 1500),
          (val_add, ":new_gold","$merchant_gold_bonus"),
	 #banks end
	 
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (try_end),
	
	
	(try_for_range, ":cur_merchant", ransom_brokers_begin, ransom_brokers_end),
	  (store_sub, ":cur_town", ":cur_merchant", ransom_brokers_begin),
      (val_add, ":cur_town", towns_begin), 
	  (troop_clear_inventory, ":cur_merchant"),
	  
	  
	  
	  (reset_item_probabilities, 150),
      (set_merchandise_modifier_quality, 300),
	
      #(party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
	  (assign, ":cur_faction", "fac_outlaws"),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_musket, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bullets, 2),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_horse, 8),
	   (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_body_armor, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_head_armor, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_foot_armor, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_hand_armor, 4),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_goods, 4),
	 
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"), 
      (store_troop_gold, reg6, ":cur_merchant"),
      (lt, reg6, 10000),
	  
	  #banks start
	  (assign, "$merchant_gold_bonus",0),
	 (try_for_range, ":cur_town", towns_begin, towns_end),
          (party_slot_eq, ":cur_town", slot_center_has_bank, 1),
	      (val_add, "$merchant_gold_bonus",2000),
	 (try_end),
	 (store_random_in_range, ":new_gold", 5000, 15000),
          (val_add, ":new_gold","$merchant_gold_bonus"),
	 #banks end
	 
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (try_end),
	  
	  
  ]),

this part decides that I want to refresh inventory of ransom broker (which in my mod are also merchants) and how many of what item types will it sell:
Code:
(try_for_range, ":cur_merchant", ransom_brokers_begin, ransom_brokers_end),
	  (store_sub, ":cur_town", ":cur_merchant", ransom_brokers_begin),
      (val_add, ":cur_town", towns_begin), 
	  (troop_clear_inventory, ":cur_merchant"),
	  
	  
	  
	  (reset_item_probabilities, 150),
      (set_merchandise_modifier_quality, 300),
	
      #(party_get_slot, ":cur_faction", ":cur_town", slot_center_original_faction),
	  (assign, ":cur_faction", "fac_outlaws"),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 3),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 2),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 2),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_musket, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bullets, 2),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_horse, 8),
	   (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_body_armor, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_head_armor, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_foot_armor, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_hand_armor, 4),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_goods, 4),
	 
      (troop_ensure_inventory_space, ":cur_merchant", merchant_inventory_space),
      (troop_sort_inventory, ":cur_merchant"), 
      (store_troop_gold, reg6, ":cur_merchant"),
      (lt, reg6, 10000),
	  
	 
	 
      (call_script, "script_troop_add_gold", ":cur_merchant", ":new_gold"),
    (try_end),

it adds to all ransom brokers specified items
do i need to use merchandise type like the one above(armor) or can i use any merchandise type i have /want ?
MadGuarang said:
if you wanna make geisha your own special merchant you can point them in constants like me brokers
Code:
ransom_brokers_begin = "trp_ransom_broker_1"
ransom_brokers_end   = tavern_travelers_begin
that's what i'm planning to do organized work means easier work

MadGuarang said:
2.  I can't help you with that however... You could add this item to your character and for example plug out this character from checking companions inventory, I mean if this characters item could be accesed by dialog, just disable dialog line for him.
Code:
(neq, $talk_troop), "trp_my_companion"
....
this isn't for companions its for certain NPCs in towns and certain Daimyo (Kings/Lords) so i don't think this will work the same for it ? or i'm i wrong ?

thanks for the help by the way!
 
do i need to use merchandise type like the one above(armor) or can i use any merchandise type i have /want ?

I just used 'armorer' script, so whenever armourer inventory will refresh, this merchant also. You can find any other place or make your own script if you wish refresh inventory not so often, for example. As I am not good coder I always try to keep it simple and use somethng that I know it works...

TYPES of weapon and amounts (whichj kind of item and how many) are in the cript I gave you:
Code:
 (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_one_handed_wpn, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_two_handed_wpn, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_polearm, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_shield, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bow, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_crossbow, 8),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_thrown, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_arrows, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bolts, 6),
	  (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_pistol, 6),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_musket, 4),
      (troop_add_merchandise_with_faction, ":cur_merchant", ":cur_faction", itp_type_bullets, 4),


this isn't for companions its for certain NPCs in towns and certain Daimyo (Kings/Lords) so i don't think this will work the same for it ? or i'm i wrong ?
yes, this should work the same... if you just want to block dialog like "Show me your inventory", but this will rather not block merchants inventory.

You can use this in dialog like this:

Code:
(neq, "$g_talk_troop", "$g_player_minister"),
so something will not happen if troop with you talk with is your minister, or
Code:
[anyone|plyr,"party_encounter_hostile_defender", [(this_or_next|neq, "$g_encountered_party_faction", "fac_player_supporters_faction"),(neq, "$g_encountered_party_faction", "$players_kingdom")], "Surrender or die!", "party_encounter_hostile_ultimatum_surrender", 
whicj means that 2 thing cannot happen if you want to say "Surrender or die" - encountered party cannot be your supporters or cannot belong to your faction... You can ctrl+f (search all) for
Code:
(neq,
and you'll find a lot of examples how to negate any option.

I am not sure in which situation you want to negate right to see inventory...

thanks for the help by the way!
- you're welcoe, I did get a lot help here, so just paying my debts :smile:
 
kalarhan said:
maater66241 said:
I feel like I'm doing something very wrong...

looks like you didn't do the test

Code:
export_dir = ""

Well, I finally was able to do the test and got this:
Initializing...
variables.txt not found. Creating new variables.txt file
Compiling all global variables...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Traceback (most recent call last):
  File "process_global_variables.py", line 106, in <module>
    save_variables(export_dir, variables,variable_uses)
  File "C:\Users\David\Desktop\Red Wars ModSys\source redwars 1.90\Red Wars Modsys Original\process_operations.py", line 171, in save_variables
    file = open(export_dir + "variables.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/variables.txt'
Exporting strings...
Traceback (most recent call last):
  File "process_strings.py", line 26, in <module>
    save_strings(strings)
  File "process_strings.py", line 9, in save_strings
    ofile = open(export_dir + "strings.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/strings.txt'
Exporting skills...
Traceback (most recent call last):
  File "process_skills.py", line 32, in <module>
    save_skills()
  File "process_skills.py", line 15, in save_skills
    ofile = open(export_dir + "skills.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/skills.txt'
Exporting tracks...
Traceback (most recent call last):
  File "process_music.py", line 23, in <module>
    save_tracks()
  File "process_music.py", line 15, in save_tracks
    file = open(export_dir + "music.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/music.txt'
Exporting animations...
Traceback (most recent call last):
  File "process_animations.py", line 61, in <module>
    write_actions(animations,len(action_codes),action_codes,"actions.txt")
  File "process_animations.py", line 24, in write_actions
    file = open(export_dir + file_name,"w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/actions.txt'
Exporting meshes...
Traceback (most recent call last):
  File "process_meshes.py", line 25, in <module>
    save_meshes()
  File "process_meshes.py", line 9, in save_meshes
    ofile = open(export_dir + "meshes.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/meshes.txt'
Exporting sounds...
Traceback (most recent call last):
  File "process_sounds.py", line 51, in <module>
    write_sounds(sound_samples, sounds)
  File "process_sounds.py", line 13, in write_sounds
    ofile = open(export_dir + "sounds.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/sounds.txt'
Exporting skins...
Traceback (most recent call last):
  File "process_skins.py", line 105, in <module>
    export_skins(skins)
  File "process_skins.py", line 45, in export_skins
    ofile = open(export_dir + "skins.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/skins.txt'
Exporting map icons...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_map_icons.py", line 38, in <module>
    save_map_icons(variables,variable_uses,tag_uses,quick_strings)
  File "process_map_icons.py", line 9, in save_map_icons
    ofile = open(export_dir + "map_icons.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/map_icons.txt'
Exporting faction data...
Traceback (most recent call last):
  File "process_factions.py", line 70, in <module>
    save_factions(relations)
  File "process_factions.py", line 34, in save_factions
    file = open(export_dir + "factions.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/factions.txt'
Exporting item data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 19, in write_items
    ofile = open(itemkinds_file_name,"w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/item_kinds1.txt'
Exporting scene data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scenes.py", line 77, in <module>
    save_scenes(variables,variable_uses,tag_uses)
  File "process_scenes.py", line 46, in save_scenes
    ofile = open(export_dir + "scenes.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scenes.txt'
Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 13, in save_troops
    file = open(export_dir + "troops.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/troops.txt'
Exporting particle data...
Traceback (most recent call last):
  File "process_particle_sys.py", line 61, in <module>
    save_particle_systems()
  File "process_particle_sys.py", line 29, in save_particle_systems
    ofile = open(export_dir + "particle_systems.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/particle_systems.txt'
Exporting scene props...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scene_props.py", line 32, in <module>
    save_scene_props(variables,variable_uses,tag_uses,quick_strings)
  File "process_scene_props.py", line 10, in save_scene_props
    ofile = open(export_dir + "scene_props.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scene_props.txt'
Exporting tableau materials data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_tableau_materials.py", line 31, in <module>
    save_tableau_materials(variables,variable_uses,tag_uses,quick_strings)
  File "process_tableau_materials.py", line 11, in save_tableau_materials
    ofile = open(export_dir + "tableau_materials.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/tableau_materials.txt'
Exporting presentations...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_presentations.py", line 33, in <module>
    save_presentations(variables,variable_uses,tag_uses,quick_strings)
  File "process_presentations.py", line 11, in save_presentations
    ofile = open(export_dir + "presentations.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/presentations.txt'
Exporting party_template data...
Traceback (most recent call last):
  File "process_party_tmps.py", line 46, in <module>
    save_party_templates()
  File "process_party_tmps.py", line 20, in save_party_templates
    file = open(export_dir + "party_templates.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/party_templates.txt'
Exporting parties
Creating new tag_uses.txt file...
Traceback (most recent call last):
  File "process_parties.py", line 69, in <module>
    save_parties(parties)
  File "process_parties.py", line 12, in save_parties
    file = open(export_dir + "parties.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/parties.txt'
Exporting quest data...
Traceback (most recent call last):
  File "process_quests.py", line 30, in <module>
    save_quests()
  File "process_quests.py", line 9, in save_quests
    ofile = open(export_dir + "quests.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/quests.txt'
Exporting info_page data...
Traceback (most recent call last):
  File "process_info_pages.py", line 26, in <module>
    save_info_pages()
  File "process_info_pages.py", line 9, in save_info_pages
    ofile = open(export_dir + "info_pages.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/info_pages.txt'
Exporting scripts...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scripts.py", line 40, in <module>
    save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
  File "process_scripts.py", line 10, in save_scripts
    file = open(export_dir + "scripts.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scripts.txt'
Exporting mission_template data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_mission_tmps.py", line 64, in <module>
    save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 38, in save_mission_templates
    file = open(export_dir + "mission_templates.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/mission_templates.txt'
Exporting game menus data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 22, in save_game_menus
    ofile = open(export_dir + "menus.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/menus.txt'
exporting simple triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_simple_triggers.py", line 24, in <module>
    save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_strings)
  File "process_simple_triggers.py", line 8, in save_simple_triggers
    file = open(export_dir + "simple_triggers.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/simple_triggers.txt'
exporting triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_dialogs.py", line 199, in <module>
    save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings)
  File "process_dialogs.py", line 47, in save_triggers
    file = open(export_dir + "triggers.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/triggers.txt'
Checking global variable usages...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Exporting postfx_params...
Traceback (most recent call last):
  File "process_postfx.py", line 27, in <module>
    write_postfx_params(postfx_params)
  File "process_postfx.py", line 13, in write_postfx_params
    ofile = open(export_dir + "postfx.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/postfx.txt'

______________________________

Script processing has ended.
Press any key to exit. . .

Also, another thing: how does one add melee mode to a weapon (rifle)?

Last question: If we use an automatic weapon as our template to create another weapon, does that mean that the weapon we will be creating will also be automatic?
 
maater66241 said:
Well, I finally was able to do the test and got this:

    save_variables(export_dir, variables,variable_uses)
  File "C:\Users\David\Desktop\Red Wars ModSys\source redwars 1.90\Red Wars Modsys Original\process_operations.py",

no you didn't. Read the error message above. It says

export_dir = "C:\Users\David\Desktop\Red Wars ModSys\source redwars 1.90\Red Wars Modsys Original\"  (ignore the slash)

while you should be compiling your code locally (Desktop, same folder, with a empty export_dir).

I don't know where you are changing your values, but you are not updating and saving the module_info.py from your modsys
 
A question about module_skins.py:

I've figured out how the face textures can be edited\replaced, but if I want to add new face textures (skins) to choose from instead of editing an existing one, how could I do it?

The textures are referred to as manface_basic, womanface_basic etc. in the file, but I can't find where it is defined which texture files they relate to. I've checked header_skins.py and there seems to be nothing useful there.
 
Fearg said:
but I can't find where it is defined which texture files they relate to

check module_skins.py comments (as any module_XXX.py file) to learn how the data is organized. Then find your entry, count the elements and find what you need

Code:
# 10) List of hair textures.

    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures

as usual you should keep in mind that trash code exists on the modsys, so look at the meshes first  :mrgreen:
 
HyperCharge said:
reduce load time of game_start script

optimize your code. You will need to split it in sections/parts and see which ones are slow, and then decide how to improve them (change code, run that code later, etc)
 
kalarhan said:
Fearg said:
but I can't find where it is defined which texture files they relate to

check module_skins.py comments (as any module_XXX.py file) to learn how the data is organized. Then find your entry, count the elements and find what you need

Sorry mate, its not like I'm too lazy to do the legwork, I've already read through all of that, and I just can't get my head around how those variables, which obviously reference specific .dds files are defined... like how each face texture is tied to a .dds texture? Have been looking for a good tutorial but nothing's come up
 
Code:
("manface_7",0xffc0c8c8,["hair_blonde"],[0xff171313, 0xff007080c]),
manface_7 is the material that maps to a set of textures, it's declared in one of the CommonRes BRF files. Copy-paste it (with the copy-complete function) and rename both the material and texture references to your own BRF file. You can re-use Native's aged texture and normal maps or generate your own set.
 
Fearg said:
which obviously reference specific .dds files are defined...

see @Somebody reply above. Also: get OpenBRF (tools section), set the current module to yours and use CTRL+F to search. You can then type the name of a texture, material, mesh ... and find it in any of your files (including the base game ones). Click on them to see the data and flags. A mesh, as a example, will have a texture and material applied. And so on.
 
kalarhan said:
maater66241 said:
Well, I finally was able to do the test and got this:

    save_variables(export_dir, variables,variable_uses)
  File "C:\Users\David\Desktop\Red Wars ModSys\source redwars 1.90\Red Wars Modsys Original\process_operations.py",

no you didn't. Read the error message above. It says

export_dir = "C:\Users\David\Desktop\Red Wars ModSys\source redwars 1.90\Red Wars Modsys Original\"  (ignore the slash)

while you should be compiling your code locally (Desktop, same folder, with a empty export_dir).

I don't know where you are changing your values, but you are not updating and saving the module_info.py from your modsys

Hmmm...I'm a bit confused. The export_dir has always stayed as "", ever since you told me what to do. I've never changed anything aside from the comment, which recently, I changed that to "" . I left the folder as they were.

Well, I moved the source red wars 1.90 (which contained the modsys) to my desktop and ran the build module
Initializing...
variables.txt not found. Creating new variables.txt file
Compiling all global variables...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Traceback (most recent call last):
  File "process_global_variables.py", line 106, in <module>
    save_variables(export_dir, variables,variable_uses)
  File "C:\Users\David\Desktop\source redwars 1.90\Red Wars Modsys Original\process_operations.py", line 171, in save_variables
    file = open(export_dir + "variables.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/variables.txt'
Exporting strings...
Traceback (most recent call last):
  File "process_strings.py", line 26, in <module>
    save_strings(strings)
  File "process_strings.py", line 9, in save_strings
    ofile = open(export_dir + "strings.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/strings.txt'
Exporting skills...
Traceback (most recent call last):
  File "process_skills.py", line 32, in <module>
    save_skills()
  File "process_skills.py", line 15, in save_skills
    ofile = open(export_dir + "skills.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/skills.txt'
Exporting tracks...
Traceback (most recent call last):
  File "process_music.py", line 23, in <module>
    save_tracks()
  File "process_music.py", line 15, in save_tracks
    file = open(export_dir + "music.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/music.txt'
Exporting animations...
Traceback (most recent call last):
  File "process_animations.py", line 61, in <module>
    write_actions(animations,len(action_codes),action_codes,"actions.txt")
  File "process_animations.py", line 24, in write_actions
    file = open(export_dir + file_name,"w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/actions.txt'
Exporting meshes...
Traceback (most recent call last):
  File "process_meshes.py", line 25, in <module>
    save_meshes()
  File "process_meshes.py", line 9, in save_meshes
    ofile = open(export_dir + "meshes.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/meshes.txt'
Exporting sounds...
Traceback (most recent call last):
  File "process_sounds.py", line 51, in <module>
    write_sounds(sound_samples, sounds)
  File "process_sounds.py", line 13, in write_sounds
    ofile = open(export_dir + "sounds.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/sounds.txt'
Exporting skins...
Traceback (most recent call last):
  File "process_skins.py", line 105, in <module>
    export_skins(skins)
  File "process_skins.py", line 45, in export_skins
    ofile = open(export_dir + "skins.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/skins.txt'
Exporting map icons...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_map_icons.py", line 38, in <module>
    save_map_icons(variables,variable_uses,tag_uses,quick_strings)
  File "process_map_icons.py", line 9, in save_map_icons
    ofile = open(export_dir + "map_icons.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/map_icons.txt'
Exporting faction data...
Traceback (most recent call last):
  File "process_factions.py", line 70, in <module>
    save_factions(relations)
  File "process_factions.py", line 34, in save_factions
    file = open(export_dir + "factions.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/factions.txt'
Exporting item data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 19, in write_items
    ofile = open(itemkinds_file_name,"w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/item_kinds1.txt'
Exporting scene data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scenes.py", line 77, in <module>
    save_scenes(variables,variable_uses,tag_uses)
  File "process_scenes.py", line 46, in save_scenes
    ofile = open(export_dir + "scenes.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scenes.txt'
Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 13, in save_troops
    file = open(export_dir + "troops.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/troops.txt'
Exporting particle data...
Traceback (most recent call last):
  File "process_particle_sys.py", line 61, in <module>
    save_particle_systems()
  File "process_particle_sys.py", line 29, in save_particle_systems
    ofile = open(export_dir + "particle_systems.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/particle_systems.txt'
Exporting scene props...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scene_props.py", line 32, in <module>
    save_scene_props(variables,variable_uses,tag_uses,quick_strings)
  File "process_scene_props.py", line 10, in save_scene_props
    ofile = open(export_dir + "scene_props.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scene_props.txt'
Exporting tableau materials data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_tableau_materials.py", line 31, in <module>
    save_tableau_materials(variables,variable_uses,tag_uses,quick_strings)
  File "process_tableau_materials.py", line 11, in save_tableau_materials
    ofile = open(export_dir + "tableau_materials.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/tableau_materials.txt'
Exporting presentations...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_presentations.py", line 33, in <module>
    save_presentations(variables,variable_uses,tag_uses,quick_strings)
  File "process_presentations.py", line 11, in save_presentations
    ofile = open(export_dir + "presentations.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/presentations.txt'
Exporting party_template data...
Traceback (most recent call last):
  File "process_party_tmps.py", line 46, in <module>
    save_party_templates()
  File "process_party_tmps.py", line 20, in save_party_templates
    file = open(export_dir + "party_templates.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/party_templates.txt'
Exporting parties
Creating new tag_uses.txt file...
Traceback (most recent call last):
  File "process_parties.py", line 69, in <module>
    save_parties(parties)
  File "process_parties.py", line 12, in save_parties
    file = open(export_dir + "parties.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/parties.txt'
Exporting quest data...
Traceback (most recent call last):
  File "process_quests.py", line 30, in <module>
    save_quests()
  File "process_quests.py", line 9, in save_quests
    ofile = open(export_dir + "quests.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/quests.txt'
Exporting info_page data...
Traceback (most recent call last):
  File "process_info_pages.py", line 26, in <module>
    save_info_pages()
  File "process_info_pages.py", line 9, in save_info_pages
    ofile = open(export_dir + "info_pages.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/info_pages.txt'
Exporting scripts...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scripts.py", line 40, in <module>
    save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
  File "process_scripts.py", line 10, in save_scripts
    file = open(export_dir + "scripts.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scripts.txt'
Exporting mission_template data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_mission_tmps.py", line 64, in <module>
    save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 38, in save_mission_templates
    file = open(export_dir + "mission_templates.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/mission_templates.txt'
Exporting game menus data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 22, in save_game_menus
    ofile = open(export_dir + "menus.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/menus.txt'
exporting simple triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_simple_triggers.py", line 24, in <module>
    save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_strings)
  File "process_simple_triggers.py", line 8, in save_simple_triggers
    file = open(export_dir + "simple_triggers.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/simple_triggers.txt'
exporting triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_dialogs.py", line 199, in <module>
    save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings)
  File "process_dialogs.py", line 47, in save_triggers
    file = open(export_dir + "triggers.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/triggers.txt'
Checking global variable usages...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Exporting postfx_params...
Traceback (most recent call last):
  File "process_postfx.py", line 27, in <module>
    write_postfx_params(postfx_params)
  File "process_postfx.py", line 13, in write_postfx_params
    ofile = open(export_dir + "postfx.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/postfx.txt'

______________________________

Script processing has ended.
Press any key to exit. . .

Then, I pulled the modsys out of that folder, onto the desktop
Initializing...
variables.txt not found. Creating new variables.txt file
Compiling all global variables...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Traceback (most recent call last):
  File "process_global_variables.py", line 106, in <module>
    save_variables(export_dir, variables,variable_uses)
  File "C:\Users\David\Desktop\Red Wars Modsys Original\process_operations.py", line 171, in save_variables
    file = open(export_dir + "variables.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/variables.txt'
Exporting strings...
Traceback (most recent call last):
  File "process_strings.py", line 26, in <module>
    save_strings(strings)
  File "process_strings.py", line 9, in save_strings
    ofile = open(export_dir + "strings.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/strings.txt'
Exporting skills...
Traceback (most recent call last):
  File "process_skills.py", line 32, in <module>
    save_skills()
  File "process_skills.py", line 15, in save_skills
    ofile = open(export_dir + "skills.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/skills.txt'
Exporting tracks...
Traceback (most recent call last):
  File "process_music.py", line 23, in <module>
    save_tracks()
  File "process_music.py", line 15, in save_tracks
    file = open(export_dir + "music.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/music.txt'
Exporting animations...
Traceback (most recent call last):
  File "process_animations.py", line 61, in <module>
    write_actions(animations,len(action_codes),action_codes,"actions.txt")
  File "process_animations.py", line 24, in write_actions
    file = open(export_dir + file_name,"w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/actions.txt'
Exporting meshes...
Traceback (most recent call last):
  File "process_meshes.py", line 25, in <module>
    save_meshes()
  File "process_meshes.py", line 9, in save_meshes
    ofile = open(export_dir + "meshes.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/meshes.txt'
Exporting sounds...
Traceback (most recent call last):
  File "process_sounds.py", line 51, in <module>
    write_sounds(sound_samples, sounds)
  File "process_sounds.py", line 13, in write_sounds
    ofile = open(export_dir + "sounds.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/sounds.txt'
Exporting skins...
Traceback (most recent call last):
  File "process_skins.py", line 105, in <module>
    export_skins(skins)
  File "process_skins.py", line 45, in export_skins
    ofile = open(export_dir + "skins.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/skins.txt'
Exporting map icons...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_map_icons.py", line 38, in <module>
    save_map_icons(variables,variable_uses,tag_uses,quick_strings)
  File "process_map_icons.py", line 9, in save_map_icons
    ofile = open(export_dir + "map_icons.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/map_icons.txt'
Exporting faction data...
Traceback (most recent call last):
  File "process_factions.py", line 70, in <module>
    save_factions(relations)
  File "process_factions.py", line 34, in save_factions
    file = open(export_dir + "factions.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/factions.txt'
Exporting item data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_items.py", line 72, in <module>
    write_items(variables,variable_uses,tag_uses,quick_strings)
  File "process_items.py", line 19, in write_items
    ofile = open(itemkinds_file_name,"w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/item_kinds1.txt'
Exporting scene data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scenes.py", line 77, in <module>
    save_scenes(variables,variable_uses,tag_uses)
  File "process_scenes.py", line 46, in save_scenes
    ofile = open(export_dir + "scenes.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scenes.txt'
Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 13, in save_troops
    file = open(export_dir + "troops.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/troops.txt'
Exporting particle data...
Traceback (most recent call last):
  File "process_particle_sys.py", line 61, in <module>
    save_particle_systems()
  File "process_particle_sys.py", line 29, in save_particle_systems
    ofile = open(export_dir + "particle_systems.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/particle_systems.txt'
Exporting scene props...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scene_props.py", line 32, in <module>
    save_scene_props(variables,variable_uses,tag_uses,quick_strings)
  File "process_scene_props.py", line 10, in save_scene_props
    ofile = open(export_dir + "scene_props.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scene_props.txt'
Exporting tableau materials data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_tableau_materials.py", line 31, in <module>
    save_tableau_materials(variables,variable_uses,tag_uses,quick_strings)
  File "process_tableau_materials.py", line 11, in save_tableau_materials
    ofile = open(export_dir + "tableau_materials.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/tableau_materials.txt'
Exporting presentations...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_presentations.py", line 33, in <module>
    save_presentations(variables,variable_uses,tag_uses,quick_strings)
  File "process_presentations.py", line 11, in save_presentations
    ofile = open(export_dir + "presentations.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/presentations.txt'
Exporting party_template data...
Traceback (most recent call last):
  File "process_party_tmps.py", line 46, in <module>
    save_party_templates()
  File "process_party_tmps.py", line 20, in save_party_templates
    file = open(export_dir + "party_templates.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/party_templates.txt'
Exporting parties
Creating new tag_uses.txt file...
Traceback (most recent call last):
  File "process_parties.py", line 69, in <module>
    save_parties(parties)
  File "process_parties.py", line 12, in save_parties
    file = open(export_dir + "parties.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/parties.txt'
Exporting quest data...
Traceback (most recent call last):
  File "process_quests.py", line 30, in <module>
    save_quests()
  File "process_quests.py", line 9, in save_quests
    ofile = open(export_dir + "quests.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/quests.txt'
Exporting info_page data...
Traceback (most recent call last):
  File "process_info_pages.py", line 26, in <module>
    save_info_pages()
  File "process_info_pages.py", line 9, in save_info_pages
    ofile = open(export_dir + "info_pages.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/info_pages.txt'
Exporting scripts...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_scripts.py", line 40, in <module>
    save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
  File "process_scripts.py", line 10, in save_scripts
    file = open(export_dir + "scripts.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/scripts.txt'
Exporting mission_template data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_mission_tmps.py", line 64, in <module>
    save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 38, in save_mission_templates
    file = open(export_dir + "mission_templates.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/mission_templates.txt'
Exporting game menus data...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 22, in save_game_menus
    ofile = open(export_dir + "menus.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/menus.txt'
exporting simple triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_simple_triggers.py", line 24, in <module>
    save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_strings)
  File "process_simple_triggers.py", line 8, in save_simple_triggers
    file = open(export_dir + "simple_triggers.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/simple_triggers.txt'
exporting triggers...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Traceback (most recent call last):
  File "process_dialogs.py", line 199, in <module>
    save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings)
  File "process_dialogs.py", line 47, in save_triggers
    file = open(export_dir + "triggers.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/triggers.txt'
Checking global variable usages...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Exporting postfx_params...
Traceback (most recent call last):
  File "process_postfx.py", line 27, in <module>
    write_postfx_params(postfx_params)
  File "process_postfx.py", line 13, in write_postfx_params
    ofile = open(export_dir + "postfx.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/Program Files (x86)/Mount&Blade Warband/Modules/The Red Wars/postfx.txt'

______________________________

Script processing has ended.
Press any key to exit. . .
 
kalarhan said:
HyperCharge said:
reduce load time of game_start script

optimize your code. You will need to split it in sections/parts and see which ones are slow, and then decide how to improve them (change code, run that code later, etc)

I found a solution. I was added 46 kingdoms (total 52) to my mod, because of my "age system"(kingdoms being activated by specific years. Etc. The timurids arent exist in 1300, but in 1370, they are exist). When i deactivated the kingdoms that i added, game_start script loaded in 36 seconds!

And I arrived at the conclusion that the reason of this lateness is these code blocks;

Code:
(try_for_range, ":kingdom", kingdoms_begin, kingdoms_end),
        (call_script, "script_evaluate_realm_stability", ":kingdom"),
      (try_end),


Code:
(try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
        (call_script, "script_update_faction_notes", ":cur_kingdom"),
        (store_random_in_range, ":random_no", -60, 0),
        (faction_set_slot, ":faction_no", slot_faction_last_offensive_concluded, ":random_no"),
      (try_end),


Code:
(try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
        (call_script, "script_faction_recalculate_strength", ":faction_no"),
      (try_end),

These 3 scripts are called for every single one of kingdoms in game_start. that means 3x52 = 156(!)

What can I do to solve this ? remove the kingdoms that need to be activated and rename it one of existing kingdoms when it needs to be activated or call these in seperated parts in start game?
 
HyperCharge said:
What can I do to solve this ? remove the kingdoms that need to be activated and rename it one of existing kingdoms when it needs to be activated or call these in seperated parts in start game?

if a kingdom is dead/not active you don't need to setup flags for it, right? So execute those scripts when your event that jumps up in time needs it

and if your jumps are that big you will need to create a game_start script for each timeslot anyway (to setup the new economy, centers, lords, factions, etc). Call them game_start_1300, game_start_1370, game_start_1500, etc and have the trigger execute them
 
kalarhan said:
HyperCharge said:
What can I do to solve this ? remove the kingdoms that need to be activated and rename it one of existing kingdoms when it needs to be activated or call these in seperated parts in start game?

if a kingdom is dead/not active you don't need to setup flags for it, right? So execute those scripts when your event that jumps up in time needs it

and if your jumps are that big you will need to create a game_start script for each timeslot anyway (to setup the new economy, centers, lords, factions, etc). Call them game_start_1300, game_start_1370, game_start_1500, etc and have the trigger execute them

It will crush my ctrl+c and v but, thanks. :smile:
 
HyperCharge said:
It will crush my ctrl+c and v but, thanks. :smile:

you can convert the game_start script into smaller ones that are generic, then call them with parameters, which will convert your game_start_1300, ... into very small scripts (about 25 lines), and each piece of script (start_economy, start_lords, etc) into small ones as well (10 to 30 lines each)

you don't need to have a 800 lines script

smaller scripts are cleaner, easier to test, log, profile for performance, bug fix, ... and so on

a example from one of my personal mods (old style, still using standard MBScript stuff)
Code:
  # Start: scripts required by engine
  # script_game_start
  # This script is called when a new game is started
  ("game_start",
    [
      (call_script, "script_init_globals"),
      
      (call_script, "script_init_game_options"),
      
      (call_script, "script_init_player"),
      
      (call_script, "script_init_factions"),
      
      (call_script, "script_init_banner_info"),
      
      (call_script, "script_init_item_info"),
      
      (call_script, "script_init_trade_routes"),
      
      (call_script, "script_init_town_arena_info"), 
      
      (call_script, "script_init_npcs_companions"),
      
      (call_script, "script_init_formations"),
      
      (call_script, "script_init_notes"),
      
      (call_script, "script_init_port_towns_and_smoke"),
      
      (call_script, "script_init_shaders"),     
    ]
  ),
 
kalarhan said:
HyperCharge said:
It will crush my ctrl+c and v but, thanks. :smile:

you can convert the game_start script into smaller ones that are generic, then call them with parameters, which will convert your game_start_1300, ... into very small scripts (about 25 lines), and each piece of script (start_economy, start_lords, etc) into small ones as well (10 to 30 lines each)

you don't need to have a 800 lines script

smaller scripts are cleaner, easier to test, log, profile for performance, bug fix, ... and so on

a example from one of my personal mods (old style, still using standard MBScript stuff)
Code:
  # Start: scripts required by engine
  # script_game_start
  # This script is called when a new game is started
  ("game_start",
    [
      (call_script, "script_init_globals"),
      
      (call_script, "script_init_game_options"),
      
      (call_script, "script_init_player"),
      
      (call_script, "script_init_factions"),
      
      (call_script, "script_init_banner_info"),
      
      (call_script, "script_init_item_info"),
      
      (call_script, "script_init_trade_routes"),
      
      (call_script, "script_init_town_arena_info"), 
      
      (call_script, "script_init_npcs_companions"),
      
      (call_script, "script_init_formations"),
      
      (call_script, "script_init_notes"),
      
      (call_script, "script_init_port_towns_and_smoke"),
      
      (call_script, "script_init_shaders"),     
    ]
  ),

I didnt know that smaller scripts are cleaner. Thanks for answers. :grin:
 
Status
Not open for further replies.
Back
Top Bottom