The Guide Of Useful Scripts

Do you think this thread should be stickie?

  • Yes

    Votes: 510 94.8%
  • No

    Votes: 28 5.2%

  • Total voters
    538

Users who are viewing this thread

New Kingdom Management

Berserker Pride said:
Ok The Kingdom Management code is complete.  I will gradually add to it over time.  It currently lacks any kind of diplomacy.  I imagine I will try to tailor it like the new Warband singleplayer.  Essentially as your empire grows larger in Warband kingdoms will slowly begin dealing with you diplomatically.  But in the beginning they don't talk to you at all.  But on topic all the code works and should serve as a good base for me to improve it.
Certain things would be better served as options in menus.
Off the top of my head
Kingdom Colour.
Kingdom Culture if you want the player to choose from the five native kingdoms.  I think NE had your companion army culture depend on who was leading it.
NE also has something where you can bribe an existing Lord with a castle to join your kingdom.  Which is an interesting idea too.
Note:If you don't have as many factions as me you will have to change every instance of fac_kingdom_8 and fac_kingdom_9 to an existing faction.
And also every instance of fac_culture_8 and fac_culture_9
Remove any line that looks like this (eq, "$character_gender",tf_gutts), or (neq,"$character_gender",tf_gutts),

Module_Constants [Search for kingdom_heroes_begin]
kingdom_heroes_begin = "trp_npc1"
kingdom_heroes_end = kingdom_ladies_begin
####I'm not sure where those values usually start but change kingdom_heroes_begin to = "trp_npc1"
####If you add any new companions to your module they must go just after the previous companions.
Module_Dialogues
  [anyone,"view_member_char_requested", [], "All right, let me tell you...", "do_member_view_char",[(change_screen_view_character)]],####This is not new I simply put the dialogue after this line.

Talk to any of your members with over 15 charisma.
####################################
  #Kingdom Management
#################################### 
  [anyone|plyr, "member_talk", [
        # (eq, "$talk_array_no", -1),
      (store_attribute_level,":companion_charisma","$g_talk_troop",3),
      (ge,":companion_charisma",15),
      (assign,":num_centers",0),
      (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":lord", ":center_no", slot_town_lord),
        (eq,":lord","trp_player"),
        (val_add,":num_centers",1),
      (try_end),
      (ge,":num_centers",1)],
     
      "I have decided to promote you.  You have shown enough leadership to be capable of managing your own Warband.",
      "assign_fief_1",[
      (troop_set_slot,"$g_talk_troop",slot_troop_change_to_faction,"fac_player_supporters_faction"),
      (troop_set_slot,"$g_talk_troop",slot_troop_occupation, slto_kingdom_hero),
      (troop_set_slot, "$g_talk_troop", slot_troop_wealth, 4000),###The higher you set this number the more troops will be in your companions army
      (try_begin),
          (store_skill_level,":companion_leadership",skl_leadership,"$g_talk_troop"),
          (ge,":companion_leadership",:cool:,
          (troop_set_slot, "$g_talk_troop", slot_troop_renown, 500),###
          (troop_set_slot, "$g_talk_troop", slot_troop_wealth, 6000),###Really big army if your companion has a lot of leadership
      (try_end),
          (try_begin),
          (eq,"$character_gender",tf_gutts),
          (troop_set_slot, "$g_talk_troop", slot_troop_original_faction,"fac_kingdom_8"),###I preset the player faction with unique troops
###Another method would be to select your nationality at the start and have that choice be reflected here in the troop types your commanders hire.
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_kingdom_8"),
      (else_try),
          (neq,"$character_gender",tf_gutts),###If you don't start as race Gutts you get a different troop tree
          (troop_set_slot, "$g_talk_troop", slot_troop_original_faction,"fac_kingdom_9"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_kingdom_9"),
      (try_end),
      (party_remove_members,"p_main_party","$g_talk_troop",1),
      (call_script, "script_change_player_relation_with_troop", "$g_talk_troop", 40),
      (troop_get_slot, ":player_banner", "trp_player", slot_troop_banner_scene_prop),#This assigns player kingdom lords your banner
      (troop_set_slot, "$g_talk_troop", slot_troop_banner_scene_prop,":player_banner"),     
      ]],

  [anyone|plyr, "assign_fief_1", [
        (assign,":num_centers",0),###All of this ensure that the player is lord of a castle he can give away.
      (try_for_range, ":center_no", castles_begin, castles_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":lord", ":center_no", slot_town_lord),
        (eq,":lord","trp_player"),
        (val_add,":num_centers",1),
      (try_end),
      (ge,":num_centers",1)],
     
    "You are to become lord of a castle.",
    "assign_fief_2",[
        (assign,":eek:nly_one_castle",0),
        (try_for_range, ":center_no", castles_begin, castles_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
        (eq,":eek:nly_one_castle",0),
        (party_set_slot, ":center_no", slot_town_lord,"$g_talk_troop"),#######
       
        (try_for_range, ":cur_village", villages_begin, villages_end),
        (store_faction_of_party, ":center_faction", ":cur_village"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (try_begin),
        (eq,"$character_gender",tf_gutts),###This all specifically sets the troop types for your kingdom.
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_young_blood"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_geselle"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_hardtmann"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_schwertmeister"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_drachemeister"),
        (party_set_slot, ":cur_village", slot_center_culture,  "fac_culture_8"),#Sets troop types for your villages.
        (party_set_slot, ":cur_village", slot_center_original_faction,  "fac_kingdom_8"),
        (party_set_slot, ":cur_village", slot_center_ex_faction,  "fac_kingdom_8"),
        (else_try),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_rebel_recruit"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_rebel_footman"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_rebel_javelineer"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_rebel_cavalry"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_rebel_clansman"),
        (party_set_slot, ":cur_village", slot_center_culture,  "fac_culture_9"),
        (party_set_slot, ":cur_village", slot_center_original_faction,  "fac_kingdom_9"),
        (party_set_slot, ":cur_village", slot_center_ex_faction,  "fac_kingdom_9"),
        (try_end),
        (party_slot_eq, ":cur_village", slot_village_bound_center, ":center_no"),
        (party_set_slot, ":cur_village", slot_town_lord,"trp_player"),#######
        (try_end),
        (val_add,":eek:nly_one_castle",1),#######This make the code only run once so your companion only gets one castle randomly.
        (try_end)]],

  [anyone|plyr, "assign_fief_1", [
      (assign,":num_centers",0),#Ensures you have a town to give.
      (try_for_range, ":center_no", towns_begin, towns_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":lord", ":center_no", slot_town_lord),
        (eq,":lord","trp_player"),
        (val_add,":num_centers",1),
      (try_end),
      (ge,":num_centers",1)],

    "You are to become lord of a town.",
    "assign_fief_2",[
        (assign,":eek:nly_one_castle",0),
        (try_for_range, ":center_no", towns_begin, towns_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":lord", ":center_no", slot_town_lord),
        (eq,":lord","trp_player"),
        (eq,":eek:nly_one_castle",0),
        (party_set_slot, ":center_no", slot_town_lord,"$g_talk_troop"),
        (try_for_range, ":cur_village", villages_begin, villages_end),########
        (store_faction_of_party, ":center_faction", ":cur_village"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (try_begin),
        (eq,"$character_gender",tf_gutts),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_young_blood"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_geselle"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_hardtmann"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_schwertmeister"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_drachemeister"),
        (party_set_slot, ":cur_village", slot_center_culture,  "fac_culture_8"),
        (party_set_slot, ":cur_village", slot_center_original_faction,  "fac_kingdom_8"),
        (party_set_slot, ":cur_village", slot_center_ex_faction,  "fac_kingdom_8"),
        (else_try),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_rebel_recruit"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_rebel_footman"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_rebel_javelineer"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_rebel_cavalry"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_rebel_clansman"),
        (party_set_slot, ":cur_village", slot_center_culture,  "fac_culture_9"),
        (party_set_slot, ":cur_village", slot_center_original_faction,  "fac_kingdom_9"),
        (party_set_slot, ":cur_village", slot_center_ex_faction,  "fac_kingdom_9"),
        (try_end),
        (party_slot_eq, ":cur_village", slot_village_bound_center, ":center_no"),
        (party_set_slot, ":cur_village", slot_town_lord,"trp_player"),
        (try_end),###########
        (val_add,":eek:nly_one_castle",1),
        (try_end)]],
  [anyone, "assign_fief_2", [],"I will not fail you {playername}.  Should you need assistance on the battlefield call for me.","close_window",[]], 
####################################
  #Kingdom Management End
####################################
[anyone, "event_triggered",
  [
    (faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "$g_talk_troop"),
    (neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),#Kingdom Management you don't want this coming up for ###your own kindom
    (ge, "$g_center_taken_by_player_faction", 0),
    (str_store_party_name, s1, "$g_center_taken_by_player_faction"),
    ],
  "{s1} is not being managed by anyone. Whom shall I put in charge?", "center_captured_lord_advice",
  []],

#KINGDOM MANAGEMENT ####################
  [anyone|plyr,"lord_give_order", [
      (assign,":num_centers",0),
      (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":lord", ":center_no", slot_town_lord),
        (eq,":lord","$g_talk_troop"),
        (val_add,":num_centers",1),
      (try_end),
      (ge,":num_centers",1)],
  "The kingdom is running low on resources.  I must disband your army and temporarily retake direct control of your territory",
  "remove_vassal_1",
  []],
  [anyone,"remove_vassal_1",[],"This would force me to disband all my troops to their homes are you sure you want to do that?",
  "remove_vassal_2",[]],
  [anyone|plyr,"remove_vassal_2",[],"Oh in that case never mind.",
  "lord_talk",[]],
  [anyone|plyr,"remove_vassal_2",[],"Unfortunately yes, disband your troops and rejoin my main party.",
  "lord_talk",[
      (try_for_range, ":center_no", castles_begin, castles_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":lord", ":center_no", slot_town_lord),
        (eq,":lord","$g_talk_troop"),
        (call_script, "script_give_center_to_lord", ":center_no", "trp_player", 0),
    (try_end),
    (troop_get_slot,":companion_army","$g_talk_troop",slot_troop_leaded_party),
    (remove_party,":companion_army"),
    (troop_set_slot,"$g_talk_troop",slot_troop_occupation, slto_player_companion),
    (party_force_add_members,"p_main_party","$g_talk_troop",1)]],
   

   
#KINGDOM MANAGEMENT END ############
  [anyone|plyr,"lord_give_order", [],##The second kingdom management goes just above this line.  This Dialogue lets you disband a lord.  Eventually I ###want to have it automatically go to the troop transfer screen first so you can fill your part with as many of your companions troops as possible.
###
Module_Scripts [Search for the Scripts in question then edit them]
("activate_deactivate_player_faction",###Replace this script with this new one.  or just sub in the lines between Kingdom Management or with ### #beside them
    [
      (store_script_param, ":last_interaction_with_faction", 1),
      (try_begin),
        (assign, ":has_center", 0),
        (try_for_range, ":cur_center", centers_begin, centers_end),
          (store_faction_of_party, ":cur_center_faction", ":cur_center"),
          (eq, ":cur_center_faction", "fac_player_supporters_faction"),
          (assign, ":has_center", 1),
        (try_end),
        (try_begin),
          (eq, ":has_center", 1),
          (neg|faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_active),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
          (str_store_faction_name, s1, ":last_interaction_with_faction"),
          (faction_set_name, "fac_player_supporters_faction", "@Kingdom of {playername}"),######New name for the kingdom
          (try_begin),######Kingdom Management Begin
              (eq, "$character_gender", tf_gutts),
              (faction_set_color, "fac_player_supporters_faction", 0xFFAAAAAA),###set your colour I will eventually make this a menu choice
          (else_try),
              (faction_set_color, "fac_player_supporters_faction", 0xFF7A4800),###set your colour
          (try_end),####Kingdom Management End
          (assign, "$players_kingdom", "fac_player_supporters_faction"),
          (assign, "$g_player_banner_granted", 1),
          (faction_set_slot,"fac_player_supporters_faction", slot_faction_marshall,"trp_player"),###Kingdom Management make the player marshall automatically.
          (call_script, "script_store_average_center_value_per_faction"),
          (call_script, "script_update_all_notes"),
          (call_script, "script_add_notification_menu", "mnu_notification_player_faction_active", 0, 0),
        (else_try),
          (eq, ":has_center", 0),
          (faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_active),
          (le, "$supported_pretender", 0),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_state, sfs_inactive),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_leader, "trp_player"),
          (assign, "$players_kingdom", 0),
          (assign, "$players_oath_renounced_against_kingdom", 0),
          (assign, "$players_oath_renounced_given_center", 0),
          (assign, "$players_oath_renounced_begin_time", 0),
          (call_script, "script_store_average_center_value_per_faction"),
          (call_script, "script_update_all_notes"),
          (call_script, "script_add_notification_menu", "mnu_notification_player_faction_deactive", 0, 0),
        (try_end),
      (try_begin),###Kingdom Management Begin this might be unnecessary as I have all this in dialogues.
    (eq, "$character_gender", tf_gutts),
    (faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_culture_8"),
      (else_try),
    (neq, "$character_gender", tf_gutts),
    (faction_set_slot, "fac_player_supporters_faction", slot_faction_culture, "fac_culture_9"),
      (try_end),     
      (try_begin),
      (eq, "$character_gender", tf_gutts),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_deserter_troop, "trp_jager"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_guard_troop, "trp_schwertmeister"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_messenger_troop, "trp_gutts_messenger"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_prison_guard_troop, "trp_gutts_prison_guard"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_castle_guard_troop, "trp_gutts_castle_guard"),
          (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_8_reinforcements_a"),
          (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_8_reinforcements_b"),
          (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_8_reinforcements_c"),
      (else_try),
      (neq, "$character_gender", tf_gutts),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_deserter_troop, "trp_rebel_crossbowman"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_guard_troop, "trp_rebel_clansman"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_messenger_troop, "trp_rebel_initiate"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_prison_guard_troop, "trp_rebel_guardian"),
          (faction_set_slot, "fac_player_supporters_faction", slot_faction_castle_guard_troop, "trp_rebel_handgonnemann"),
          (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_9_reinforcements_a"),
          (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_9_reinforcements_b"),
          (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_9_reinforcements_c"),
      (try_end),###Kingdom Management End
    (try_end),
]),
####################################################################################
("cf_get_random_active_faction_except_player_faction_and_faction",###Now when a faction is defeated the lords have a chance of joining your ###kingdom.
    [
      (store_script_param_1, ":except_faction_no"),
      (assign, ":num_factions", 0),
      (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
        #(neq, ":faction_no", "fac_player_supporters_faction"),#Kingdom Management just tab this line out now they can join player faction
        (neq, ":faction_no", ":except_faction_no"),
        (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
        (val_add, ":num_factions", 1),
      (try_end),
      (gt, ":num_factions", 0),
      (assign, ":selected_faction", -1),
      (store_random_in_range, ":random_faction", 0, ":num_factions"),
      (try_for_range, ":faction_no", kingdoms_begin, kingdoms_end),
        (ge, ":random_faction", 0),
        #(neq, ":faction_no", "fac_player_supporters_faction"),#Kingdom Management just tab this line out now they can join player faction
        (neq, ":faction_no", ":except_faction_no"),
        (faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
        (val_sub, ":random_faction", 1),
        (lt, ":random_faction", 0),
        (assign, ":selected_faction", ":faction_no"),
      (try_end),
      (assign, reg0, ":selected_faction"),
  ]),
#########################################################################################
#script_village_recruit_volunteers_recruit#Kingdom Management search for this script. Replace the existing with this.
  # INPUT: none
  # OUTPUT: none
  ("village_recruit_volunteers_recruit",#KKM RECRUIT special from whichever faction you are.
    [(store_faction_of_party, ":center_faction", "$current_town"),
    (try_begin),
    (eq,":center_faction","fac_player_supporters_faction"),
    (faction_get_slot, ":volunteer_troop", "fac_player_supporters_faction", slot_faction_tier_1_troop),
    (else_try),
    (party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
    (try_end),   
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
    (store_skill_level, ":skill", "skl_persuasion", "trp_player"),#persuasion addition
    (val_add, ":volunteer_amount", ":skill"),#persuasion addition
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (val_min, ":volunteer_amount", ":free_capacity"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
    (val_min, ":volunteer_amount", ":gold_capacity"),
    (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
    (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
    (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
    (troop_remove_gold, "trp_player", ":cost"),
    ]),
Module_Triggers New Triggers go at the bottom before the last ]
And make sure you put a comma at the end of the previous trigger if there isn't one already.
It should look like ]), this not ])
(24*7,0,0,[(faction_slot_eq, "fac_player_supporters_faction", slot_faction_state, sfs_inactive)],#Disable all lords if your faction is wiped out. Kingdom #Management 
    [(try_for_range, ":companion", "trp_npc1","trp_kingdom_heroes_including_player_begin"),
    (troop_slot_eq,":companion",slot_troop_occupation, slto_kingdom_hero),#Companion needs to be a lord     
    (troop_get_slot,":companion_army",":companion",slot_troop_leaded_party),
    (remove_party,":companion_army"),
    (troop_set_slot,":companion",slot_troop_occupation, slto_player_companion),
    (party_force_add_members,"p_main_party",":companion",1),
    (display_message,"@Your faction has been eliminated. Any surviving leaders have disbanded their troops and rejoined your party.",0xFFFFFFAA),     
    (try_end),
    ]),
#####################################################################
(24*7,0,0,[(assign,":num_centers",0),#Disband Centreless lords every week.  KINGDOM MANAGEMENT this gives you some time to retake a castle if a #lord loses their centre.
      (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (eq, ":center_faction", "fac_player_supporters_faction"),
        (val_add,":num_centers",1),
      (try_end),
      (assign,":num_lords",0),
      (try_for_range,":lord","trp_npc1","trp_kingdom_heroes_including_player_begin"),#Need to put all potential companions in a range.
        (troop_slot_eq, ":lord", slot_troop_occupation, slto_kingdom_hero),
        (val_add,":num_lords",1),
      (try_end),
      (lt,":num_centers",":num_lords"),
      (display_message,"@One of your centres has fallen. Within the week one of your commanders will be forced to disband their forces.")],#triggered when less centres than lords.  KINGDOM MANAGEMENT

  [(try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
    (store_faction_of_party, ":center_faction", ":center_no"),
    (eq, ":center_faction", "fac_player_supporters_faction"), #Only centers owned by player faction
  (try_for_range, ":companion", "trp_npc1","trp_kingdom_heroes_including_player_begin"),
    (troop_slot_eq,":companion",slot_troop_occupation, slto_kingdom_hero),#Companion needs to be a lord
    (try_begin),
    (neg|party_slot_eq,":center_no",slot_town_lord,":companion"),#Make him rejoin if he don't have a castle/town from the player faction
    (troop_get_slot,":companion_army",":companion",slot_troop_leaded_party),
    (remove_party,":companion_army"),
    (troop_set_slot,":companion",slot_troop_occupation, slto_player_companion),
    (party_force_add_members,"p_main_party",":companion",1),
    (display_message,"@The loss of their base of operations has forced one of your armies to disband.",0xFFFFFFAA),
  (try_end),
  (try_end),
  (try_end),
  ]),
Module_Simple_Triggers Edit the first trigger the next two are new.  Again make sure you add a comma to the previous trigger at the end of the file if their isn't one currently.
# Asking the ownership of captured centers to the player
  (3,
  [(faction_get_slot, ":leader", "fac_player_supporters_faction", slot_faction_leader),#KINGDOM MANAGEMENT
    (neq,":leader","trp_player"),#KINGDOM MANAGEMENT if you don't add these two lines random useless claimant conversations start with yourself
    (assign, "$g_center_taken_by_player_faction", -1),
    (try_for_range, ":center_no", centers_begin, centers_end),
      (eq, "$g_center_taken_by_player_faction", -1),
      (store_faction_of_party, ":center_faction", ":center_no"),
      (eq, ":center_faction", "fac_player_supporters_faction"),
      (this_or_next|party_slot_eq, ":center_no", slot_town_lord, stl_reserved_for_player),
      (this_or_next|party_slot_eq, ":center_no", slot_town_lord, stl_unassigned),
      (party_slot_eq, ":center_no", slot_town_lord, stl_rejected_by_player),
      (assign, "$g_center_taken_by_player_faction", ":center_no"),
    (try_end),
    (ge, "$g_center_taken_by_player_faction", 0),
    (start_map_conversation, ":leader"),
    ]),
################################################################################
(24*90,[#Every three months a massive campaign begins.

  (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),##All this trigger does is make lords more likely to form armies
      (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero), ##It also makes yours more obedient.
      (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, 90),##I will eventually make a feast event that costs you money but
      (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),##Does this for just your lords
  (try_end),
  (display_message,"@A time of war is upon you. The lords have mobilized their forces!",0xFFFFFFAA),
  ]),
################################################################################
  #Set flag trigger
(24,[##Updates your lords flags should you happen to change yours
(try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),
          (store_troop_faction, ":kingdom_hero_faction", ":kingdom_hero"),
          (eq, ":kingdom_hero_faction", "fac_player_supporters_faction"),
          (troop_get_slot,":player_banner","trp_player",slot_troop_banner_scene_prop),
          (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":player_banner"),
(try_end),
]),
 
Seems like there are troops in that code that doesn't exist. These lines can be found in Modules_Dialogues

Super Kitty Trollslayer said:
        (eq,"$character_gender",tf_gutts),###This all specifically sets the troop types for your kingdom.
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_young_blood"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_geselle"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_hardtmann"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_schwertmeister"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_drachemeister"),
        (party_set_slot, ":cur_village", slot_center_culture,  "fac_culture_8"),#Sets troop types for your villages.
        (party_set_slot, ":cur_village", slot_center_original_faction,  "fac_kingdom_8"),
        (party_set_slot, ":cur_village", slot_center_ex_faction,  "fac_kingdom_8"),
        (else_try),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_rebel_recruit"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_rebel_footman"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_rebel_javelineer"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_rebel_cavalry"),
        (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_rebel_clansman"),
        (party_set_slot, ":cur_village", slot_center_culture,  "fac_culture_9"),
        (party_set_slot, ":cur_village", slot_center_original_faction,  "fac_kingdom_9"),
        (party_set_slot, ":cur_village", slot_center_ex_faction,  "fac_kingdom_9"),
       
 
This would be if you wanted the player faction to have a unique troop tree.  If not set culture and faction to an existing kingdom and troops to match native troops. Probably shouldn't add this script to the list just yet.
 
That is a good idea naglfaar. Maybe I'll include a few lines of a player kingdom tree for module_troops in the code. I will have to ensure that they all use native weapons.
 
"tf_gutts" are not defined in native , what files i need to modyfy in module system to add this(gutts) .
 
Just delete it as I mentioned in the thread.  But I would wait on this. Phoenix got the code working but he probably had to modify it a bit.  I need to make the code entirely native compatible.
 
Berserker Pride said:
Just delete it as I mentioned in the thread.  But I would wait on this. Phoenix got the code working but he probably had to modify it a bit. I need to make the code entirely native compatible.

this would be great... :smile:
 
It is actually stupid you can only give your troops max agi_30, str_30 and so on. These variables are defined in header_troops.py.

I changed that file, so now everyone can give there troops a max of _255 (no higher value is possible with only changing header_troops.py, because we can only use 2 places: eg: str_243 = bignum | 0x000000f3) and a min of _1 :grin:.

-----------------------------------------------------------------------
So what to do:
Just change this (in header_troop.py!):

Code:
str_3            = bignum | 0x0000000003
str_4            = bignum | 0x0000000004
str_5            = bignum | 0x0000000005
str_6            = bignum | 0x0000000006
str_7            = bignum | 0x0000000007
str_8            = bignum | 0x0000000008
str_9            = bignum | 0x0000000009
str_10           = bignum | 0x000000000a
str_11           = bignum | 0x000000000b
str_12           = bignum | 0x000000000c
str_13           = bignum | 0x000000000d
str_14           = bignum | 0x000000000e
str_15           = bignum | 0x000000000f
str_16           = bignum | 0x0000000010
str_17           = bignum | 0x0000000011
str_18           = bignum | 0x0000000012
str_19           = bignum | 0x0000000013
str_20           = bignum | 0x0000000014
str_21           = bignum | 0x0000000015
str_22           = bignum | 0x0000000016
str_23           = bignum | 0x0000000017
str_24           = bignum | 0x0000000018
str_25           = bignum | 0x0000000019
str_26           = bignum | 0x000000001a
str_27           = bignum | 0x000000001b
str_28           = bignum | 0x000000001c
str_29           = bignum | 0x000000001d
str_30           = bignum | 0x000000001e
str_31           = bignum | 0x00000000ff

agi_3            = bignum | 0x0000030000
agi_4            = bignum | 0x0000040000
agi_5            = bignum | 0x0000050000
agi_6            = bignum | 0x0000060000
agi_7            = bignum | 0x0000070000
agi_8            = bignum | 0x0000080000
agi_9            = bignum | 0x0000090000
agi_10           = bignum | 0x00000a0000
agi_11           = bignum | 0x00000b0000
agi_12           = bignum | 0x00000c0000
agi_13           = bignum | 0x00000d0000
agi_14           = bignum | 0x00000e0000
agi_15           = bignum | 0x00000f0000
agi_16           = bignum | 0x0000100000
agi_17           = bignum | 0x0000110000
agi_18           = bignum | 0x0000120000
agi_19           = bignum | 0x0000130000
agi_20           = bignum | 0x0000140000
agi_21           = bignum | 0x0000150000
agi_22           = bignum | 0x0000160000
agi_23           = bignum | 0x0000170000
agi_24           = bignum | 0x0000180000
agi_25           = bignum | 0x0000190000
agi_26           = bignum | 0x00001a0000
agi_27           = bignum | 0x00001b0000
agi_28           = bignum | 0x00001c0000
agi_29           = bignum | 0x00001d0000
agi_30           = bignum | 0x00001e0000

int_3            = bignum | 0x0003000000
int_4            = bignum | 0x0004000000
int_5            = bignum | 0x0005000000
int_6            = bignum | 0x0006000000
int_7            = bignum | 0x0007000000
int_8            = bignum | 0x0008000000
int_9            = bignum | 0x0009000000
int_10           = bignum | 0x000a000000
int_11           = bignum | 0x000b000000
int_12           = bignum | 0x000c000000
int_13           = bignum | 0x000d000000
int_14           = bignum | 0x000e000000
int_15           = bignum | 0x000f000000
int_16           = bignum | 0x0010000000
int_17           = bignum | 0x0011000000
int_18           = bignum | 0x0012000000
int_19           = bignum | 0x0013000000
int_20           = bignum | 0x0014000000
int_21           = bignum | 0x0015000000
int_22           = bignum | 0x0016000000
int_23           = bignum | 0x0017000000
int_24           = bignum | 0x0018000000
int_25           = bignum | 0x0019000000
int_26           = bignum | 0x001a000000
int_27           = bignum | 0x001b000000
int_28           = bignum | 0x001c000000
int_29           = bignum | 0x001d000000
int_30           = bignum | 0x001e000000


cha_3            = bignum | 0x0300000000
cha_4            = bignum | 0x0400000000
cha_5            = bignum | 0x0500000000
cha_6            = bignum | 0x0600000000
cha_7            = bignum | 0x0700000000
cha_8            = bignum | 0x0800000000
cha_9            = bignum | 0x0900000000
cha_10           = bignum | 0x0a00000000
cha_11           = bignum | 0x0b00000000
cha_12           = bignum | 0x0c00000000
cha_13           = bignum | 0x0d00000000
cha_14           = bignum | 0x0e00000000
cha_15           = bignum | 0x0f00000000
cha_16           = bignum | 0x1000000000
cha_17           = bignum | 0x1100000000
cha_18           = bignum | 0x1200000000
cha_19           = bignum | 0x1300000000
cha_20           = bignum | 0x1400000000
cha_21           = bignum | 0x1500000000
cha_22           = bignum | 0x1600000000
cha_23           = bignum | 0x1700000000
cha_24           = bignum | 0x1800000000
cha_25           = bignum | 0x1900000000
cha_26           = bignum | 0x1a00000000
cha_27           = bignum | 0x1b00000000
cha_28           = bignum | 0x1c00000000
cha_29           = bignum | 0x1d00000000

into this:
Variable list is too long: Just download it here.
 
plz post entire scripts and not pieces or stuff like that, u should post that on the thread of the script, this is a script list thread, not a script thread :wink:
 
The defined attribute values are a useful thing transvanio.  They essentially allow you to increase any soldiers health to a max of 305 hp.  This is great for making super tough units. And maxed agility is great for making super fast units. 
 
tansvanio said:
im just saying this is a thing i wont post in main page coze it aint at script its just a piece, still it will be here if someone wants it

Ok. Then I shall upload the whole header_troops.py. Download it here.
 
You didnt had to do that xD but its ok, the only thing i need its an intire script. and instrution on how to add it if possible

EDIT: by the way, what should i call the script? say its name
 
Back
Top Bottom