OSP Code SP MnB 1.011 New Starting Up (Splitted into 3 posts)

Users who are viewing this thread

This is an alternative way to create a new game, with less clicks and randomizeable option.
ScreenShot :
1271204300.jpg


Here you are, the code :

Code:
# Dunde's Background
nationality_init        = "str_story"
parent_init             = "str_rhodok"
childhood_init          = "str_parent_priest"
job_init                = "str_childhood_acolyte"
reason_init             = "str_job_preacher"
story_nationality_init  = "str_story_all"
story_parent_init       = "str_story_rhodok"
story_childhood_init    = "str_story_parent_priest"
story_job_init          = "str_story_childhood_acolyte"
story_reason_init       = "str_story_job_preacher"
player          = "trp_player"
main_party  = "p_main_party"

Code:
#This needs to be the first window!!!
  (
    "start_game_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Welcome, adventurer, to Mount&Blade. Before you can start playing the game you must create a character.",
    "none",
    [(try_begin),
        (neq, "$creation_canceled", 999),
        (call_script, "script_randomize_background", 0),
        (start_presentation, "prsnt_player_background"),
     (try_end),],
    [("start",[],"Create Character",[(start_presentation, "prsnt_player_background"),]),
     ("quit",[],"Cancel",[(change_screen_quit),]),]),


on module_presentations.py

Code:
  ("player_background", 0, mesh_load_window,
   [(ti_on_presentation_load,
     [(presentation_set_duration, 999999),
      (set_fixed_point_multiplier, 1000),
      # Init Values
      (str_clear, s11),(str_clear, s12),(str_clear, s13),(str_clear, s14),(str_clear, s15),(str_clear, s16),(str_clear, s17),
      (store_mul, reg11, "$character_gender", 100),
      (store_mul, reg12, "$character_nationality", 100),
      (store_mul, reg13, "$background_parent", 100),
      (store_mul, reg14, "$background_childhood", 100),
      (store_mul, reg15, "$background_job", 100),
      (store_mul, reg16, "$background_reason", 100),      
      # Create Objects
      (create_text_overlay, "$g_presentation_obj_1", "str_gender", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_2", "str_nationality", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_3", "str_parent", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_4", "str_childhood", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_5", "str_jobs", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_6", "str_reason", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_7", "str_story", tf_double_space|tf_scrollable),
      (create_text_overlay, "$g_presentation_obj_11", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_12", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_13", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_14", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_15", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_16", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_17", "str_background_label_1", tf_center_justify),
      (create_text_overlay, "$g_presentation_obj_18", "str_background_label_2", tf_left_align),
      (create_slider_overlay, "$g_presentation_obj_21",    0, 100), # Gender        : Male/Female
      (create_slider_overlay, "$g_presentation_obj_22",  100, 500), # Nationality   : Swadian, Vaegir, Kherghit, Nord, Rhodhok
      (create_slider_overlay, "$g_presentation_obj_23",  100, 700), # Parent        : Noble, Merchant, Guard, Forester, Nomad, Thief, Priest
      (create_slider_overlay, "$g_presentation_obj_24",  100, 900), # Childhood     : Page, Apprentice, Stockboy, Urchin, Nomad, Mummer, Cortier, Noble, Acolyte
      (create_slider_overlay, "$g_presentation_obj_25",  100, 900), # Job           : bravo, merch, squire/lady, traubador, student, peddler, craftsman, poacher, preacher
      (create_slider_overlay, "$g_presentation_obj_26",  100, 600), # Reason        : revenge, death, wanderlust, disown, greed
      (create_game_button_overlay, "$g_presentation_obj_31", "str_cancel", tf_center_justify),        
      (create_game_button_overlay, "$g_presentation_obj_32", "str_continue", tf_center_justify),
      (create_game_button_overlay, "$g_presentation_obj_33", "str_random", tf_center_justify),        
      # Reposition Objects
      (position_set_y, pos1, 25), (position_set_x, pos3, 120), (position_set_y, pos3, 35), 
      (position_set_x, pos1, 750), (overlay_set_position, "$g_presentation_obj_31" , pos1), (overlay_set_size, "$g_presentation_obj_31", pos3),
      (position_set_x, pos1, 900), (overlay_set_position, "$g_presentation_obj_32",  pos1), (overlay_set_size, "$g_presentation_obj_32", pos3),
      (position_set_x, pos1, 600), (overlay_set_position, "$g_presentation_obj_33",  pos1), (overlay_set_size, "$g_presentation_obj_33", pos3),
      (position_set_x, pos1,  500), (position_set_y, pos1, 650), (position_set_x, pos3, 2000), (position_set_y, pos3, 2000),
      (overlay_set_position, "$g_presentation_obj_17", pos1), (overlay_set_size, "$g_presentation_obj_17", pos3),
      (position_set_x, pos1,  50), (position_set_x, pos3, 1000), (position_set_y, pos3, 1000),
      (position_set_y, pos1, 550),        (overlay_set_position, "$g_presentation_obj_1", pos1), (overlay_set_size, "$g_presentation_obj_1", pos3),
      (position_set_y, pos1, 550-1*40),   (overlay_set_position, "$g_presentation_obj_2", pos1), (overlay_set_size, "$g_presentation_obj_2", pos3),        
      (position_set_y, pos1, 550-2*40),   (overlay_set_position, "$g_presentation_obj_3", pos1), (overlay_set_size, "$g_presentation_obj_3", pos3),
      (position_set_y, pos1, 550-3*40),   (overlay_set_position, "$g_presentation_obj_4", pos1), (overlay_set_size, "$g_presentation_obj_4", pos3),
      (position_set_y, pos1, 550-4*40),   (overlay_set_position, "$g_presentation_obj_5", pos1), (overlay_set_size, "$g_presentation_obj_5", pos3),
      (position_set_y, pos1, 550-5*40),   (overlay_set_position, "$g_presentation_obj_6", pos1), (overlay_set_size, "$g_presentation_obj_6", pos3),
      (position_set_x, pos1,  500), (position_set_y, pos1, 550),
      (overlay_set_position, "$g_presentation_obj_18", pos1), (overlay_set_size, "$g_presentation_obj_18", pos3),
      (position_set_x, pos1, 150), (position_set_x, pos3, 1000), (position_set_y, pos3, 1000),
      (position_set_y, pos1, 550),        (overlay_set_position, "$g_presentation_obj_11", pos1), (overlay_set_size, "$g_presentation_obj_11", pos3),
      (position_set_y, pos1, 550-1*40),   (overlay_set_position, "$g_presentation_obj_12", pos1), (overlay_set_size, "$g_presentation_obj_12", pos3),        
      (position_set_y, pos1, 550-2*40),   (overlay_set_position, "$g_presentation_obj_13", pos1), (overlay_set_size, "$g_presentation_obj_13", pos3),
      (position_set_y, pos1, 550-3*40),   (overlay_set_position, "$g_presentation_obj_14", pos1), (overlay_set_size, "$g_presentation_obj_14", pos3),
      (position_set_y, pos1, 550-4*40),   (overlay_set_position, "$g_presentation_obj_15", pos1), (overlay_set_size, "$g_presentation_obj_15", pos3),
      (position_set_y, pos1, 550-5*40),   (overlay_set_position, "$g_presentation_obj_16", pos1), (overlay_set_size, "$g_presentation_obj_16", pos3),
      (position_set_x, pos1, 300), (position_set_x, pos3, 1000), (position_set_y, pos3, 200),
      (position_set_y, pos1, 545),        (overlay_set_position, "$g_presentation_obj_21", pos1), (overlay_set_size, "$g_presentation_obj_21", pos3),
      (position_set_y, pos1, 545-1*40), (overlay_set_position, "$g_presentation_obj_22", pos1), (overlay_set_size, "$g_presentation_obj_22", pos3),        
      (position_set_y, pos1, 545-2*40), (overlay_set_position, "$g_presentation_obj_23", pos1), (overlay_set_size, "$g_presentation_obj_23", pos3),
      (position_set_y, pos1, 545-3*40), (overlay_set_position, "$g_presentation_obj_24", pos1), (overlay_set_size, "$g_presentation_obj_24", pos3),
      (position_set_y, pos1, 545-4*40), (overlay_set_position, "$g_presentation_obj_25", pos1), (overlay_set_size, "$g_presentation_obj_25", pos3),
      (position_set_y, pos1, 545-5*40), (overlay_set_position, "$g_presentation_obj_26", pos1), (overlay_set_size, "$g_presentation_obj_26", pos3),
      (position_set_x, pos1, 500), (position_set_y, pos1, 120),
      (overlay_set_position,  "$g_presentation_obj_7", pos1),
      (position_set_x, pos1, 450), (position_set_y, pos1, 425),
      (overlay_set_area_size, "$g_presentation_obj_7", pos1),
      (position_set_x, pos1, 800), (position_set_y, pos1, 800),
      (overlay_set_size,      "$g_presentation_obj_7", pos1),
      # Initial States
      (overlay_set_val, "$g_presentation_obj_21", reg11),
      (overlay_set_val, "$g_presentation_obj_22", reg12),
      (overlay_set_val, "$g_presentation_obj_23", reg13),
      (overlay_set_val, "$g_presentation_obj_24", reg14),
      (overlay_set_val, "$g_presentation_obj_25", reg15),
      (overlay_set_val, "$g_presentation_obj_26", reg16),
      (call_script, "script_update_strings"), ]),
    (ti_on_presentation_event_state_change,
     [(store_trigger_param_1, ":object"),
      (store_trigger_param_2, ":value"),       
      (set_fixed_point_multiplier, 1000),
      (assign, ":story_changed", 0),
      (try_begin),
         (eq, ":object", "$g_presentation_obj_21"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg11, ":new_value"), 
         (overlay_set_val, "$g_presentation_obj_21", reg11),
         (assign, ":story_changed", 1),
      (else_try),        
         (eq, ":object", "$g_presentation_obj_22"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg12, ":new_value"), 
         (overlay_set_val, "$g_presentation_obj_22", reg12),
         (assign, ":story_changed", 1),
      (else_try),        
         (eq, ":object", "$g_presentation_obj_23"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg13, ":new_value"), 
         (overlay_set_val, "$g_presentation_obj_23", reg13),
         (assign, ":story_changed", 1),
      (else_try),        
         (eq, ":object", "$g_presentation_obj_24"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg14, ":new_value"), 
         (overlay_set_val, "$g_presentation_obj_24", reg14),
         (assign, ":story_changed", 1),
      (else_try),        
         (eq, ":object", "$g_presentation_obj_25"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg15, ":new_value"), 
         (overlay_set_val, "$g_presentation_obj_25", reg15),
         (assign, ":story_changed", 1), 
      (else_try),        
         (eq, ":object", "$g_presentation_obj_26"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg16, ":new_value"), 
         (overlay_set_val, "$g_presentation_obj_26", reg16),
         (assign, ":story_changed", 1),        
      (else_try),
         (eq, ":object", "$g_presentation_obj_31"),
         (assign, "$creation_canceled", 999),
         (jump_to_menu, "mnu_start_game_1"),
         (presentation_set_duration, 0),
      (else_try),
         (eq, ":object", "$g_presentation_obj_32"),
         (assign, "$creation_canceled", 0),
         (call_script, "script_init_char_stat"),
         (try_begin),
            (eq, "$background_parent", 1),
            (start_presentation, "prsnt_banner_selection"),
         (else_try),
            (jump_to_menu, "mnu_auto_return"),
            (presentation_set_duration, 0),
         (try_end),      
      (else_try),
         (eq, ":object", "$g_presentation_obj_33"),
         (call_script, "script_randomize_background", 1),
         (assign, ":story_changed", 1), 
      (try_end),
      (try_begin),
         (eq, ":story_changed", 1),
         (store_div, "$character_gender", reg11, 100),
         (store_div, "$character_nationality", reg12, 100),
         (store_div, "$background_parent", reg13, 100),
         (store_div, "$background_childhood", reg14, 100),
         (store_div, "$background_job", reg15, 100),
         (store_div, "$background_reason", reg16, 100),
         (call_script, "script_update_strings"),
      (try_end), ]), ]),

Code:
  ("banner_selection",0,mesh_load_window,[
      (ti_on_presentation_load,
       [(set_fixed_point_multiplier, 1000),
        (str_store_string, s1, "str_banner_selection_text"),
        (create_text_overlay, reg1, s1, tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 600),
        (overlay_set_position, reg1, pos1),
        (overlay_set_text, reg1, s1),
        (create_button_overlay, "$g_presentation_obj_1", "@Next Page", tf_center_justify),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, 50),
        (overlay_set_position, "$g_presentation_obj_1", pos1),

        (assign, ":x_pos", 150),
        (assign, ":y_pos", 575),
        (assign, ":try_end", banner_meshes_end_minus_one),
        (store_mul, ":begin_mesh", 16, "$g_presentation_page_no"),
        (val_add, ":begin_mesh", banner_meshes_begin),
        (store_add, ":try_end_2", ":begin_mesh", 16),
        (val_min, ":try_end", ":try_end_2"),
        (store_add, "$g_presentation_banner_start", "$g_presentation_obj_1", 1),
        (try_for_range, ":cur_banner_mesh", ":begin_mesh", ":try_end"),
          (create_image_button_overlay, reg1, ":cur_banner_mesh", ":cur_banner_mesh"),
          (position_set_x, pos1, ":x_pos"),
          (position_set_y, pos1, ":y_pos"),
          (overlay_set_position, reg1, pos1),
          (position_set_x, pos1, 100),
          (position_set_y, pos1, 100),
          (overlay_set_size, reg1, pos1),
          (val_add, ":x_pos", 100),
          (ge, ":x_pos", 900),
          (assign, ":x_pos", 150),
          (val_sub, ":y_pos", 250),
        (try_end),
        (presentation_set_duration, 999999),
        ]),
      (ti_on_presentation_event_state_change,
       [(store_trigger_param_1, ":object"),
        (try_begin),
          (eq, ":object", "$g_presentation_obj_1"),
          (val_add, "$g_presentation_page_no", 1),
          (val_mod, "$g_presentation_page_no", 8),
          (start_presentation, "prsnt_banner_selection"),
        (else_try),
          (store_sub, ":selected_banner", ":object", "$g_presentation_banner_start"),
          (store_mul, ":page_adder", 16, "$g_presentation_page_no"),
          (val_add, ":selected_banner", ":page_adder"),
          (store_add, ":selected_banner_map_icon", ":selected_banner", banner_map_icons_begin),
          (party_set_banner_icon, main_party, ":selected_banner_map_icon"),
          (store_add, ":selected_banner_spr", ":selected_banner", banner_scene_props_begin),
          (troop_set_slot, player, slot_troop_banner_scene_prop, ":selected_banner_spr"),
          ## Dunde's BEGIN
          (jump_to_menu, "mnu_auto_return"), 
          ## Dunde's END
          (presentation_set_duration, 0),
          (assign, ":troop_to_change", 0),
          (assign, ":end_cond", kingdom_heroes_end),
          (try_for_range, ":cur_troop", kingdom_heroes_begin, ":end_cond"),
            (troop_slot_eq, ":cur_troop", slot_troop_banner_scene_prop, ":selected_banner_spr"),
            (assign, ":troop_to_change", ":cur_troop"),
            (assign, ":end_cond", 0),
            (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
            (troop_get_slot, ":cur_party", ":cur_troop", slot_troop_leaded_party),
            (gt, ":cur_party", 0),
            (party_set_banner_icon, ":cur_party", banner_map_icons_end_minus_one),
          (try_end),
          (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
            (try_begin),
              (party_slot_eq, ":cur_center", slot_town_lord, player),
              (party_set_banner_icon, ":cur_center", ":selected_banner_map_icon"),
            (else_try),
              (party_slot_eq, ":cur_center", slot_town_lord, ":troop_to_change"),
              (party_set_banner_icon, ":cur_center", banner_map_icons_end_minus_one),
            (try_end),
          (try_end),
        (try_end),
        ]),
      (ti_on_presentation_run,
       [(try_begin),
          (this_or_next|key_clicked, key_space),
          (this_or_next|key_clicked, key_enter),
          (this_or_next|key_clicked, key_escape),
          (key_clicked, key_back_space),
         ## Dunde's BEGIN
          (jump_to_menu, "mnu_auto_return"), 
          ## Dunde's END
          (presentation_set_duration, 0),
        (try_end),

        ]),
      ]),

EDIT :
add main_party constants to module_constants.py
 
Code:
#-- Dunde's Player Background BEGIN

("update_strings",
 [(store_add, ":str_pointer", "$character_nationality", nationality_init),
  (str_store_string, s12, ":str_pointer"),
  (store_add, ":str_pointer", "$background_parent", parent_init),
  (str_store_string, s13, ":str_pointer"),
  (store_add, ":str_pointer", "$background_childhood", childhood_init),
  (str_store_string, s14, ":str_pointer"),
  (store_add, ":str_pointer", "$background_job", job_init),
  (str_store_string, s15, ":str_pointer"),
  (store_add, ":str_pointer", "$background_reason", reason_init),
  (str_store_string, s16, ":str_pointer"),
  (str_clear, s17), 
  (store_add, ":str_pointer", "$character_nationality", story_nationality_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_parent", story_parent_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_childhood", story_childhood_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_job", story_job_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_reason", story_reason_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (overlay_set_text, "$g_presentation_obj_11", "str_gender_value"),
  (overlay_set_text, "$g_presentation_obj_12", "str_nationality_value"),
  (overlay_set_text, "$g_presentation_obj_13", "str_parent_value"),
  (overlay_set_text, "$g_presentation_obj_14", "str_childhood_value"),
  (overlay_set_text, "$g_presentation_obj_15", "str_jobs_value"),
  (overlay_set_text, "$g_presentation_obj_16", "str_reason_value"),
  (overlay_set_text, "$g_presentation_obj_7", "str_story"),]),

("init_char_stat",
 [(set_show_messages, 0),
  # Gender     
  (try_begin), 
     (eq,"$character_gender", tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_charisma,1),
  (else_try),
     (eq,"$character_gender", tf_female),  
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
  (try_end),
  (troop_raise_attribute, player,ca_strength,1),
  (troop_raise_attribute, player,ca_agility,1),
  (troop_raise_attribute, player,ca_charisma,1), 
  (troop_raise_skill, player,skl_leadership,1),
  (troop_raise_skill, player,skl_riding,1),
  ## Commented Parts : Only for my Mod
  ## Nationality
  (assign, ":char_type", "$character_gender"),
  ##(try_begin),
  ##   (eq, "$character_nationality", 4),
  ##   (val_or, ":char_type", tf_tall),
  ##(try_end),
  ##(store_add, ":slot", ":char_type", slot_item_normal_male),
  (troop_set_type, player, ":char_type"),
  ##(troop_set_slot, player, slot_troop_gender, ":slot"),
  # Parent
  (try_begin),
     (eq,"$background_parent",1),
     (eq,"$character_gender",tf_male),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,2),
     (troop_raise_skill, player,skl_weapon_master,1),
     (troop_raise_skill, player,skl_power_strike,1),
     (troop_raise_skill, player,skl_riding,1),
     (troop_raise_skill, player,skl_tactics,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_polearm,10),
     (troop_add_item, player,"itm_tab_shield_round_a",imod_battered),
     (troop_set_slot, player, slot_troop_renown, 100),
     (call_script, "script_change_player_honor", 3),
     (troop_add_gold, player, 100),
  (else_try),
     (eq,"$background_parent",1),
     (eq,"$character_gender",tf_female),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_raise_skill, player,skl_riding,2),
     (troop_raise_skill, player,skl_first_aid,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
     (troop_set_slot, player, slot_troop_renown, 50),
     (troop_add_item, player,"itm_tab_shield_round_a",imod_battered),
     (troop_add_gold, player, 100),
  (else_try),
     (eq,"$background_parent",2),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_riding,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_skill, player,skl_trade,2),
     (troop_raise_skill, player,skl_inventory_management,1),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,10),
     (troop_add_gold, player, 250),
     (troop_set_slot, player, slot_troop_renown, 20),
  (else_try),
     (eq,"$background_parent",3),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_ironflesh,1),
     (troop_raise_skill, player,skl_power_strike,1),
     (troop_raise_skill, player,skl_weapon_master,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_skill, player,skl_trainer,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,15),
     (troop_raise_proficiency, player,wpt_polearm,20),
     (troop_raise_proficiency, player,wpt_throwing,10),
     (troop_add_item, player,"itm_tab_shield_kite_b",imod_battered),
     (troop_add_gold, player, 50),
     (troop_set_slot, player, slot_troop_renown, 10),
  (else_try),
     (eq,"$background_parent",4),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,2),
     (troop_raise_skill, player,skl_power_draw,1),
     (troop_raise_skill, player,skl_tracking,1),
     (troop_raise_skill, player,skl_pathfinding,1),
     (troop_raise_skill, player,skl_spotting,1),
     (troop_raise_skill, player,skl_athletics,1),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_archery,30),
     (troop_add_gold, player, 30),
  (else_try),
     (eq,"$background_parent",5),
     (eq,"$character_gender",tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_power_draw,1),
     (troop_raise_skill, player,skl_horse_archery,1),
     (troop_raise_skill, player,skl_pathfinding,1),
     (troop_raise_skill, player,skl_riding,2),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_archery,30),
     (troop_raise_proficiency, player,wpt_throwing,10),
     (troop_add_item, player,"itm_tab_shield_small_round_a",imod_battered),
     (troop_add_gold, player, 15),
     (troop_set_slot, player, slot_troop_renown, 10),
  (else_try),
     (eq,"$background_parent",5),
     (eq,"$character_gender",tf_female),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_raise_skill, player,skl_first_aid,1),
     (troop_raise_skill, player,skl_pathfinding,1),
     (troop_raise_skill, player,skl_riding,2),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,5),
     (troop_raise_proficiency, player,wpt_archery,20),
     (troop_raise_proficiency, player,wpt_throwing,5),
     (troop_add_item, player,"itm_tab_shield_small_round_a",imod_battered),
     (troop_add_gold, player, 20),
  (else_try),
     (eq,"$background_parent",6),
     (troop_raise_attribute, player,ca_agility,3),
     (troop_raise_skill, player,skl_athletics,2),
     (troop_raise_skill, player,skl_power_throw,1),
     (troop_raise_skill, player,skl_inventory_management,1),
     (troop_raise_skill, player,skl_looting,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
     (troop_raise_proficiency, player,wpt_throwing,20),
     (troop_add_item, player,"itm_throwing_knives",0),
     (troop_add_gold, player, 25),
  (else_try),
     (eq,"$background_parent",7),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_skill, player,skl_prisoner_management,1),
     (troop_raise_proficiency, player,0,10),
     (troop_add_item, player,"itm_robe",0),
     (troop_add_item, player,"itm_wrapping_boots",0),
     (troop_add_item, player,"itm_club",0),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_add_item, player,"itm_sumpter_horse",0),
     (troop_add_gold, player, 10),
     (troop_set_slot, player, slot_troop_renown, 10),
  (try_end),
  # Childhood
  (try_begin),
     (eq,"$background_childhood",1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_skill, player,skl_power_strike,1),
     (troop_raise_skill, player,skl_persuasion,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,15),
     (troop_raise_proficiency, player,wpt_polearm,5),
  (else_try),
     (eq,"$background_childhood",2),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_skill, player,skl_engineer,1),
     (troop_raise_skill, player,skl_trade,1),
  (else_try),
     (eq,"$background_childhood",3),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_spotting,1),
     (troop_raise_skill, player,skl_looting,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,15),
     (troop_raise_proficiency, player,wpt_throwing,5),
  (else_try),
     (eq,"$background_childhood",4),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,skl_horse_archery,1),
     (troop_raise_skill, player,skl_power_throw,1),
     (troop_raise_proficiency, player,wpt_archery,15),
     (call_script,"script_change_troop_renown", player, 5),
  (else_try),
     (eq,"$background_childhood",5),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_inventory_management,1),
     (troop_raise_skill, player,skl_trade,1),
  (else_try),
     (eq,"$background_childhood",6),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_athletics,1),
     (troop_raise_skill, player,skl_riding,1),
     (troop_raise_proficiency, player,1,5),
     (troop_raise_proficiency, player,2,5),
     (call_script,"script_change_troop_renown", player, 15),
  (else_try),
     (eq,"$background_childhood",7),
     (troop_raise_attribute, player,ca_charisma,1),#3),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,skl_weapon_master,2),
     (troop_raise_proficiency, player,0,15),
     (troop_raise_proficiency, player,2,10),
     (troop_raise_proficiency, player,4,10),
     (call_script,"script_change_troop_renown", player, 20),
  (else_try),
     (eq,"$background_childhood",8),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_skill, player,skl_tactics,1),
     (troop_raise_proficiency, player,0,10),
     (troop_raise_proficiency, player,1,10),
     (call_script,"script_change_troop_renown", player, 15),
  (else_try),
     (eq,"$background_childhood",9),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_skill, player,skl_first_aid,1),
     (troop_raise_proficiency, player,2,30),
     (call_script,"script_change_troop_renown", player, 5),
  (try_end),
  # Job
  (try_begin),
     (eq,"$background_job",1),
     (troop_raise_attribute, player,ca_strength,2),
     (troop_raise_skill, player,skl_power_strike,1),
     (troop_raise_skill, player,skl_looting,1),
     (troop_raise_skill, player,skl_leadership,2),
     (troop_add_gold, player, 10),
     (try_begin),
        (this_or_next|player_has_item,"itm_sword_medieval_b"),
        (troop_has_item_equipped,player,"itm_sword_medieval_b"),
        (troop_remove_item, player,"itm_sword_medieval_b"),
     (try_end),
     (try_begin),
        (this_or_next|player_has_item,"itm_sword_medieval_c"),
        (troop_has_item_equipped,player,"itm_sword_medieval_c"),
        (troop_remove_item, player,"itm_sword_medieval_c"),
     (try_end),
     (troop_add_item, player,"itm_sword_medieval_b_small",0),
     (troop_add_item, player,"itm_wooden_shield",imod_battered),
     (troop_add_item, player,"itm_leather_jerkin",imod_ragged),  
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_raise_proficiency, player,0,10),
     (troop_raise_proficiency, player,4,10),
  (else_try),
     (eq,"$background_job",2),
     (troop_raise_attribute, player,ca_agility,2),
     (troop_raise_skill, player,skl_weapon_master,3),
     (troop_raise_skill, player,skl_athletics,1),
     (try_begin),
       (this_or_next|player_has_item,"itm_hide_boots"),
       (troop_has_item_equipped,player,"itm_hide_boots"),
       (troop_remove_item, player,"itm_hide_boots"),
     (try_end),
     (troop_add_item, player,"itm_khergit_guard_helmet",imod_crude),
     (troop_add_item, player,"itm_mail_chausses",imod_crude),
     (troop_add_item, player,"itm_sword_khergit_1",imod_plain),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_add_gold, player, 20),
     (troop_raise_proficiency, player,wpt_polearm,20),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
  (else_try),
     (eq,"$background_job",3),
     (eq,"$character_gender",tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,skl_riding,1),
     (troop_raise_skill, player,skl_weapon_master,1),
     (troop_raise_skill, player,skl_power_strike,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_add_gold, player, 20),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,30),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,30),
     (troop_raise_proficiency, player,wpt_polearm,30),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_raise_proficiency, player,wpt_throwing,10),
     (troop_add_item, player,"itm_leather_jerkin",imod_ragged),
     (troop_add_item, player,"itm_leather_boots",imod_tattered),
     (troop_add_item, player,"itm_sword_medieval_a", imod_rusty),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",3),
     (eq,"$character_gender",tf_female),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_persuasion,2),
     (troop_raise_skill, player,skl_riding,1),
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_add_item, player,"itm_dagger", 0),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_courser", imod_spirited),
     (troop_add_item, player,"itm_woolen_hood",imod_sturdy),
     (troop_add_item, player,"itm_woolen_dress",imod_sturdy),
     (troop_add_gold, player, 100),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_crossbow,15),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",4),
     (troop_raise_attribute, player,ca_charisma,2),
     (troop_raise_skill, player,skl_weapon_master,1),
     (troop_raise_skill, player,skl_persuasion,1),
     (troop_raise_skill, player,skl_leadership,1),
     (troop_raise_skill, player,skl_pathfinding,1),
     (troop_add_gold, player, 80),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,25),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_tabard",imod_sturdy),
     (troop_add_item, player,"itm_leather_boots",imod_ragged),
     (troop_add_item, player,"itm_sword_medieval_a", imod_rusty),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",5),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_skill, player,skl_weapon_master,1),
     (troop_raise_skill, player,skl_surgery,1),
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_raise_skill, player,skl_persuasion,1),
     (troop_add_gold, player, 80),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
     (troop_raise_proficiency, player,wpt_crossbow,20),
     (troop_add_item, player,"itm_linen_tunic",imod_sturdy),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_sword_medieval_a", imod_rusty),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (store_random_in_range, ":book_no", books_begin, books_end),
     (troop_add_item, player,":book_no",0), 
  (else_try),
     (eq,"$background_job",6),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_riding,1),
     (troop_raise_skill, player,skl_trade,1),
     (troop_raise_skill, player,skl_pathfinding,1),
     (troop_raise_skill, player,skl_inventory_management,1),
     (troop_add_item, player,"itm_leather_gloves",imod_plain),
     (troop_add_gold, player, 90),
     (troop_raise_proficiency, player,wpt_polearm,15),
     (troop_add_item, player,"itm_leather_jacket",0),
     (troop_add_item, player,"itm_leather_boots",imod_ragged),
     (troop_add_item, player,"itm_fur_hat",0),
     (troop_add_item, player,"itm_staff",0),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_saddle_horse",0),
     (troop_add_item, player,"itm_sumpter_horse",0),
     (troop_add_item, player,"itm_linen",0),
     (troop_add_item, player,"itm_pottery",0),
     (troop_add_item, player,"itm_wool",0),
     (troop_add_item, player,"itm_wool",0),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",7),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_weapon_master,1),
     (troop_raise_skill, player,skl_engineer,1),
     (troop_raise_skill, player,skl_tactics,1),
     (troop_raise_skill, player,skl_trade,1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,15),
     (troop_add_gold, player, 100),
     (troop_add_item, player,"itm_leather_boots",imod_ragged),
     (troop_add_item, player,"itm_coarse_tunic",0),
     (troop_add_item, player,"itm_sword_medieval_b", imod_balanced),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_tools",0),
     (troop_add_item, player,"itm_saddle_horse",0),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",8),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,skl_power_draw,1),
     (troop_raise_skill, player,skl_tracking,1),
     (troop_raise_skill, player,skl_spotting,1),
     (troop_raise_skill, player,skl_athletics,1),
     (troop_add_gold, player, 10),
     (troop_raise_proficiency, player,wpt_polearm,10),
     (troop_raise_proficiency, player,wpt_archery,35),
     (troop_add_item, player,"itm_axe",imod_chipped),
     (troop_add_item, player,"itm_rawhide_coat",0),
     (troop_add_item, player,"itm_hide_boots",0),
     (troop_add_item, player,"itm_hunting_bow",0),
     (troop_add_item, player,"itm_barbed_arrows",0),
     (troop_add_item, player,"itm_sumpter_horse",imod_heavy),
     (troop_add_item, player,"itm_dried_meat",0),
     (troop_add_item, player,"itm_dried_meat",0),
     (troop_add_item, player,"itm_furs",0),
     (troop_add_item, player,"itm_furs",0),
  (else_try),
     (eq,"$background_job",9),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,skl_trainer,1),
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_raise_skill, player,skl_first_aid,1),
     (troop_raise_skill, player,skl_surgery,1),
     (troop_add_item, player,"itm_leather_gloves",imod_ragged),
     (troop_add_item, player,"itm_quarter_staff",imod_heavy),
     (troop_add_item, player,"itm_black_hood",0),
     (troop_add_item, player,"itm_leather_jerkin",imod_ragged),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_add_gold, player, 10),
     (troop_raise_proficiency, player,wpt_polearm,50),
  (try_end),
  # Reason
  (try_begin),
     (eq,"$background_reason",1),
     (troop_raise_attribute, player,ca_strength,2),
     (troop_raise_skill, player,skl_power_strike,1),
  (else_try),
     (eq,"$background_reason",2),
     (troop_raise_attribute, player,ca_charisma,2),
     (troop_raise_skill, player,skl_ironflesh,1),
  (else_try),
     (eq,"$background_reason",3),
     (troop_raise_attribute, player,ca_agility,2),
     (troop_raise_skill, player,skl_pathfinding,1),
  (else_try),
     (eq,"$background_reason",4),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_attribute, player,ca_intelligence,1), 
     (troop_raise_skill, player,skl_wound_treatment,1),
     (troop_raise_proficiency, player,5,10),
  (else_try),
     (eq,"$background_reason",5),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_weapon_master,1),
  (else_try),
     (eq,"$background_reason",6),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,skl_looting,1),
  (try_end),
  (set_show_messages, 1), ]),

("randomize_background",
 [(store_script_param_1, ":in_presentation"),
  (store_random_in_range, reg11,   0,  200),
  (store_random_in_range, reg12, 100,  600),
  (store_random_in_range, reg13, 100,  800),
  (store_random_in_range, reg14, 100, 1000),
  (store_random_in_range, reg15, 100, 1000),
  (store_random_in_range, reg16, 100,  700),
  (store_div, "$character_gender", reg11, 100),
  (store_div, "$character_nationality", reg12, 100),
  (store_div, "$background_parent", reg13, 100),
  (store_div, "$background_childhood", reg14, 100),
  (store_div, "$background_job", reg15, 100),
  (store_div, "$background_reason", reg16, 100),
  (try_begin),
     (eq, ":in_presentation", 1),
     (store_mul, reg11, "$character_gender", 100),
     (store_mul, reg12, "$character_nationality", 100),
     (store_mul, reg13, "$background_parent", 100),
     (store_mul, reg14, "$background_childhood", 100),
     (store_mul, reg15, "$background_job", 100),
     (store_mul, reg16, "$background_reason", 100),      
     (overlay_set_val, "$g_presentation_obj_21", reg11),
     (overlay_set_val, "$g_presentation_obj_22", reg12),
     (overlay_set_val, "$g_presentation_obj_23", reg13),
     (overlay_set_val, "$g_presentation_obj_24", reg14),
     (overlay_set_val, "$g_presentation_obj_25", reg15),
     (overlay_set_val, "$g_presentation_obj_26", reg16),
  (try_end), ]),    

#-- Dunde's Player Background END 

Code:
skl_trade = 0
skl_leadership = 1
skl_prisoner_management = 2
skl_reserved_1 = 3
skl_reserved_2 = 4
skl_reserved_3 = 5
skl_reserved_4 = 6
skl_persuasion = 7
skl_engineer = 8
skl_first_aid = 9
skl_surgery = 10
skl_wound_treatment = 11
skl_inventory_management = 12
skl_spotting = 13
skl_pathfinding = 14
skl_tactics = 15
skl_tracking = 16
skl_trainer = 17
skl_reserved_5 = 18
skl_reserved_6 = 19
skl_reserved_7 = 20
skl_reserved_8 = 21
skl_looting = 22
skl_horse_archery = 23
skl_riding = 24
skl_athletics = 25
skl_shield = 26
skl_weapon_master = 27
skl_reserved_9 = 28
skl_reserved_10 = 29
skl_reserved_11 = 30
skl_reserved_12 = 31
skl_reserved_13 = 32
skl_power_draw = 33
skl_power_throw = 34
skl_power_strike = 35
skl_ironflesh = 36
skl_reserved_14 = 37
skl_reserved_15 = 38
skl_reserved_16 = 39
skl_reserved_17 = 40
skl_reserved_18 = 41
 
Code:
## Presentations
  ("cancel", "Cancel"),
  ("continue", "Continue"),
  ("close", "Close"),
  ("ok", "Ok"),
  ("random", "Random"),
  ("back", "Back"),
  ("prev", "Previous"),
  ("next", "Next"),
  ("not_available", "N/A"),
  ("long_string","01234567890123456789012345678901234567890"),
  ## Player Background
  ("background_label_1","Character Background"),
  ("background_label_2","The Story :"), 
  ("gender", "Gender"),
  ("gender_value", ":     {reg11?Female:Male}"),
  ("nationality", "Nationality"),
  ("nationality_value", ":     {s12}"),
  ("parent", "Parent"),
  ("parent_value", ":     {s13}"),
  ("childhood", "Childhood"),
  ("childhood_value", ":     {s14}"),
  ("jobs", "Job"),
  ("jobs_value", ":     {s15}"),
  ("reason", "Reason"),
  ("reason_value", ":     {s16}"),
  ("story", "{s17}^ "),
  ## Background stories
  ("swadian","Swadian"),
  ("vaegir","Vaegir"),
  ("khergit","Khergit"),
  ("nord","Nord"),
  ("rhodok","Rhodok"),
  ("parent_noble","Impoverished Noble"),
  ("parent_merchant","Travelling Merchant"),
  ("parent_guard","Veteran Warrior"),
  ("parent_forester","Hunter"),
  ("parent_nomad","Steppe Nomad"),
  ("parent_thief","Thief"),
  ("parent_priest","Priests"),
  ("childhood_page","Page at a Nobleman's Court"),
  ("childhood_apprentice","Craftsman's Apprentice"),
  ("childhood_stockboy","Shop Assistant"),
  ("childhood_urchin","Street Urchin"),
  ("childhood_nomad","Steppe Child"),
  ("childhood_mummer","Mummer"),
  ("childhood_courtier","Courtier"),
  ("childhood_noble","Noble in Training"),
  ("childhood_acolyte","Cleric Acolyte"),
  ("job_bravo","Travelling Bravo"),
  ("job_merc","Sellsword in Foreign Lands"),
  ("job_noble","{reg11?A lady-in-waiting:Squire}"),
  ("job_troubadour","Troubadour"),
  ("job_student","University Student"),
  ("job_peddler","Goods Peddler"),
  ("job_craftsman","Smith"),
  ("job_poacher","Game Poacher"),
  ("job_preacher","Itinerant Preacher"),
  ("reason_revenge","Personal revenge"),
  ("reason_death","The loss of a loved one"),
  ("reason_wanderlust","Wanderlust"),
  ("reason_fervor","Religious fervor"),
  ("reason_disown","Being forced out of your home"),
  ("reason_greed","Lust for money and power"),
  ("story_all", "{s17}{s1} "),
  ## The Legend Continues
  ("story_swadian","You are a Swadian."),
  ("story_vaegir","You are a Vaegir."),
  ("story_khergit","You are a Khergit."),
  ("story_nord","You are a Nord."),
  ("story_rhodok","You are a Rhodok."),
  ("story_parent_noble","You came into the world a {reg11?daughter:son} of declining nobility,\
 owning only the house in which they lived. However, despite your family's hardships,\
 they afforded you a good education and trained you from childhood for the rigors of aristocracy and life at court."),
  ("story_parent_merchant","You were born the {reg11?daughter:son} of travelling merchants,\
 always moving from place to place in search of a profit. Although your parents were wealthier than most\
 and educated you as well as they could, you found little opportunity to make friends on the road,\
 living mostly for the moments when you could sell something to somebody."),
  ("story_parent_guard","As a child, your family scrabbled out a meagre living from your father's wages\
 as a guardsman to the local lord. It was not an easy existence, and you were too poor to get much of an\
 education. You learned mainly how to defend yourself on the streets, with or without a weapon in hand."),
  ("story_parent_forester","You were the {reg11?daughter:son} of a family who lived off the woods,\
 doing whatever they needed to make ends meet. Hunting, woodcutting, making arrows,\
 even a spot of poaching whenever things got tight. Winter was never a good time for your family\
 as the cold took animals and people alike, but you always lived to see another dawn,\
 though your brothers and sisters might not be so fortunate."),
  ("story_parent_nomad","You were a child of the steppe, born to a tribe of wandering nomads who lived\
 in great camps throughout the arid grasslands.\
 Like the other tribesmen, your family revered horses above almost everything else, and they taught you\
 how to ride almost before you learned how to walk."),
  ("story_parent_thief","As the {reg11?daughter:son} of a thief, you had very little 'formal' education.\
 Instead you were out on the street, begging until you learned how to cut purses, cutting purses\
 until you learned how to pick locks, all the way through your childhood.\
 Still, these long years made you streetwise and sharp to the secrets of cities and shadowy backways."),
  ("story_parent_priest","A {reg11?daughter:son} that nobody wanted, you were left to the church as a baby,\
 a foundling raised by the priests and nuns to their own traditions.\
 You were only one of many other foundlings and orphans, but you nonetheless received a lot of attention\
 as well as many years of study in the church library and before the altar. They taught you many things.\
 Gradually, faith became such a part of your life that it was no different from the blood coursing through your veins."),
  ("story_childhood_page","As a {reg11?girl:boy} growing out of childhood,\
 you were sent to live in the court of one of the nobles of the land.\
 There, your first lessons were in humility, as you waited upon the lords and ladies of the household.\
 But from their chess games, their gossip, even the poetry of great deeds and courtly love, you quickly began to learn about the adult world of conflict\
 and competition. You also learned from the rough games of the other children, who battered at each other with sticks in imitation of their elders' swords."),
  ("story_childhood_apprentice","As a {reg11?girl:boy} growing out of childhood,\
 you apprenticed with a local craftsman to learn a trade. After years of hard work and study under your\
 new master, he promoted you to journeyman and employed you as a fully paid craftsman for as long as\
 you wished to stay."),
  ("story_childhood_stockboy","As a {reg11?girl:boy} growing out of childhood,\
 you apprenticed to a wealthy merchant, picking up the trade over years of working shops and driving caravans.\
 You soon became adept at the art of buying low, selling high, and leaving the customer thinking they'd\
 got the better deal."),
  ("story_childhood_urchin","As a {reg11?girl:boy} growing out of childhood,\
 you took to the streets, doing whatever you must to survive.\
 Begging, thieving and working for gangs to earn your bread, you lived from day to day in this violent world,\
 always one step ahead of the law and those who wished you ill."),
  ("story_childhood_nomad","As a {reg11?girl:boy} growing out of childhood,\
 you rode the great steppes on a horse of your own, learning the ways of the grass and the desert.\
 Although you sometimes went hungry, you became a skillful hunter and pathfinder in this trackless country.\
 Your body too started to harden with muscle as you grew into the life of a nomad {reg11?woman:man}."),
  ("story_childhood_mummer","As a {reg11?girl:boy} growing out of childhood,\
 you attached yourself to a troupe of wandering entertainers, going from town to town setting up mummer's\
 shows. It was a life of hard work, selling, begging and stealing your living from the punters who flocked\
 to watch your antics. Over time you became a performer well capable of attracting a crowd."),
  ("story_childhood_courtier","As a {reg11?girl:boy} growing out of childhood,\
 you spent much of your life at court, inserting yourself into the tightly-knit circles of nobility.\
 With the years you became more and more involved with the politics and intrigue demanded of a high-born {reg11?woman:man}.\
 You could not afford to remain a stranger to backstabbing and political violence, even if you wanted to."),
  ("story_childhood_noble","As a {reg11?girl:boy} growing out of childhood,\
 {reg11?you were trained and educated to the duties of a noble woman. You learned much about the household arts,\
 but even more about diplomacy and decorum, and all the things that a future husband might choose to speak of.\
 Truly, you became every inch as shrewd as any lord, though it would be rude to admit it aloud:you were trained and educated to perform the duties and wield the rights of a noble landowner.\
 The managing of taxes and rents were equally important in your education as diplomacy and even\
 personal defence. You learned everything you needed to become a lord of your own hall}."),
  ("story_childhood_acolyte","@As a {reg11?girl:boy} growing out of childhood,\
 you became an acolyte in the church, the lowest rank on the way to priesthood.\
 Years of rigorous learning and hard work followed. You were one of several acolytes,\
 performing most of the menial labour in the church in addition to being trained for more holy tasks.\
 On the night of your adulthood you were allowed to conduct your first service.\
 After that you were no longer an acolyte {reg11?girl:boy}, but a {reg11?girl:boy} waiting to take your vows into the service of God."),
  ("story_job_bravo","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 You left your old life behind to travel the roads as a mercenary, a bravo, guarding caravans for coppers\
 or bashing in heads for silvers. You became a {reg11?daughter:man} of the open road, working with bandits as often as against.\
 Going from fight to fight, you grew experienced at battle, and you learned what it was to kill."),
  ("story_job_merc","@Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 You signed on with a mercenary company and travelled far from your home. The life you found was rough and\
 ready, marching to the beat of strange drums and learning unusual ways of fighting.\
 There were men who taught you how to wield any weapon you desired, and plenty of battles to hone your skills.\
 You were one of the charmed few who survived through every campaign in which you marched."),
  ("story_job_noble","{reg11?Though the distinction felt sudden to you,\
 somewhere along the way you had become a woman, and the whole world seemed to change around you.\
 You joined the tightly-knit circle of women at court, ladies who all did proper ladylike things,\
 the wives and mistresses of noble men as well as maidens who had yet to find a husband.\
 However, even here you found politics at work as the ladies schemed for prominence and fought each other\
 bitterly to catch the eye of whatever unmarried man was in fashion at court.\
 You soon learned ways of turning these situations and goings-on to your advantage. With it came the\
 realisation that you yourself could wield great influence in the world, if only you applied yourself\
 with a little bit of subtlety.:Though the distinction felt sudden to you,\
 somewhere along the way you had become a man, and the whole world seemed to change around you.\
 When you were named squire to a noble at court, you practiced long hours with weapons,\
 learning how to deal out hard knocks and how to take them, too.\
 You were instructed in your obligations to your lord, and of your duties to those who might one day be your vassals.\
 But in addition to learning the chivalric ideal, you also learned about the less uplifting side\
 -- old warriors' stories of ruthless power politics, of betrayals and usurpations,\
 of men who used guile as well as valor to achieve their aims.}"),
  ("story_job_troubadour","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 You set out on your own with nothing except the instrument slung over your back and your own voice.\
 It was a poor existence, with many a hungry night when people failed to appreciate your play,\
 but you managed to survive on your music alone. As the years went by you became adept at playing the\
 drunken crowds in your taverns, and even better at talking anyone out of anything you wanted."),
  ("story_job_student","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 You found yourself as a student in the university of one of the great cities,\
 where you studied theology, philosophy, and medicine.\
 But not all your lessons were learned in the lecture halls.\
 You may or may not have joined in with your fellows as they roamed the alleys in search of wine, women, and a good fight.\
 However, you certainly were able to observe how a broken jaw is set,\
 or how an angry townsman can be persuaded to set down his club and accept cash compensation for the destruction of his shop."),
  ("story_job_peddler","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 Heeding the call of the open road, you travelled from village to village buying and selling what you could.\
 It was not a rich existence, but you became a master at haggling even the most miserly elders into\
 giving you a good price. Soon, you knew, you would be well-placed to start your own trading empire..."),
  ("story_job_craftsman","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 You pursued a career as a smith, crafting items of function and beauty out of simple metal.\
 As time wore on you became a master of your trade, and fine work started to fetch fine prices.\
 With food in your belly and logs on your fire, you could take pride in your work and your growing reputation."),
  ("story_job_poacher","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 Dissatisfied with common men's desperate scrabble for coin, you took to your local lord's own forests\
 and decided to help yourself to its bounty, laws be damned. You hunted stags, boars and geese and sold\
 the precious meat under the table. You cut down trees right under the watchmen's noses and turned them into\
 firewood that warmed many freezing homes during winter. All for a few silvers, of course."),
  ("story_job_preacher","Though the distinction felt sudden to you,\
 somewhere along the way you had become a {reg11?woman:man}, and the whole world seemed to change around you.\
 You packed your few belongings and went out into the world to spread the word of God. You preached to\
 anyone who would listen, and impressed many with the passion of your sermons. Though you had taken a vow\
 to remain in poverty through your itinerant years, you never lacked for food, drink or shelter; the\
 hospitality of the peasantry was always generous to a rising {reg11?woman:man} of God."),
  ("story_reason_revenge","^Only you know exactly what caused you to give up your old life and become an adventurer.\
 Still, it was not a difficult choice to leave, with the rage burning brightly in your heart.\
 You want vengeance. You want justice. What was done to you cannot be undone,\
 and these debts can only be paid in blood..."),
  ("story_reason_death","^Only you know exactly what caused you to give up your old life and become an adventurer.\
 All you can say is that you couldn't bear to stay, not with the memories of those you loved so close and so\
 painful. Perhaps your new life will let you forget,\
 or honour the name that you can no longer bear to speak..."),
  ("story_reason_wanderlust","^Only you know exactly what caused you to give up your old life and become an adventurer.\
 You're not even sure when your home became a prison, when the familiar became mundane, but your dreams of\
 wandering have taken over your life. Whether you yearn for some faraway place or merely for the open road and the\
 freedom to travel, you could no longer bear to stay in the same place. You simply went and never looked back..."),
  ("story_reason_fervor","^Only you know exactly what caused you to give up your old life and become an adventurer.\
 Regardless, the intense faith burning in your soul would not let you find peace in any single place.\
 There were others in the world, souls to be washed in the light of God. Now you preach wherever you go,\
 seeking to bring salvation and revelation to the masses, be they faithful or pagan. They will all know the\
 glory of God by the time you're done..."),
  ("story_reason_disown","^Only you know exactly what caused you to give up your old life and become an adventurer.\
 However, you know you cannot go back. There's nothing to go back to. Whatever home you may have had is gone\
 now, and you must face the fact that you're out in the wide wide world. Alone to sink or swim..."),
  ("story_reason_greed","^Only you know exactly what caused you to give up your old life and become an adventurer.\
 To everyone else, it's clear that you're now motivated solely by personal gain.\
 You want to be rich, powerful, respected, feared.\
 You want to be the one whom others hurry to obey.\
 You want people to know your name, and tremble whenever it is spoken.\
 You want everything, and you won't let anyone stop you from having it..."),

 
It works differences are trivial;
1-Warband, for some reason wants skl_xyz's in "". So skl_looting will give error but "skl_looting" won't.
2-Menus moved around a bit.
3-Kingdom_heroes_begin/end constant is gone, replaced with active_npcs_begin/end.
4-Replace main_party with "p_main_party" in banner selection presentation.

That's pretty much it. There are a bunch of defined constants for WB characters backgrounds, but they seem to do nothing, so nothing is missed by not assigning them anything.

Code:
#-- Dunde's Player Background BEGIN
#All "" marks placed one by one by KON_Air
#Because I totally forgot Replace functions of my editor.
("update_strings",
 [(store_add, ":str_pointer", "$character_nationality", nationality_init),
  (str_store_string, s12, ":str_pointer"),
  (store_add, ":str_pointer", "$background_parent", parent_init),
  (str_store_string, s13, ":str_pointer"),
  (store_add, ":str_pointer", "$background_childhood", childhood_init),
  (str_store_string, s14, ":str_pointer"),
  (store_add, ":str_pointer", "$background_job", job_init),
  (str_store_string, s15, ":str_pointer"),
  (store_add, ":str_pointer", "$background_reason", reason_init),
  (str_store_string, s16, ":str_pointer"),
  (str_clear, s17),
  (store_add, ":str_pointer", "$character_nationality", story_nationality_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_parent", story_parent_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_childhood", story_childhood_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_job", story_job_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_reason", story_reason_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (overlay_set_text, "$g_presentation_obj_11", "str_gender_value"),
  (overlay_set_text, "$g_presentation_obj_12", "str_nationality_value"),
  (overlay_set_text, "$g_presentation_obj_13", "str_parent_value"),
  (overlay_set_text, "$g_presentation_obj_14", "str_childhood_value"),
  (overlay_set_text, "$g_presentation_obj_15", "str_jobs_value"),
  (overlay_set_text, "$g_presentation_obj_16", "str_reason_value"),
  (overlay_set_text, "$g_presentation_obj_7", "str_story"),]),

("init_char_stat",
 [(set_show_messages, 0),
  # Gender     
  (try_begin),
     (eq,"$character_gender", tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_charisma,1),
  (else_try),
     (eq,"$character_gender", tf_female), 
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
  (try_end),
  (troop_raise_attribute, player,ca_strength,1),
  (troop_raise_attribute, player,ca_agility,1),
  (troop_raise_attribute, player,ca_charisma,1),
  (troop_raise_skill, player,skl_leadership,1),
  (troop_raise_skill, player,skl_riding,1),
  ## Commented Parts : Only for my Mod
  ## Nationality
  (assign, ":char_type", "$character_gender"),
  ##(try_begin),
  ##   (eq, "$character_nationality", 4),
  ##   (val_or, ":char_type", tf_tall),
  ##(try_end),
  ##(store_add, ":slot", ":char_type", slot_item_normal_male),
  (troop_set_type, player, ":char_type"),
  ##(troop_set_slot, player, slot_troop_gender, ":slot"),
  # Parent
  (try_begin),
     (eq,"$background_parent",1),
     (eq,"$character_gender",tf_male),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,2),
     (troop_raise_skill, player,"skl_weapon_master",1),
     (troop_raise_skill, player,"skl_power_strike",1),
     (troop_raise_skill, player,"skl_riding",1),
     (troop_raise_skill, player,"skl_tactics",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_polearm,10),
     (troop_add_item, player,"itm_tab_shield_round_a",imod_battered),
     (troop_set_slot, player, slot_troop_renown, 100),
     (call_script, "script_change_player_honor", 3),
     (troop_add_gold, player, 100),
  (else_try),
     (eq,"$background_parent",1),
     (eq,"$character_gender",tf_female),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_raise_skill, player,"skl_riding",2),
     (troop_raise_skill, player,"skl_first_aid",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
     (troop_set_slot, player, slot_troop_renown, 50),
     (troop_add_item, player,"itm_tab_shield_round_a",imod_battered),
     (troop_add_gold, player, 100),
  (else_try),
     (eq,"$background_parent",2),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_riding",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_skill, player,"skl_trade",2),
     (troop_raise_skill, player,"skl_inventory_management",1),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,10),
     (troop_add_gold, player, 250),
     (troop_set_slot, player, slot_troop_renown, 20),
  (else_try),
     (eq,"$background_parent",3),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_ironflesh",1),
     (troop_raise_skill, player,"skl_power_strike",1),
     (troop_raise_skill, player,"skl_weapon_master",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_skill, player,"skl_trainer",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,15),
     (troop_raise_proficiency, player,wpt_polearm,20),
     (troop_raise_proficiency, player,wpt_throwing,10),
     (troop_add_item, player,"itm_tab_shield_kite_b",imod_battered),
     (troop_add_gold, player, 50),
     (troop_set_slot, player, slot_troop_renown, 10),
  (else_try),
     (eq,"$background_parent",4),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,2),
     (troop_raise_skill, player,"skl_power_draw",1),
     (troop_raise_skill, player,"skl_tracking",1),
     (troop_raise_skill, player,"skl_pathfinding",1),
     (troop_raise_skill, player,"skl_spotting",1),
     (troop_raise_skill, player,"skl_athletics",1),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_archery,30),
     (troop_add_gold, player, 30),
  (else_try),
     (eq,"$background_parent",5),
     (eq,"$character_gender",tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_power_draw",1),
     (troop_raise_skill, player,"skl_horse_archery",1),
     (troop_raise_skill, player,"skl_pathfinding",1),
     (troop_raise_skill, player,"skl_riding",2),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_archery,30),
     (troop_raise_proficiency, player,wpt_throwing,10),
     (troop_add_item, player,"itm_tab_shield_small_round_a",imod_battered),
     (troop_add_gold, player, 15),
     (troop_set_slot, player, slot_troop_renown, 10),
  (else_try),
     (eq,"$background_parent",5),
     (eq,"$character_gender",tf_female),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_raise_skill, player,"skl_first_aid",1),
     (troop_raise_skill, player,"skl_pathfinding",1),
     (troop_raise_skill, player,"skl_riding",2),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,5),
     (troop_raise_proficiency, player,wpt_archery,20),
     (troop_raise_proficiency, player,wpt_throwing,5),
     (troop_add_item, player,"itm_tab_shield_small_round_a",imod_battered),
     (troop_add_gold, player, 20),
  (else_try),
     (eq,"$background_parent",6),
     (troop_raise_attribute, player,ca_agility,3),
     (troop_raise_skill, player,"skl_athletics",2),
     (troop_raise_skill, player,"skl_power_throw",1),
     (troop_raise_skill, player,"skl_inventory_management",1),
     (troop_raise_skill, player,"skl_looting",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
     (troop_raise_proficiency, player,wpt_throwing,20),
     (troop_add_item, player,"itm_throwing_knives",0),
     (troop_add_gold, player, 25),
  (else_try),
     (eq,"$background_parent",7),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_skill, player,"skl_prisoner_management",1),
     (troop_raise_proficiency, player,0,10),
     (troop_add_item, player,"itm_robe",0),
     (troop_add_item, player,"itm_wrapping_boots",0),
     (troop_add_item, player,"itm_club",0),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_add_item, player,"itm_sumpter_horse",0),
     (troop_add_gold, player, 10),
     (troop_set_slot, player, slot_troop_renown, 10),
  (try_end),
  # Childhood
  (try_begin),
     (eq,"$background_childhood",1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_skill, player,"skl_power_strike",1),
     (troop_raise_skill, player,"skl_persuasion",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,15),
     (troop_raise_proficiency, player,wpt_polearm,5),
  (else_try),
     (eq,"$background_childhood",2),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_skill, player,"skl_engineer",1),
     (troop_raise_skill, player,"skl_trade",1),
  (else_try),
     (eq,"$background_childhood",3),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_spotting",1),
     (troop_raise_skill, player,"skl_looting",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,15),
     (troop_raise_proficiency, player,wpt_throwing,5),
  (else_try),
     (eq,"$background_childhood",4),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,"skl_horse_archery",1),
     (troop_raise_skill, player,"skl_power_throw",1),
     (troop_raise_proficiency, player,wpt_archery,15),
     (call_script,"script_change_troop_renown", player, 5),
  (else_try),
     (eq,"$background_childhood",5),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_inventory_management",1),
     (troop_raise_skill, player,"skl_trade",1),
  (else_try),
     (eq,"$background_childhood",6),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_athletics",1),
     (troop_raise_skill, player,"skl_riding",1),
     (troop_raise_proficiency, player,1,5),
     (troop_raise_proficiency, player,2,5),
     (call_script,"script_change_troop_renown", player, 15),
  (else_try),
     (eq,"$background_childhood",7),
     (troop_raise_attribute, player,ca_charisma,1),#3),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,"skl_weapon_master",2),
     (troop_raise_proficiency, player,0,15),
     (troop_raise_proficiency, player,2,10),
     (troop_raise_proficiency, player,4,10),
     (call_script,"script_change_troop_renown", player, 20),
  (else_try),
     (eq,"$background_childhood",8),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_skill, player,"skl_tactics",1),
     (troop_raise_proficiency, player,0,10),
     (troop_raise_proficiency, player,1,10),
     (call_script,"script_change_troop_renown", player, 15),
  (else_try),
     (eq,"$background_childhood",9),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_skill, player,"skl_first_aid",1),
     (troop_raise_proficiency, player,2,30),
     (call_script,"script_change_troop_renown", player, 5),
  (try_end),
  # Job
  (try_begin),
     (eq,"$background_job",1),
     (troop_raise_attribute, player,ca_strength,2),
     (troop_raise_skill, player,"skl_power_strike",1),
     (troop_raise_skill, player,"skl_looting",1),
     (troop_raise_skill, player,skl_leadership,2),
     (troop_add_gold, player, 10),
     (try_begin),
        (this_or_next|player_has_item,"itm_sword_medieval_b"),
        (troop_has_item_equipped,player,"itm_sword_medieval_b"),
        (troop_remove_item, player,"itm_sword_medieval_b"),
     (try_end),
     (try_begin),
        (this_or_next|player_has_item,"itm_sword_medieval_c"),
        (troop_has_item_equipped,player,"itm_sword_medieval_c"),
        (troop_remove_item, player,"itm_sword_medieval_c"),
     (try_end),
     (troop_add_item, player,"itm_sword_medieval_b_small",0),
     (troop_add_item, player,"itm_wooden_shield",imod_battered),
     (troop_add_item, player,"itm_leather_jerkin",imod_ragged), 
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_raise_proficiency, player,0,10),
     (troop_raise_proficiency, player,4,10),
  (else_try),
     (eq,"$background_job",2),
     (troop_raise_attribute, player,ca_agility,2),
     (troop_raise_skill, player,"skl_weapon_master",3),
     (troop_raise_skill, player,"skl_athletics",1),
     (try_begin),
       (this_or_next|player_has_item,"itm_hide_boots"),
       (troop_has_item_equipped,player,"itm_hide_boots"),
       (troop_remove_item, player,"itm_hide_boots"),
     (try_end),
     (troop_add_item, player,"itm_khergit_guard_helmet",imod_crude),
     (troop_add_item, player,"itm_mail_chausses",imod_crude),
     (troop_add_item, player,"itm_sword_khergit_1",imod_plain),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_add_gold, player, 20),
     (troop_raise_proficiency, player,wpt_polearm,20),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
  (else_try),
     (eq,"$background_job",3),
     (eq,"$character_gender",tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,"skl_riding",1),
     (troop_raise_skill, player,"skl_weapon_master",1),
     (troop_raise_skill, player,"skl_power_strike",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_add_gold, player, 20),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,30),
     (troop_raise_proficiency, player,wpt_two_handed_weapon,30),
     (troop_raise_proficiency, player,wpt_polearm,30),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_raise_proficiency, player,wpt_throwing,10),
     (troop_add_item, player,"itm_leather_jerkin",imod_ragged),
     (troop_add_item, player,"itm_leather_boots",imod_tattered),
     (troop_add_item, player,"itm_sword_medieval_a", imod_rusty),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",3),
     (eq,"$character_gender",tf_female),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_persuasion",2),
     (troop_raise_skill, player,"skl_riding",1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_add_item, player,"itm_dagger", 0),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_courser", imod_spirited),
     (troop_add_item, player,"itm_woolen_hood",imod_sturdy),
     (troop_add_item, player,"itm_woolen_dress",imod_sturdy),
     (troop_add_gold, player, 100),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,10),
     (troop_raise_proficiency, player,wpt_crossbow,15),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",4),
     (troop_raise_attribute, player,ca_charisma,2),
     (troop_raise_skill, player,"skl_weapon_master",1),
     (troop_raise_skill, player,"skl_persuasion",1),
     (troop_raise_skill, player,"skl_leadership",1),
     (troop_raise_skill, player,"skl_pathfinding",1),
     (troop_add_gold, player, 80),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,25),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_tabard",imod_sturdy),
     (troop_add_item, player,"itm_leather_boots",imod_ragged),
     (troop_add_item, player,"itm_sword_medieval_a", imod_rusty),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",5),
     (troop_raise_attribute, player,ca_intelligence,2),
     (troop_raise_skill, player,"skl_weapon_master",1),
     (troop_raise_skill, player,"skl_surgery",1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_raise_skill, player,"skl_persuasion",1),
     (troop_add_gold, player, 80),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,20),
     (troop_raise_proficiency, player,wpt_crossbow,20),
     (troop_add_item, player,"itm_linen_tunic",imod_sturdy),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_sword_medieval_a", imod_rusty),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (store_random_in_range, ":book_no", books_begin, books_end),
     (troop_add_item, player,":book_no",0),
  (else_try),
     (eq,"$background_job",6),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_riding",1),
     (troop_raise_skill, player,"skl_trade",1),
     (troop_raise_skill, player,"skl_pathfinding",1),
     (troop_raise_skill, player,"skl_inventory_management",1),
     (troop_add_item, player,"itm_leather_gloves",imod_plain),
     (troop_add_gold, player, 90),
     (troop_raise_proficiency, player,wpt_polearm,15),
     (troop_add_item, player,"itm_leather_jacket",0),
     (troop_add_item, player,"itm_leather_boots",imod_ragged),
     (troop_add_item, player,"itm_fur_hat",0),
     (troop_add_item, player,"itm_staff",0),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_saddle_horse",0),
     (troop_add_item, player,"itm_sumpter_horse",0),
     (troop_add_item, player,"itm_linen",0),
     (troop_add_item, player,"itm_pottery",0),
     (troop_add_item, player,"itm_wool",0),
     (troop_add_item, player,"itm_wool",0),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",7),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_weapon_master",1),
     (troop_raise_skill, player,"skl_engineer",1),
     (troop_raise_skill, player,"skl_tactics",1),
     (troop_raise_skill, player,"skl_trade",1),
     (troop_raise_proficiency, player,wpt_one_handed_weapon,15),
     (troop_add_gold, player, 100),
     (troop_add_item, player,"itm_leather_boots",imod_ragged),
     (troop_add_item, player,"itm_coarse_tunic",0),
     (troop_add_item, player,"itm_sword_medieval_b", imod_balanced),
     (troop_add_item, player,"itm_hunting_crossbow",0),
     (troop_add_item, player,"itm_bolts",0),
     (troop_add_item, player,"itm_tools",0),
     (troop_add_item, player,"itm_saddle_horse",0),
     (troop_add_item, player,"itm_smoked_fish",0),
  (else_try),
     (eq,"$background_job",8),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_skill, player,"skl_power_draw",1),
     (troop_raise_skill, player,"skl_tracking",1),
     (troop_raise_skill, player,"skl_spotting",1),
     (troop_raise_skill, player,"skl_athletics",1),
     (troop_add_gold, player, 10),
     (troop_raise_proficiency, player,wpt_polearm,10),
     (troop_raise_proficiency, player,wpt_archery,35),
     (troop_add_item, player,"itm_axe",imod_chipped),
     (troop_add_item, player,"itm_rawhide_coat",0),
     (troop_add_item, player,"itm_hide_boots",0),
     (troop_add_item, player,"itm_hunting_bow",0),
     (troop_add_item, player,"itm_barbed_arrows",0),
     (troop_add_item, player,"itm_sumpter_horse",imod_heavy),
     (troop_add_item, player,"itm_dried_meat",0),
     (troop_add_item, player,"itm_dried_meat",0),
     (troop_add_item, player,"itm_furs",0),
     (troop_add_item, player,"itm_furs",0),
  (else_try),
     (eq,"$background_job",9),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_skill, player,"skl_trainer",1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_raise_skill, player,"skl_first_aid",1),
     (troop_raise_skill, player,"skl_surgery",1),
     (troop_add_item, player,"itm_leather_gloves",imod_ragged),
     (troop_add_item, player,"itm_quarter_staff",imod_heavy),
     (troop_add_item, player,"itm_black_hood",0),
     (troop_add_item, player,"itm_leather_jerkin",imod_ragged),
     (troop_add_item, player,"itm_hunting_crossbow", 0),
     (troop_add_item, player,"itm_bolts", 0),
     (troop_add_item, player,"itm_saddle_horse",imod_swaybacked),
     (troop_add_item, player,"itm_smoked_fish",0),
     (troop_add_gold, player, 10),
     (troop_raise_proficiency, player,wpt_polearm,50),
  (try_end),
  # Reason
  (try_begin),
     (eq,"$background_reason",1),
     (troop_raise_attribute, player,ca_strength,2),
     (troop_raise_skill, player,"skl_power_strike",1),
  (else_try),
     (eq,"$background_reason",2),
     (troop_raise_attribute, player,ca_charisma,2),
     (troop_raise_skill, player,"skl_ironflesh",1),
  (else_try),
     (eq,"$background_reason",3),
     (troop_raise_attribute, player,ca_agility,2),
     (troop_raise_skill, player,"skl_pathfinding",1),
  (else_try),
     (eq,"$background_reason",4),
     (troop_raise_attribute, player,ca_charisma,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_wound_treatment",1),
     (troop_raise_proficiency, player,5,10),
  (else_try),
     (eq,"$background_reason",5),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_weapon_master",1),
  (else_try),
     (eq,"$background_reason",6),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
     (troop_raise_skill, player,"skl_looting",1),
  (try_end),
  (set_show_messages, 1), 
  (jump_to_menu, "mnu_start_phase_2"),]),

("randomize_background",
 [(store_script_param_1, ":in_presentation"),
  (store_random_in_range, reg11,   0,  200),
  (store_random_in_range, reg12, 100,  600),
  (store_random_in_range, reg13, 100,  800),
  (store_random_in_range, reg14, 100, 1000),
  (store_random_in_range, reg15, 100, 1000),
  (store_random_in_range, reg16, 100,  700),
  (store_div, "$character_gender", reg11, 100),
  (store_div, "$character_nationality", reg12, 100),
  (store_div, "$background_parent", reg13, 100),
  (store_div, "$background_childhood", reg14, 100),
  (store_div, "$background_job", reg15, 100),
  (store_div, "$background_reason", reg16, 100),
  (try_begin),
     (eq, ":in_presentation", 1),
     (store_mul, reg11, "$character_gender", 100),
     (store_mul, reg12, "$character_nationality", 100),
     (store_mul, reg13, "$background_parent", 100),
     (store_mul, reg14, "$background_childhood", 100),
     (store_mul, reg15, "$background_job", 100),
     (store_mul, reg16, "$background_reason", 100),     
     (overlay_set_val, "$g_presentation_obj_21", reg11),
     (overlay_set_val, "$g_presentation_obj_22", reg12),
     (overlay_set_val, "$g_presentation_obj_23", reg13),
     (overlay_set_val, "$g_presentation_obj_24", reg14),
     (overlay_set_val, "$g_presentation_obj_25", reg15),
     (overlay_set_val, "$g_presentation_obj_26", reg16),
  (try_end), ]),   

#-- Dunde's Player Background END 
 
Thanks for noting the change for WB and missing main_party constants, KON_Air.
About the skl_* constants, it's look like header_skills.py 's not changed since previous MnB version (even older than 1.011) so skl_looting constant is not defined yet.
 
Its not just looting all of the skills will give error, for some reason some operations work some don't without "".
 
Are those sliding bars for switching selections?

It looks very good. May be add a small image to spice up the background?
 
ok, this is quite a old topic.
I'm starting to messy around with the module system, so maybe it's just me, but i tried to follow all the instruction. unfortunately, when i build the module, it gives me errors.

since the last version of module folder is surely updated, can anyone help me with a noobish guide for having this code in my game? Brytenwalda mod uses a similar presentation.
thanks in advance
 
This code's out of date and very basic. I wrote it when I learn to make a presentation so the only overlays I knew atm  wer buttons and sliders overlays  :oops:
Custom Commander's source code has a better and much more simple similar code on it as it use combobox overlay.
 
mb1jv.jpg

http://forums.taleworlds.com/index.php/topic,214026.msg5119731.html#msg5119731

I saw here an improved version ..  Much better is if there is a whole list of features to choose from, and the names do not appear when moving the slider arrow...
It may be better to continue working on these menus, and a supplement for religion, name, race, education, and so on ? :grin:
 
Good afternoon.
For myself, I have slightly modified the scripts so that, depending on nationality, specific clothes and weapons are given.
Everything works, however, after choosing the appearance, the character selection screen turns on again instead of the game, and only after re-selecting, the mod turns on. What could be the problem?

Presentation
Code:
("player_background", 0, mesh_load_window,
   [(ti_on_presentation_load,
     [(presentation_set_duration, 999999),
      (set_fixed_point_multiplier, 1000),
      # Init Values
      (str_clear, s11),(str_clear, s12),(str_clear, s13),(str_clear, s14),(str_clear, s15),(str_clear, s16),(str_clear, s17),
      (store_mul, reg11, "$character_gender", 100),
      (store_mul, reg12, "$character_nationality", 100),
      (store_mul, reg13, "$background_parent", 100),
      (store_mul, reg14, "$background_childhood", 100),
      (store_mul, reg15, "$background_job", 100),
      (store_mul, reg16, "$background_reason", 100),    
      # Create Objects
      (create_text_overlay, "$g_presentation_obj_1", "str_gender", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_2", "str_nationality", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_3", "str_parent", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_4", "str_childhood", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_5", "str_jobs", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_6", "str_reason", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_7", "str_story", tf_double_space|tf_scrollable),
      (create_text_overlay, "$g_presentation_obj_11", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_12", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_13", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_14", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_15", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_16", "str_long_string", tf_left_align),
      (create_text_overlay, "$g_presentation_obj_17", "str_background_label_1", tf_center_justify),
      (create_text_overlay, "$g_presentation_obj_18", "str_background_label_2", tf_left_align),
      (create_slider_overlay, "$g_presentation_obj_21",    0, 100), # Gender        : Male/Female
      (create_slider_overlay, "$g_presentation_obj_22",  100, 1500), # Nationality   : German, Russian, Ajam, Nord, Magyar, Sarranid, Danubian, Lithuanian, Polack, Balkanian, Horde, Turkoman, Caucasian, Arab, Italian
      (create_slider_overlay, "$g_presentation_obj_23",  100, 700), # Parent        : Noble, Merchant, Guard, Forester, Nomad, Thief, Priest
      (create_slider_overlay, "$g_presentation_obj_24",  100, 900), # Childhood     : Page, Apprentice, Stockboy, Urchin, Nomad, Mummer, Cortier, Noble, Acolyte
      (create_slider_overlay, "$g_presentation_obj_25",  100, 900), # Job           : bravo, merch, squire/lady, traubador, student, peddler, craftsman, poacher, preacher
      (create_slider_overlay, "$g_presentation_obj_26",  100, 600), # Reason        : revenge, death, wanderlust, disown, greed
      (create_game_button_overlay, "$g_presentation_obj_31", "str_cancel", tf_center_justify),      
      (create_game_button_overlay, "$g_presentation_obj_32", "str_continue", tf_center_justify),
      (create_game_button_overlay, "$g_presentation_obj_33", "str_random", tf_center_justify),      
      # Reposition Objects
      (position_set_y, pos1, 25), (position_set_x, pos3, 120), (position_set_y, pos3, 35),
      (position_set_x, pos1, 750), (overlay_set_position, "$g_presentation_obj_31" , pos1), (overlay_set_size, "$g_presentation_obj_31", pos3),
      (position_set_x, pos1, 900), (overlay_set_position, "$g_presentation_obj_32",  pos1), (overlay_set_size, "$g_presentation_obj_32", pos3),
      (position_set_x, pos1, 600), (overlay_set_position, "$g_presentation_obj_33",  pos1), (overlay_set_size, "$g_presentation_obj_33", pos3),
      (position_set_x, pos1,  500), (position_set_y, pos1, 650), (position_set_x, pos3, 2000), (position_set_y, pos3, 2000),
      (overlay_set_position, "$g_presentation_obj_17", pos1), (overlay_set_size, "$g_presentation_obj_17", pos3),
      (position_set_x, pos1,  50), (position_set_x, pos3, 1000), (position_set_y, pos3, 1000),
      (position_set_y, pos1, 550),        (overlay_set_position, "$g_presentation_obj_1", pos1), (overlay_set_size, "$g_presentation_obj_1", pos3),
      (position_set_y, pos1, 550-1*40),   (overlay_set_position, "$g_presentation_obj_2", pos1), (overlay_set_size, "$g_presentation_obj_2", pos3),      
      (position_set_y, pos1, 550-2*40),   (overlay_set_position, "$g_presentation_obj_3", pos1), (overlay_set_size, "$g_presentation_obj_3", pos3),
      (position_set_y, pos1, 550-3*40),   (overlay_set_position, "$g_presentation_obj_4", pos1), (overlay_set_size, "$g_presentation_obj_4", pos3),
      (position_set_y, pos1, 550-4*40),   (overlay_set_position, "$g_presentation_obj_5", pos1), (overlay_set_size, "$g_presentation_obj_5", pos3),
      (position_set_y, pos1, 550-5*40),   (overlay_set_position, "$g_presentation_obj_6", pos1), (overlay_set_size, "$g_presentation_obj_6", pos3),
      (position_set_x, pos1,  500), (position_set_y, pos1, 550),
      (overlay_set_position, "$g_presentation_obj_18", pos1), (overlay_set_size, "$g_presentation_obj_18", pos3),
      (position_set_x, pos1, 150), (position_set_x, pos3, 1000), (position_set_y, pos3, 1000),
      (position_set_y, pos1, 550),        (overlay_set_position, "$g_presentation_obj_11", pos1), (overlay_set_size, "$g_presentation_obj_11", pos3),
      (position_set_y, pos1, 550-1*40),   (overlay_set_position, "$g_presentation_obj_12", pos1), (overlay_set_size, "$g_presentation_obj_12", pos3),      
      (position_set_y, pos1, 550-2*40),   (overlay_set_position, "$g_presentation_obj_13", pos1), (overlay_set_size, "$g_presentation_obj_13", pos3),
      (position_set_y, pos1, 550-3*40),   (overlay_set_position, "$g_presentation_obj_14", pos1), (overlay_set_size, "$g_presentation_obj_14", pos3),
      (position_set_y, pos1, 550-4*40),   (overlay_set_position, "$g_presentation_obj_15", pos1), (overlay_set_size, "$g_presentation_obj_15", pos3),
      (position_set_y, pos1, 550-5*40),   (overlay_set_position, "$g_presentation_obj_16", pos1), (overlay_set_size, "$g_presentation_obj_16", pos3),
      (position_set_x, pos1, 300), (position_set_x, pos3, 1000), (position_set_y, pos3, 200),
      (position_set_y, pos1, 545),        (overlay_set_position, "$g_presentation_obj_21", pos1), (overlay_set_size, "$g_presentation_obj_21", pos3),
      (position_set_y, pos1, 545-1*40), (overlay_set_position, "$g_presentation_obj_22", pos1), (overlay_set_size, "$g_presentation_obj_22", pos3),      
      (position_set_y, pos1, 545-2*40), (overlay_set_position, "$g_presentation_obj_23", pos1), (overlay_set_size, "$g_presentation_obj_23", pos3),
      (position_set_y, pos1, 545-3*40), (overlay_set_position, "$g_presentation_obj_24", pos1), (overlay_set_size, "$g_presentation_obj_24", pos3),
      (position_set_y, pos1, 545-4*40), (overlay_set_position, "$g_presentation_obj_25", pos1), (overlay_set_size, "$g_presentation_obj_25", pos3),
      (position_set_y, pos1, 545-5*40), (overlay_set_position, "$g_presentation_obj_26", pos1), (overlay_set_size, "$g_presentation_obj_26", pos3),
      (position_set_x, pos1, 500), (position_set_y, pos1, 120),
      (overlay_set_position,  "$g_presentation_obj_7", pos1),
      (position_set_x, pos1, 450), (position_set_y, pos1, 425),
      (overlay_set_area_size, "$g_presentation_obj_7", pos1),
      (position_set_x, pos1, 800), (position_set_y, pos1, 800),
      (overlay_set_size,      "$g_presentation_obj_7", pos1),
      # Initial States
      (overlay_set_val, "$g_presentation_obj_21", reg11),
      (overlay_set_val, "$g_presentation_obj_22", reg12),
      (overlay_set_val, "$g_presentation_obj_23", reg13),
      (overlay_set_val, "$g_presentation_obj_24", reg14),
      (overlay_set_val, "$g_presentation_obj_25", reg15),
      (overlay_set_val, "$g_presentation_obj_26", reg16),
      (call_script, "script_update_strings"), ]),
    (ti_on_presentation_event_state_change,
     [(store_trigger_param_1, ":object"),
      (store_trigger_param_2, ":value"),      
      (set_fixed_point_multiplier, 1000),
      (assign, ":story_changed", 0),
      (try_begin),
         (eq, ":object", "$g_presentation_obj_21"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg11, ":new_value"),
         (overlay_set_val, "$g_presentation_obj_21", reg11),
         (assign, ":story_changed", 1),
      (else_try),      
         (eq, ":object", "$g_presentation_obj_22"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg12, ":new_value"),
         (overlay_set_val, "$g_presentation_obj_22", reg12),
         (assign, ":story_changed", 1),
      (else_try),      
         (eq, ":object", "$g_presentation_obj_23"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg13, ":new_value"),
         (overlay_set_val, "$g_presentation_obj_23", reg13),
         (assign, ":story_changed", 1),
      (else_try),      
         (eq, ":object", "$g_presentation_obj_24"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg14, ":new_value"),
         (overlay_set_val, "$g_presentation_obj_24", reg14),
         (assign, ":story_changed", 1),
      (else_try),      
         (eq, ":object", "$g_presentation_obj_25"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg15, ":new_value"),
         (overlay_set_val, "$g_presentation_obj_25", reg15),
         (assign, ":story_changed", 1),
      (else_try),      
         (eq, ":object", "$g_presentation_obj_26"),
         (store_mod, ":state", ":value", 100), (store_div, ":new_value", ":value", 100),
         (val_mul, ":new_value", 100),
         (try_begin),
            (ge, ":state", 50),
            (val_add, ":new_value", 100),
         (try_end),
         (assign, reg16, ":new_value"),
         (overlay_set_val, "$g_presentation_obj_26", reg16),
         (assign, ":story_changed", 1),      
      (else_try),
         (eq, ":object", "$g_presentation_obj_31"),
         (assign, "$creation_canceled", 999),
         (jump_to_menu, "mnu_start_game_1"),
         (presentation_set_duration, 0),
      (else_try),
         (eq, ":object", "$g_presentation_obj_32"),
         (assign, "$creation_canceled", 0),
         (call_script, "script_init_char_stat"),
         (try_begin),
            (eq, "$background_parent", 1),
            (start_presentation, "prsnt_banner_selection"),
         (else_try),
            (jump_to_menu, "mnu_auto_return"),
            (presentation_set_duration, 0),
         (try_end),    
      (else_try),
         (eq, ":object", "$g_presentation_obj_33"),
         (call_script, "script_randomize_background", 1),
         (assign, ":story_changed", 1),
      (try_end),
      (try_begin),
         (eq, ":story_changed", 1),
         (store_div, "$character_gender", reg11, 100),
         (store_div, "$character_nationality", reg12, 100),
         (store_div, "$background_parent", reg13, 100),
         (store_div, "$background_childhood", reg14, 100),
         (store_div, "$background_job", reg15, 100),
         (store_div, "$background_reason", reg16, 100),
         (call_script, "script_update_strings"),
      (try_end), ]), ]),

scripts
Python:
#-- Dunde's Player Background BEGIN

("update_strings",
 [(store_add, ":str_pointer", "$character_nationality", nationality_init),
  (str_store_string, s12, ":str_pointer"),
  (store_add, ":str_pointer", "$background_parent", parent_init),
  (str_store_string, s13, ":str_pointer"),
  (store_add, ":str_pointer", "$background_childhood", childhood_init),
  (str_store_string, s14, ":str_pointer"),
  (store_add, ":str_pointer", "$background_job", job_init),
  (str_store_string, s15, ":str_pointer"),
  (store_add, ":str_pointer", "$background_reason", reason_init),
  (str_store_string, s16, ":str_pointer"),
  (str_clear, s17),
  (store_add, ":str_pointer", "$character_nationality", story_nationality_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_parent", story_parent_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_childhood", story_childhood_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_job", story_job_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (store_add, ":str_pointer", "$background_reason", story_reason_init),
  (str_store_string, s1, ":str_pointer"),
  (str_store_string, s17, "str_story_all"),
  (overlay_set_text, "$g_presentation_obj_11", "str_gender_value"),
  (overlay_set_text, "$g_presentation_obj_12", "str_nationality_value"),
  (overlay_set_text, "$g_presentation_obj_13", "str_parent_value"),
  (overlay_set_text, "$g_presentation_obj_14", "str_childhood_value"),
  (overlay_set_text, "$g_presentation_obj_15", "str_jobs_value"),
  (overlay_set_text, "$g_presentation_obj_16", "str_reason_value"),
  (overlay_set_text, "$g_presentation_obj_7", "str_story"),]),

("init_char_stat",
 [(set_show_messages, 0),
  # Gender    
  (try_begin),
     (eq,"$character_gender", tf_male),
     (troop_raise_attribute, player,ca_strength,1),
     (troop_raise_attribute, player,ca_charisma,1),
  (else_try),
     (eq,"$character_gender", tf_female),
     (troop_raise_attribute, player,ca_agility,1),
     (troop_raise_attribute, player,ca_intelligence,1),
  (try_end),
  (troop_raise_attribute, player,ca_strength,1),
  (troop_raise_attribute, player,ca_agility,1),
  (troop_raise_attribute, player,ca_charisma,1),
  (troop_raise_skill, player,skl_leadership,1),
  (troop_raise_skill, player,skl_riding,1),
  ## Commented Parts : Only for my Mod
  ## Nationality
  (assign, ":char_type", "$character_gender"),
  (try_begin),
     (eq,"$character_nationality",1),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_gambeson_a_black",0),
     (troop_add_item, player,"itm_euro_hat",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",1),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",2),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_rus_kaftan",0),
     (troop_add_item, player,"itm_vaegir_fur_hat_a",0),
     (troop_add_item, player,"itm_rus_cav_boots",0),
     (troop_add_item, player,"itm_sword_khergit_b",0),
     (troop_add_item, player,"itm_rus_bow_a",0),
     (troop_add_item, player,"itm_arrows_b",0),
  (else_try),
     (eq,"$character_nationality",2),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_rus_female_dress",0),
     (troop_add_item, player,"itm_rus_cav_boots",0),
     (troop_add_item, player,"itm_rus_bow_a",0),
     (troop_add_item, player,"itm_arrows_b",0),
     (troop_add_item, player,"itm_rus_topor",0),
  (else_try),
     (eq,"$character_nationality",3),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_sarranid_dress_a",0),
     (troop_add_item, player,"itm_east_turban",0),
     (troop_add_item, player,"itm_sarranid_boots_a",0),
     (troop_add_item, player,"itm_east_bow",0),
     (troop_add_item, player,"itm_arrows_b",0),
     (troop_add_item, player,"itm_turk_sablya_pure_a",0),
  (else_try),
     (eq,"$character_nationality",3),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_sarranid_common_dress",0),
     (troop_add_item, player,"itm_east_lady_boots",0),
     (troop_add_item, player,"itm_otto_battle_axe",0),
  (else_try),
     (eq,"$character_nationality",4),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_gambeson_a_black",0),
     (troop_add_item, player,"itm_euro_hat",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",4),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",5),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_hun_kaftan_red",0),
     (troop_add_item, player,"itm_hun_hat",0),
     (troop_add_item, player,"itm_leather_boots",0),
     (troop_add_item, player,"itm_sword_2",0),
  (else_try),
     (eq,"$character_nationality",5),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_sword_2",0),
  (else_try),
     (eq,"$character_nationality",6),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_otto_cloth",0),
     (troop_add_item, player,"itm_turk_bow",0),
     (troop_add_item, player,"itm_arrows_b",0),
     (troop_add_item, player,"itm_ottoman_turban_a",0),
     (troop_add_item, player,"itm_sarranid_boots_b",0),
     (troop_add_item, player,"itm_otto_battle_axe",0),
  (else_try),
     (eq,"$character_nationality",6),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_sarranid_common_dress",0),
     (troop_add_item, player,"itm_east_lady_boots",0),
     (troop_add_item, player,"itm_otto_battle_axe",0),
  (else_try),
     (eq,"$character_nationality",7),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_mold_curie_4",0),
     (troop_add_item, player,"itm_caciula1",0),
     (troop_add_item, player,"itm_rus_shoes",0),
     (troop_add_item, player,"itm_balkan_mace3",0),
  (else_try),
     (eq,"$character_nationality",7),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",8),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_lit_leather",0),
     (troop_add_item, player,"itm_litva_cap",0),
     (troop_add_item, player,"itm_rus_cav_boots",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",8),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_rus_female_dress",0),
     (troop_add_item, player,"itm_rus_cav_boots",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",9),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_pol_jack",0),
     (troop_add_item, player,"itm_litva_cap",0),
     (troop_add_item, player,"itm_leather_boots",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",9),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",10),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_stradioti_kaftan",0),
     (troop_add_item, player,"itm_balkan_hat",0),
     (troop_add_item, player,"itm_leather_boots",0),
     (troop_add_item, player,"itm_espada_eslavona1",0),
  (else_try),
     (eq,"$character_nationality",10),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_otto_battle_axe",0),
  (else_try),
     (eq,"$character_nationality",11),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_halat_a",0),
     (troop_add_item, player,"itm_ttr_shapka_a",0),
     (troop_add_item, player,"itm_khergit_leather_boots",0),
     (troop_add_item, player,"itm_sword_khergit_1",0),
     (troop_add_item, player,"itm_tatar_kalkan_a",0),
     (troop_add_item, player,"itm_nomad_bow",0),
     (troop_add_item, player,"itm_arrows_b",0),
  (else_try),
     (eq,"$character_nationality",11),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_tatar_female_dress",0),
     (troop_add_item, player,"itm_tatar_fem_hat",0),
     (troop_add_item, player,"itm_east_lady_boots",0),
     (troop_add_item, player,"itm_nomad_bow",0),
     (troop_add_item, player,"itm_arrows_b",0),
     (troop_add_item, player,"itm_sword_khergit_1",0),
  (else_try),
     (eq,"$character_nationality",12),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_timur_halat",0),
     (troop_add_item, player,"itm_east_turban",0),
     (troop_add_item, player,"itm_sarranid_boots_b",0),
     (troop_add_item, player,"itm_otto_battle_axe",0),
  (else_try),
     (eq,"$character_nationality",12),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_sarranid_common_dress",0),
     (troop_add_item, player,"itm_east_lady_boots",0),
     (troop_add_item, player,"itm_otto_battle_axe",0),
  (else_try),
     (eq,"$character_nationality",13),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_cau_chepken",0),
     (troop_add_item, player,"itm_cau_fur_hat",0),
     (troop_add_item, player,"itm_sarranid_boots_b",0),
     (troop_add_item, player,"itm_east_bow",0),
     (troop_add_item, player,"itm_arrows_b",0),
     (troop_add_item, player,"itm_qama_dagger",0),
  (else_try),
     (eq,"$character_nationality",13),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_tatar_female_dress",0),
     (troop_add_item, player,"itm_east_lady_boots",0),
     (troop_add_item, player,"itm_woman_shawl",0),
     (troop_add_item, player,"itm_qama_dagger",0),
  (else_try),
     (eq,"$character_nationality",14),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_archery,10),
     (troop_add_item, player,"itm_saracen_shirt",0),
     (troop_add_item, player,"itm_east_turban",0),
     (troop_add_item, player,"itm_sarranid_boots_b",0),
     (troop_add_item, player,"itm_arabian_sword_a",0),
  (else_try),
     (eq,"$character_nationality",14),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_sarranid_common_dress",0),
     (troop_add_item, player,"itm_east_lady_boots",0),
     (troop_add_item, player,"itm_arabian_sword_a",0),
  (else_try),
     (eq,"$character_nationality",15),
     (eq,"$character_gender",tf_male),
     (troop_raise_proficiency, player,wpt_crossbow,10),
     (troop_add_item, player,"itm_aketon",0),
     (troop_add_item, player,"itm_euro_beret_b",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_italian_falchion_h1",0),
  (else_try),
     (eq,"$character_nationality",15),
     (eq,"$character_gender",tf_female),
     (troop_add_item, player,"itm_dress",0),
     (troop_add_item, player,"itm_woolen_hose",0),
     (troop_add_item, player,"itm_italian_falchion_h1",0),
  (try_end),
  ##(store_add, ":slot", ":char_type", slot_item_normal_male),
  (troop_set_type, player, ":char_type"),
  ##(troop_set_slot, player, slot_troop_gender, ":slot"),

[B]I didn't change the rest of the code[/B]

("randomize_background",
 [(store_script_param_1, ":in_presentation"),
  (store_random_in_range, reg11,   0,  200),
  (store_random_in_range, reg12, 100,  600),
  (store_random_in_range, reg13, 100,  800),
  (store_random_in_range, reg14, 100, 1000),
  (store_random_in_range, reg15, 100, 1000),
  (store_random_in_range, reg16, 100,  700),
  (store_div, "$character_gender", reg11, 100),
  (store_div, "$character_nationality", reg12, 100),
  (store_div, "$background_parent", reg13, 100),
  (store_div, "$background_childhood", reg14, 100),
  (store_div, "$background_job", reg15, 100),
  (store_div, "$background_reason", reg16, 100),
  (try_begin),
     (eq, ":in_presentation", 1),
     (store_mul, reg11, "$character_gender", 100),
     (store_mul, reg12, "$character_nationality", 100),
     (store_mul, reg13, "$background_parent", 100),
     (store_mul, reg14, "$background_childhood", 100),
     (store_mul, reg15, "$background_job", 100),
     (store_mul, reg16, "$background_reason", 100),    
     (overlay_set_val, "$g_presentation_obj_21", reg11),
     (overlay_set_val, "$g_presentation_obj_22", reg12),
     (overlay_set_val, "$g_presentation_obj_23", reg13),
     (overlay_set_val, "$g_presentation_obj_24", reg14),
     (overlay_set_val, "$g_presentation_obj_25", reg15),
     (overlay_set_val, "$g_presentation_obj_26", reg16),
  (try_end), ]),  

#-- Dunde's Player Background END
 
Back
Top Bottom