Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hey guys, for some reason my game is crashing the second it starts. I see the Taleworlds thing, and then the millisecond the loading screen thing starts it just goes straight to desktop. No messages or anything. Compiles perfectly. I have added some new items, if that means anything. It started after I added them so I assume that's what it's about.
 
Bustah said:
Compiles perfectly.

compiles fine != works fine

go back to your last backup and double check what you changed, as it seems you broke something. You can also copy the compiler log if it shows something weird in there (or on your rlg_log.txt log).
 
Hello lads, I add two new factions in my module system (Diplomacy 1.172). When I add the first (kingdom_7), I change this lines(If i don´t do this, the compiler gives me an error):

Code:
          (troop_set_slot, "trp_temp_array_b", 3, factions[fac_kingdom_6][6]),
          (troop_set_slot, "trp_temp_array_b", 4, factions[fac_kingdom_5][6]),
          (troop_set_slot, "trp_temp_array_b", 5, factions[fac_kingdom_4][6]),
          (troop_set_slot, "trp_temp_array_b", 6, factions[fac_kingdom_3][6]),
          (troop_set_slot, "trp_temp_array_b", 7, factions[fac_kingdom_2][6]),
          (troop_set_slot, "trp_temp_array_b", 8, factions[fac_kingdom_1][6]), 
          (troop_set_slot, "trp_temp_array_b", 9, factions[fac_player_supporters_faction][6]),

to this:

Code:
          (troop_set_slot, "trp_temp_array_b", 3, factions[fac_kingdom_7][6]),
          (troop_set_slot, "trp_temp_array_b", 4, factions[fac_kingdom_6][6]),
          (troop_set_slot, "trp_temp_array_b", 5, factions[fac_kingdom_5][6]),
          (troop_set_slot, "trp_temp_array_b", 6, factions[fac_kingdom_4][6]),
          (troop_set_slot, "trp_temp_array_b", 7, factions[fac_kingdom_3][6]),
          (troop_set_slot, "trp_temp_array_b", 8, factions[fac_kingdom_2][6]),
          (troop_set_slot, "trp_temp_array_b", 9, factions[fac_kingdom_1][6]),
          (troop_set_slot, "trp_temp_array_b", 10, factions[fac_player_supporters_faction][6]),

With no problems, all work perfect in game. Today, I add the second faction (kingdom_:cool: and change the code again to this:

Code:
          (troop_set_slot, "trp_temp_array_b", 3, factions[fac_kingdom_8][6]),
          (troop_set_slot, "trp_temp_array_b", 4, factions[fac_kingdom_7][6]),
          (troop_set_slot, "trp_temp_array_b", 5, factions[fac_kingdom_6][6]),
          (troop_set_slot, "trp_temp_array_b", 6, factions[fac_kingdom_5][6]),
          (troop_set_slot, "trp_temp_array_b", 7, factions[fac_kingdom_4][6]),
          (troop_set_slot, "trp_temp_array_b", 8, factions[fac_kingdom_3][6]),
          (troop_set_slot, "trp_temp_array_b", 9, factions[fac_kingdom_2][6]),
          (troop_set_slot, "trp_temp_array_b", 10, factions[fac_kingdom_1][6]),
          (troop_set_slot, "trp_temp_array_b", 11, factions[fac_player_supporters_faction][6]),

And the compiler gives me this error:

VRQqZY5vSr_ONPs9XKBJbw.png


("change_color", 0, mesh_load_window, [
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),

        (create_combo_button_overlay, "$g_presentation_obj_1"),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 680),
        (overlay_set_position, "$g_presentation_obj_1", pos1),

        # (try_for_range, ":cur_slot", 0, 9),
          # (troop_get_slot, ":cur_faction", "trp_temp_array_a", ":cur_slot"),
          # (str_store_faction_name, s0, ":cur_faction"),
          # (overlay_add_item, "$g_presentation_obj_1", s0),
        # (try_end),
        # (overlay_set_val, "$g_presentation_obj_1", "$temp"),

        ## name and color
        (try_begin),
          (eq, "$g_presentation_state", recolor_kingdom),

          # faction list
          (assign, ":slot_no", 0),
          (try_for_range, ":faction", "fac_commoners", "fac_innocents"),
            (troop_set_slot, "trp_temp_array_a", ":slot_no", ":faction"),
            (str_store_faction_name, s0, ":faction"),
            (overlay_add_item, "$g_presentation_obj_1", s0),
            (val_add, ":slot_no", 1),
          (try_end),
          (try_for_range_backwards, ":faction", kingdoms_begin, kingdoms_end),
            (troop_set_slot, "trp_temp_array_a", ":slot_no", ":faction"),
            (str_store_faction_name, s0, ":faction"),
            (overlay_add_item, "$g_presentation_obj_1", s0),
            (val_add, ":slot_no", 1),
          (try_end),

          # default color list
          # (troop_set_slot, "trp_temp_array_b", 0, factions[fac_deserters][6]),
          (troop_set_slot, "trp_temp_array_b", 0, 0xAAAAAA), #commoners doesn't have a default value
          (troop_set_slot, "trp_temp_array_b", 1, factions[fac_outlaws][6]),
          (troop_set_slot, "trp_temp_array_b", 2, factions[fac_neutral][6]),
          # (troop_set_slot, "trp_temp_array_b", 0, 0x444444), #common
          # (troop_set_slot, "trp_temp_array_b", 1, 0x88888:cool:, #outlaw
          # (troop_set_slot, "trp_temp_array_b", 2, 0xFFFFFF), #neutral
  (troop_set_slot, "trp_temp_array_b", 3, factions[fac_kingdom_8][6]),
  (troop_set_slot, "trp_temp_array_b", 4, factions[fac_kingdom_7][6]),
          (troop_set_slot, "trp_temp_array_b", 5, factions[fac_kingdom_6][6]),
          (troop_set_slot, "trp_temp_array_b", 6, factions[fac_kingdom_5][6]),
          (troop_set_slot, "trp_temp_array_b", 7, factions[fac_kingdom_4][6]),
          (troop_set_slot, "trp_temp_array_b", 8, factions[fac_kingdom_3][6]),
          (troop_set_slot, "trp_temp_array_b", 9, factions[fac_kingdom_2][6]),
          (troop_set_slot, "trp_temp_array_b", 10, factions[fac_kingdom_1][6]),
          (troop_set_slot, "trp_temp_array_b", 11, factions[fac_player_supporters_faction][6]),
          # (troop_set_slot, "trp_temp_array_b", 3, 0xCCCC66),
          # (troop_set_slot, "trp_temp_array_b", 4, 0x669999),
          # (troop_set_slot, "trp_temp_array_b", 5, 0x0066FF),
          # (troop_set_slot, "trp_temp_array_b", 6, 0x9999CC),
          # (troop_set_slot, "trp_temp_array_b", 7, 0xFF3300),
          # (troop_set_slot, "trp_temp_array_b", 8, 0xCC6600),
          # (troop_set_slot, "trp_temp_array_b", 9, 0x33DD33),
          # (troop_set_slot, "trp_temp_array_b", 10, 0xFFCC33),

          # (troop_set_slot, "trp_temp_array_b", 11, 0xFF4433), #plyr

          ## name and color
          (troop_get_slot, ":faction", "trp_temp_array_a", "$temp"),
          (str_store_faction_name, s0, ":faction"), #see below
          (faction_get_color, ":faction_color", ":faction"),
          (overlay_set_val, "$g_presentation_obj_1", "$temp"), #show currently selected index

          #show faction leader and flag
          (try_begin),
            (faction_get_slot, ":leader_no", ":faction", slot_faction_leader),
            (ge, ":leader_no", 0),
            # (faction_get_slot, ":mesh", ":faction", slot_faction_banner),
            # (create_mesh_overlay_with_tableau_material, reg0, -1, "tableau_troop_note_mesh", ":leader_no"), #do not use this, we want banner on other side
            (create_mesh_overlay_with_tableau_material, reg0, -1, "tableau_game_character_sheet", ":leader_no"),
            (position_set_x, pos1, 75),
            (position_set_y, pos1, 300),
            (overlay_set_position, reg0, pos1),

            (create_mesh_overlay_with_tableau_material, reg0, -1, "tableau_faction_note_mesh_banner", ":faction"),
            (position_set_x, pos1, 700),
            (position_set_y, pos1, 350),
            (overlay_set_position, reg0, pos1),
            (position_set_x, pos1, 1250),
            (position_set_y, pos1, 1250),
            (overlay_set_size, reg0, pos1),
            # (try_begin),
              # (troop_get_slot, ":mesh", ":leader_no", slot_troop_banner_scene_prop),
              # (val_sub, ":mesh", banner_scene_props_begin),
              # (val_add, ":mesh", banner_meshes_begin),
              # (create_mesh_overlay, reg0, ":mesh"),
              # (overlay_set_position, reg0, pos1),
            # (try_end),
          (try_end),
        (else_try),
          (eq, "$g_presentation_state", recolor_groups),
          # (assign, "$temp", grc_infantry),
          (overlay_add_item, "$g_presentation_obj_1", "str_allies_"),
          (overlay_add_item, "$g_presentation_obj_1", "str_enemies_"),
          (try_for_range_backwards, ":class", grc_infantry, grc_everyone),
            (troop_get_slot, ":faction_color", "trp_mercenaries_end", ":class"),
            (troop_set_slot, "trp_temp_array_b", ":class", ":faction_color"), #unnecessary?
            (str_store_class_name, s0, ":class"),
            (overlay_add_item, "$g_presentation_obj_1", s0),
          (try_end),
          (troop_get_slot, ":class", "trp_temp_array_a", "$temp"),
          (str_store_class_name, s0, ":class"),
        (else_try),
          (eq, "$g_presentation_state", recolor_heraldic),
          (overlay_set_display, "$g_presentation_obj_1", 0),
          (troop_get_slot, ":banner", "$g_player_troop", slot_troop_banner_scene_prop),
          (val_sub, ":banner", banner_scene_props_begin),
          (troop_get_slot, ":faction_color", "trp_banner_background_color_array", ":banner"),
          (assign, "$temp", ":banner"), #store offset
          (troop_set_slot, "trp_temp_array_b", "$temp", ":faction_color"),
          (val_add, ":banner", banner_meshes_begin),
          (create_mesh_overlay, reg0, ":banner"),
          (position_set_x, pos1, 800),
          (position_set_y, pos1, 600),
          (overlay_set_position, reg0, pos1),
          (position_set_x, pos1, 150),
          (position_set_y, pos1, 150),
          (overlay_set_size, reg0, pos1),

          # TODO create tableau showing side/back
          # (create_mesh_overlay_with_tableau_material, reg0, -1, "tableau_retirement_troop", 5),
          # (position_set_x, pos1, 75),
          # (position_set_y, pos1, 300),
          # (overlay_set_position, reg0, pos1),
        (try_end),
        (store_add, ":string", "$g_presentation_state", "str_color_of"), #offset
        (str_store_string, s0, ":string"),
        (create_text_overlay, reg1, ":string", tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 600),
        (overlay_set_position, reg1, pos1),
        (create_mesh_overlay, "$g_presentation_obj_2", "mesh_white_plane"),
        (position_set_x, pos1, 450),
        (position_set_y, pos1, 480),
        (overlay_set_position, "$g_presentation_obj_2", pos1),
        (position_set_x, pos1, 5000),
        (position_set_y, pos1, 5000),
        (overlay_set_size, "$g_presentation_obj_2", pos1),
        # (faction_get_color, ":faction_color", ":cur_faction"),
        (overlay_set_color, "$g_presentation_obj_2", ":faction_color"),

        ## sliders
        (position_set_x, pos1, 500),
        (create_slider_overlay, "$g_presentation_obj_3", 0, 255),
        (position_set_y, pos1, 400),
        (overlay_set_position, "$g_presentation_obj_3", pos1),
        (create_slider_overlay, "$g_presentation_obj_4", 0, 255),
        (position_set_y, pos1, 350),
        (overlay_set_position, "$g_presentation_obj_4", pos1),
        (create_slider_overlay, "$g_presentation_obj_5", 0, 255),
        (position_set_y, pos1, 300),
        (overlay_set_position, "$g_presentation_obj_5", pos1),
        (store_mod, ":blue", ":faction_color", 0x100),
        (val_div, ":faction_color", 0x100),
        (store_mod, ":green", ":faction_color", 0x100),
        (val_div, ":faction_color", 0x100),
        (store_mod, ":red", ":faction_color", 0x100),
        (overlay_set_val, "$g_presentation_obj_3", ":red"),
        (overlay_set_val, "$g_presentation_obj_4", ":green"),
        (overlay_set_val, "$g_presentation_obj_5", ":blue"),
        ## num boxes
        (position_set_x, pos1, 650),
        (create_number_box_overlay, "$g_presentation_obj_6", 0, 256),
        (position_set_y, pos1, 400),
        (overlay_set_position, "$g_presentation_obj_6", pos1),
        (create_number_box_overlay, "$g_presentation_obj_7", 0, 256),
        (position_set_y, pos1, 350),
        (overlay_set_position, "$g_presentation_obj_7", pos1),
        (create_number_box_overlay, "$g_presentation_obj_8", 0, 256),
        (position_set_y, pos1, 300),
        (overlay_set_position, "$g_presentation_obj_8", pos1),
        (overlay_set_val, "$g_presentation_obj_6", ":red"),
        (overlay_set_val, "$g_presentation_obj_7", ":green"),
        (overlay_set_val, "$g_presentation_obj_8", ":blue"),
        (assign, reg2, ":red"),
        (assign, reg3, ":green"),
        (assign, reg4, ":blue"),
        ## text: r g b
        (position_set_x, pos1, 330),
        (create_text_overlay, reg1, "@Red:", tf_center_justify),
        (position_set_y, pos1, 400),
        (overlay_set_position, reg1, pos1),
        (create_text_overlay, reg1, "@Green:", tf_center_justify),
        (position_set_y, pos1, 350),
        (overlay_set_position, reg1, pos1),
        (create_text_overlay, reg1, "@Blue:", tf_center_justify),
        (position_set_y, pos1, 300),
        (overlay_set_position, reg1, pos1),

        ## HTML code
        (str_store_string, s0, "str_dplmc_none"),
        (create_text_overlay, "$g_presentation_obj_9", "str_html", tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 450),
        (overlay_set_position, "$g_presentation_obj_9", pos1),
        (call_script, "script_convert_rgb_code_to_html_code", reg2, reg3, reg4),
        (overlay_set_text, "$g_presentation_obj_9", "str_html"),

        ## default and random
        (create_game_button_overlay, "$g_presentation_obj_11", "str_reset_to_default"),
        (position_set_x, pos1, 420),
        (position_set_y, pos1, 230),
        (overlay_set_position, "$g_presentation_obj_11", pos1),
        (create_game_button_overlay, "$g_presentation_obj_12", "str_randomize"),
        (position_set_x, pos1, 580),
        (position_set_y, pos1, 230),
        (overlay_set_position, "$g_presentation_obj_12", pos1),

        ## color picker
        (create_mesh_overlay, reg1, "mesh_white_plane"),
        (position_set_x, pos1, 13:cool:,
        (position_set_y, pos1, 7:cool:,
        (overlay_set_position, reg1, pos1),
        (position_set_x, pos1, 36100),
        (position_set_y, pos1, 6100),
        (overlay_set_size, reg1, pos1),
        (overlay_set_color, reg1, 0),

        (assign, ":pos_x", 140),
        (assign, ":pos_y", 80),
        (try_for_range, ":cur_slot", 0, 216),
          (create_image_button_overlay, reg1, "mesh_white_plane", "mesh_white_plane"),
          (position_set_x, pos1, ":pos_x"),
          (position_set_y, pos1, ":pos_y"),
          (overlay_set_position, reg1, pos1),
          (position_set_x, pos1, 900),
          (position_set_y, pos1, 900),
          (overlay_set_size, reg1, pos1),
          (assign, ":cur_color", ":cur_slot"),
          (call_script, "script_convert_slot_no_to_color", ":cur_color"),
          (assign, ":dest_color", reg0),
          (overlay_set_color, reg1, ":dest_color"),
          (val_add, ":pos_x", 20),
          (try_begin),
            (eq, ":pos_x", 860),
            (assign, ":pos_x", 140),
            (val_add, ":pos_y", 20),
          (try_end),
          (troop_set_slot, "trp_temp_array_c", ":cur_slot", reg1),
        (try_end),

        ## done
        (create_game_button_overlay, "$g_presentation_obj_10", "str_done"),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 25),
        (overlay_set_position, "$g_presentation_obj_10", pos1),
        ####### mouse fix pos system #######
        #(call_script, "script_mouse_fix_pos_ready"),
        ####### mouse fix pos system #######
      ]),

      #(ti_on_presentation_run,
        #[
        ####### mouse fix pos system #######
        #(call_script, "script_mouse_fix_pos_run"),
        ####### mouse fix pos system #######
      #]),

    (ti_on_presentation_event_state_change,
      [
        (store_trigger_param_1, ":eek:bject"),
        (store_trigger_param_2, ":value"),

        (try_begin),
          (eq, ":eek:bject", "$g_presentation_obj_1"),
          (assign, "$temp", ":value"),
          (start_presentation, "prsnt_change_color"),
        (else_try),
          (this_or_next|eq, ":eek:bject", "$g_presentation_obj_3"),
          (eq, ":eek:bject", "$g_presentation_obj_6"),
          (overlay_set_val, "$g_presentation_obj_3", ":value"),
          (overlay_set_val, "$g_presentation_obj_6", ":value"),
          (assign, reg2, ":value"),
          (call_script, "script_change_color"),
        (else_try),
          (this_or_next|eq, ":eek:bject", "$g_presentation_obj_4"),
          (eq, ":eek:bject", "$g_presentation_obj_7"),
          (overlay_set_val, "$g_presentation_obj_4", ":value"),
          (overlay_set_val, "$g_presentation_obj_7", ":value"),
          (assign, reg3, ":value"),
          (call_script, "script_change_color"),
        (else_try),
          (this_or_next|eq, ":eek:bject", "$g_presentation_obj_5"),
          (eq, ":eek:bject", "$g_presentation_obj_8"),
          (overlay_set_val, "$g_presentation_obj_5", ":value"),
          (overlay_set_val, "$g_presentation_obj_8", ":value"),
          (assign, reg4, ":value"),
          (call_script, "script_change_color"),
          # (call_script, "script_get_dest_color_from_rgb", reg2, reg3, reg4),
          # (assign, ":cur_color", reg0),
          # (overlay_set_color, "$g_presentation_obj_2", ":cur_color"),
          # (troop_get_slot, ":cur_faction", "trp_temp_array_a", "$temp"),
          # (faction_set_color, ":cur_faction", ":cur_color"),
          # (call_script, "script_convert_rgb_code_to_html_code", reg2, reg3, reg4),
          # (overlay_set_text, "$g_presentation_obj_9", "str_html"),
        (else_try),
          (eq, ":eek:bject", "$g_presentation_obj_11"),
          (troop_get_slot, ":cur_faction", "trp_temp_array_a", "$temp"),
          (troop_get_slot, ":default_color", "trp_temp_array_b", "$temp"),
          (try_begin),
            (eq, "$g_presentation_state", recolor_kingdom),
            (faction_set_color, ":cur_faction", ":default_color"),
          (else_try),
            (eq, "$g_presentation_state", recolor_groups),
            (troop_set_slot, "trp_mercenaries_end", "$temp", ":default_color"),
          (else_try),
            (eq, "$g_presentation_state", recolor_heraldic),
            (troop_set_slot, "trp_banner_background_color_array", "$temp", ":default_color"),
          (try_end),
          (overlay_set_color, "$g_presentation_obj_2", ":default_color"),
          (store_mod, ":blue", ":default_color", 0x100),
          (val_div, ":default_color", 0x100),
          (store_mod, ":green", ":default_color", 0x100),
          (val_div, ":default_color", 0x100),
          (store_mod, ":red", ":default_color", 0x100),
          (overlay_set_val, "$g_presentation_obj_3", ":red"),
          (overlay_set_val, "$g_presentation_obj_4", ":green"),
          (overlay_set_val, "$g_presentation_obj_5", ":blue"),
          (overlay_set_val, "$g_presentation_obj_6", ":red"),
          (overlay_set_val, "$g_presentation_obj_7", ":green"),
          (overlay_set_val, "$g_presentation_obj_8", ":blue"),
          (assign, reg2, ":red"),
          (assign, reg3, ":green"),
          (assign, reg4, ":blue"),
          (call_script, "script_convert_rgb_code_to_html_code", reg2, reg3, reg4),
          (overlay_set_text, "$g_presentation_obj_9", "str_html"),
        (else_try),
          (eq, ":eek:bject", "$g_presentation_obj_12"),
          (store_random_in_range, reg2, 0, 256),
          (store_random_in_range, reg3, 0, 256),
          (store_random_in_range, reg4, 0, 256),
          (overlay_set_val, "$g_presentation_obj_3", reg2),
          (overlay_set_val, "$g_presentation_obj_4", reg3),
          (overlay_set_val, "$g_presentation_obj_5", reg4),
          (overlay_set_val, "$g_presentation_obj_6", reg2),
          (overlay_set_val, "$g_presentation_obj_7", reg3),
          (overlay_set_val, "$g_presentation_obj_8", reg4),
          (call_script, "script_change_color"),
          # (call_script, "script_get_dest_color_from_rgb", reg2, reg3, reg4),
          # (assign, ":cur_color", reg0),
          # (overlay_set_color, "$g_presentation_obj_2", ":cur_color"),
          # (troop_get_slot, ":cur_faction", "trp_temp_array_a", "$temp"),
          # (faction_set_color, ":cur_faction", ":cur_color"),
          # (call_script, "script_convert_rgb_code_to_html_code", reg2, reg3, reg4),
          # (overlay_set_text, "$g_presentation_obj_9", "str_html"),
        (else_try),
          (eq, ":eek:bject", "$g_presentation_obj_10"),
          (try_begin),
            (gt, "$g_presentation_next_presentation", 0),
            (try_begin), #restore var
              (eq, "$g_presentation_next_presentation", "prsnt_name_kingdom"),
              (eq, "$g_presentation_state", recolor_kingdom),
              (assign, "$g_presentation_state", rename_kingdom),
            (try_end),
            (start_presentation, "$g_presentation_next_presentation"),
          (else_try),
            (presentation_set_duration, 0),
          (try_end),
        (else_try),
          (try_for_range, ":cur_slot", 0, 216),
            (troop_slot_eq, "trp_temp_array_c", ":cur_slot", ":eek:bject"),
            (assign, ":cur_color", ":cur_slot"),
            (call_script, "script_convert_slot_no_to_color", ":cur_color"),
            (assign, ":dest_color", reg0),
            # (troop_get_slot, ":cur_faction", "trp_temp_array_a", "$temp"),
            # (try_begin),
              # (eq, "$g_presentation_state", recolor_kingdom),
              # (faction_set_color, ":cur_faction", ":dest_color"),
            # (try_end),
            # (overlay_set_color, "$g_presentation_obj_2", ":dest_color"),
            (store_mod, ":blue", ":dest_color", 0x100),
            (val_div, ":dest_color", 0x100),
            (store_mod, ":green", ":dest_color", 0x100),
            (val_div, ":dest_color", 0x100),
            (store_mod, ":red", ":dest_color", 0x100),
            (overlay_set_val, "$g_presentation_obj_3", ":red"),
            (overlay_set_val, "$g_presentation_obj_4", ":green"),
            (overlay_set_val, "$g_presentation_obj_5", ":blue"),
            (overlay_set_val, "$g_presentation_obj_6", ":red"),
            (overlay_set_val, "$g_presentation_obj_7", ":green"),
            (overlay_set_val, "$g_presentation_obj_8", ":blue"),
            (assign, reg2, ":red"),
            (assign, reg3, ":green"),
            (assign, reg4, ":blue"),
            # (call_script, "script_convert_rgb_code_to_html_code", reg2, reg3, reg4),
            # (overlay_set_text, "$g_presentation_obj_9", "str_html"),
            (call_script, "script_change_color"),
          (try_end),
        (try_end),
    ]),
  ]),

The code is a presentation to change the color of the factions. Thanks in advance.
 
kalarhan said:
start by checking your new faction code on module_factions.py (as we can't see it no idea if it is correct)
I check the code. And I also check ID_factions and the faction is there.


Code:
("kingdom_7",  "Eastern Calradic Empire",  0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0x0000FF),
 ("kingdom_8",  "Sanjar Khanate", 0, 0.9, [("outlaws",-0.05),("peasant_rebels", -0.1),("deserters", -0.02),("mountain_bandits", -0.05),("forest_bandits", -0.05)], [], 0xe700ae),
 
Hernanxd16 said:
I check the code. And I also check ID_factions and the faction is there.

open a Python console and check your imports if you can`t find the error, or back to your backup  :grin:

use a terminal like IDLE or Windows console
Code:
python
from module_factions import *
factions
factions[10]  # chance number to your new factions ID
factions[10][6]
.... # and so on

then do the same for presentations. This is a quick test you can run in a minute or so to check your syntax.
 
Like this?
Code:
print 'module_factions'
from module_factions import *
factions
factions[23]  # chance number to your new factions ID
factions[23][6]
print 'module_presentations'
from module_presentations import *
presentations
presentations[28]
presentations[28][6]

c86dPIwuTyem8DZNTJEhbQ.png
 
Hernanxd16 said:
Like this?

close. Open a terminal instead of running a file. That way you can see the output  :grin:

from there find your syntax issues, fix them on your files, and reload your test. Remember you can comment lines, etc, and play with your code. Learn how to use the terminal and add print messages to the compiler and you can fix any syntax issue in a minute tops.
 
kalarhan said:
close. Open a terminal instead of running a file. That way you can see the output  :grin:

from there find your syntax issues, fix them on your files, and reload your test. Remember you can comment lines, etc, and play with your code. Learn how to use the terminal and add print messages to the compiler and you can fix any syntax issue in a minute tops.

Oh, I need to write the "from module_presentations import *" in the console.

I don't found the error, but I found something I think its strange. If i compile the MS, it shows the error. But,If I comment the line, compile, uncomment the line without changing anything else and compile again, there are no errors. Do you know what can be the reason? Any solution? I don't want to do this every time I use the compiler.

Seems like its solved after that, but If it appears again, I will post it here. Thanks kalarhan  :grin:

Edit: I have one "problem". That factions have sarranid equipment in tournaments (Turban instead of a Arena Helmet/Steppe Helmet), Where I can change this? (The factions don't have new towns, one has Uxkhal and Dhirim and the other has Halmar and Narra)
 
Hernanxd16 said:
equipment in tournaments

track your tournament code (whatever your mod is using). A good place to start is checking ID_scripts.py for "tournament" keyword, like in Native "script_set_items_for_tournament".

VC, as a example, has a "script_set_items_for_tournament_by_factions"
 
I check all the "tournament" scripts and also check in module_scripts (And also in constants) for "itm_arena_turban" "itm_arena_helmet" and "itm_steppe_helmet" and I don't find the code for assing helmets (set_items_for_tournament has the weapons ID, but no the Id of armors or helmets). Can it be in other file?
 
kalarhan said:
compiles fine != works fine

go back to your last backup and double check what you changed, as it seems you broke something. You can also copy the compiler log if it shows something weird in there (or on your rlg_log.txt log).

Nope. I restarted my computer and verified the integrity of Warband game files. Apparently 2 files were corrupted while I was playing the game (I was playing and when I alt-tabbed it crashed, so obviously something happened at that moment that screwed up my Warband files).
 
Hernanxd16 said:
Can it be in other file?

sure, check slots and constants/ranges used by your tournament system, the menus/presentations, the troops, and so on. What is your base module? Are you using any OSP extended tournament system not part of that base module? Did you create code for it yourself? Native 1172, VC 2036, Diplomacy 1.172, etc

you can back track this. Start from the last event (whatever thingy starts a tournament fight, like a game menu button) and see how each component is linked (who starts the tournament, who controls the spawns, which slots are used on a factions/center configuration, and so on)

note we can't guess how a system works on your module, as the only thingy we have in common (all modders) is vanilla Native. Anything else can be so different that without access to code it becomes a guessing game.
 
I use Diplomacy 1.172, and I don't add anything new to the tournaments. I found this in module game menus:

Code:
(
    "town_tournament",mnf_disable_all_keys,
    "{s1}You are at tier {reg0} of the tournament, with {reg1} participants remaining. In the next round, there will be {reg2} teams with {reg3} {reg4?fighters:fighter} each.",
    "none",

...

("tournament_join_next_fight", [], "Fight in the next round.",

...

(try_begin),
             (eq, ":town_original_faction", "fac_kingdom_1"),
             #Swadia
             (store_mod, ":mod", ":town_index_within_faction", 4),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (else_try),
               (eq, ":mod", 1),
               (call_script, "script_set_items_for_tournament", 100, 100, 0, 0, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (else_try),
               (eq, ":mod", 2),
               (call_script, "script_set_items_for_tournament", 100, 0, 100, 0, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (else_try),
               (eq, ":mod", 3),
               (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 40, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (try_end),
           (else_try),
             (eq, ":town_original_faction", "fac_kingdom_2"),
             #Vaegirs
             (store_mod, ":mod", ":town_index_within_faction", 4),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 0, 0, 0, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
             (else_try),
               (eq, ":mod", 1),
               (call_script, "script_set_items_for_tournament", 100, 50, 0, 0, 0, 20, 30, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
             (else_try),
               (eq, ":mod", 2),
               (call_script, "script_set_items_for_tournament", 100, 0, 50, 0, 0, 20, 30, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
             (else_try),
               (eq, ":mod", 3),
               (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 30, 0, 60, 0, "itm_arena_armor_red", "itm_steppe_helmet_red"),
             (try_end),
           (else_try),
             (eq, ":town_original_faction", "fac_kingdom_3"),
             #Khergit
             (store_mod, ":mod", ":town_index_within_faction", 2),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 100, 0, 0, 0, 0, 40, 60, 0, "itm_arena_tunic_red", "itm_steppe_helmet_red"),
             (else_try),
               (eq, ":mod", 1),
               (call_script, "script_set_items_for_tournament", 100, 50, 25, 0, 0, 30, 50, 0, "itm_arena_tunic_red", "itm_steppe_helmet_red"),
             (try_end),
           (else_try),
             (eq, ":town_original_faction", "fac_kingdom_4"),
             #Nords
             (store_mod, ":mod", ":town_index_within_faction", 3),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 0, 0, 50, 80, 0, 0, 0, 0, "itm_arena_armor_red", -1),
             (else_try),
               (eq, ":mod", 1),
               (call_script, "script_set_items_for_tournament", 0, 0, 50, 80, 50, 0, 0, 0, "itm_arena_armor_red", -1),
             (else_try),
               (eq, ":mod", 2),
               (call_script, "script_set_items_for_tournament", 40, 0, 0, 100, 0, 0, 0, 0, "itm_arena_armor_red", -1),
             (try_end),
           (else_try),
             #Rhodoks
             (eq, ":town_original_faction", "fac_kingdom_5"),
             (call_script, "script_set_items_for_tournament", 25, 100, 60, 0, 30, 0, 30, 50, "itm_arena_tunic_red", "itm_arena_helmet_red"),
           (else_try),
             #Sarranids
             (store_mod, ":mod", ":town_index_within_faction", 2),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 100, 40, 60, 0, 30, 30, 0, 0, "itm_arena_tunic_red", "itm_arena_turban_red"),
             (else_try),
               (call_script, "script_set_items_for_tournament", 50, 0, 60, 0, 30, 30, 0, 0, "itm_arena_tunic_red", "itm_arena_turban_red"),
             (try_end),
           (try_end),
           (jump_to_scene, ":arena_scene"),
           (change_screen_mission),

So, I add

Code:
#Swadia  
                 ...          
             #Vaegirs
                       ...
             #Khergit
                  ...
            #Nords
                 ...
             #Rhodoks
                ...
             #Sarranids
             (store_mod, ":mod", ":town_index_within_faction", 2),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 100, 40, 60, 0, 30, 30, 0, 0, "itm_arena_tunic_red", "itm_arena_turban_red"),
             (else_try),
               (call_script, "script_set_items_for_tournament", 50, 0, 60, 0, 30, 30, 0, 0, "itm_arena_tunic_red", "itm_arena_turban_red"),
             (try_end),
			(else_try),
             (eq, ":town_original_faction", "fac_kingdom_7"),
             #Swadia
             (store_mod, ":mod", ":town_index_within_faction", 4),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (else_try),
               (eq, ":mod", 1),
               (call_script, "script_set_items_for_tournament", 100, 100, 0, 0, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (else_try),
               (eq, ":mod", 2),
               (call_script, "script_set_items_for_tournament", 100, 0, 100, 0, 0, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (else_try),
               (eq, ":mod", 3),
               (call_script, "script_set_items_for_tournament", 40, 80, 50, 20, 40, 0, 0, 0, "itm_arena_armor_red", "itm_tourney_helm_red"),
             (try_end),	
			(else_try),
             (eq, ":town_original_faction", "fac_kingdom_8"),
             #Khergit
             (store_mod, ":mod", ":town_index_within_faction", 2),
             (try_begin),
               (eq, ":mod", 0),
               (call_script, "script_set_items_for_tournament", 100, 0, 0, 0, 0, 40, 60, 0, "itm_arena_tunic_red", "itm_steppe_helmet_red"),
             (else_try),
               (eq, ":mod", 1),
               (call_script, "script_set_items_for_tournament", 100, 50, 25, 0, 0, 30, 50, 0, "itm_arena_tunic_red", "itm_steppe_helmet_red"),
             (try_end), 
           (try_end),
           (jump_to_scene, ":arena_scene"),
           (change_screen_mission),

But in game i keep seeing turbans.
 
Hello I'm trying to overhaul the scouting system in Warband as currently it makes just about 0 sense. Anyways I can't seem to find where spotting range is calculated, which I would like to set to 0 or 1 by default.
 
Bustah said:
Hello I'm trying to overhaul the scouting system in Warband as currently it makes just about 0 sense. Anyways I can't seem to find where spotting range is calculated, which I would like to set to 0 or 1 by default.

I think in module.ini there are these lines which change spotting range and track marks on world map:
seeing_range    = 6.5
track_spotting_multiplier = 0.8

I don't know if there are other ways to change it. Probably it is hardcoded but I'm not expert at all, just trying to help
 
I want to change the mesh of the book that it is being read. There are 6 meshes from "book_a" to "book_f" plus there is another one "book_open". My idea is to change the mesh to "book_open" while the book is being read, and change it to another one once finished.
In header operations I have found this:
cur_item_add_mesh                  = 1964  # (cur_item_add_mesh, <mesh_name_string>, [<lod_begin>], [<lod_end>]),
                                            # Version 1.161+. Only call inside ti_on_init_item trigger. Adds another mesh to item, allowing the creation of combined items. Parameter <mesh_name_string> should contain mesh name itself, NOT a mesh reference. LOD values are optional. If <lod_end> is used, it will not be loaded.
cur_item_set_material              = 1978  # (cur_item_set_material, <string_no>, <sub_mesh_no>, [<lod_begin>], [<lod_end>]),
                                            # Version 1.161+. Only call inside ti_on_init_item trigger. Replaces material that will be used to render the item mesh. Use 0 for <sub_mesh_no> to replace material for base mesh. LOD values are optional. If <lod_end> is used, it will not be loaded.

My guess is that add mesh would add a submesh to the item, so then I could call set material with sub_mesh_no 1 because sub_mesh_no 0 is the base mesh. But I don't understand what is string_no. Probably something related to 3d meshes while books are 2d pictures. I'm trying to add a line to "camp_action_read_book_start"

Please someone can tell me if this is possible and what operation could I use. Or some example in the code.
 
LanceShield said:
I think in module.ini there are these lines which change spotting range and track marks on world map:
seeing_range    = 6.5
track_spotting_multiplier = 0.8

I don't know if there are other ways to change it. Probably it is hardcoded but I'm not expert at all, just trying to help

Thanks heaps! Would you also happen to know where to change the speed penalty for when a horse hits a player? Like make it such that the horse doesn't come nearly to a stop every time it hits a player? Cavalry charges are currently worthless.
 
Status
Not open for further replies.
Back
Top Bottom