Any way to make number of template members exceed 6?

Users who are viewing this thread

Any way to make number of template members exceed 6? For example, if you put more than 6 types of unit in kingdom reinforcement a, you'll get an error. Can you create more reinforcement templates for a faction other than those 3 (a, b, c)?
 
Solution
your added reinforcements have no chance to spawn

(else_try), (eq, ":party_type", spt_kingdom_hero_party), (try_begin), (lt, ":rand", 50), #tocan: 50% chance (assign, ":party_template", ":party_template_a"), #Armies (else_try), (lt, ":rand", 75), (assign, ":party_template", ":party_template_b"), (else_try), (lt, ":rand", 95), #tocan add something like this with your number (assign, ":party_template", ":party_template_c"), (else_try), #tocan dont need to add something because this is the last try (assign, ":party_template", ":party_template_d"), (try_end), (else_try), (try_end),
you can change the scripts that are responsible for the kingdom reinforcements.

# script_cf_reinforce_party # Input: arg1 = party_no, # Output: none # Adds reinforcement to party according to its type and faction # Called from several places, simple_triggers for centers, script_hire_men_to_kingdom_hero_party for hero parties ("cf_reinforce_party",
....
(faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a), (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b), (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c), #add a new one here
....
(try_begin), (this_or_next|eq, ":party_type", spt_town), (eq, ":party_type", spt_castle), #CASTLE OR TOWN (try_begin), (lt, ":rand", 65), (assign, ":party_template", ":party_template_a"), (else_try), (assign, ":party_template", ":party_template_b"), #add new ones below if you want for castle/towns (try_end), (else_try), (eq, ":party_type", spt_kingdom_hero_party), (try_begin), (lt, ":rand", 50), (assign, ":party_template", ":party_template_a"), (else_try), (lt, ":rand", 75), (assign, ":party_template", ":party_template_b"), (else_try), (assign, ":party_template", ":party_template_c"), #add new ones below (try_end), (else_try),

search for _reinforcements_c in the rest of your ms and add a new one
 
Upvote 0
Code:
      (faction_get_slot, ":party_template_a", ":party_faction", slot_faction_reinforcements_a),
      (faction_get_slot, ":party_template_b", ":party_faction", slot_faction_reinforcements_b),
      (faction_get_slot, ":party_template_c", ":party_faction", slot_faction_reinforcements_c),
      (faction_get_slot, ":party_template_d", ":party_faction", slot_faction_reinforcements_d),
....
Code:
      (assign, ":party_template", 0),
      (store_random_in_range, ":rand", 0, 100),
      (try_begin),
        (this_or_next|eq, ":party_type", spt_town),
        (eq, ":party_type", spt_castle),  #CASTLE OR TOWN
        (try_begin),
          (lt, ":rand", 65),
          (assign, ":party_template", ":party_template_a"),
        (else_try),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (else_try),
          (assign, ":party_template", ":party_template_d"),
        (try_end),
      (else_try),
        (eq, ":party_type", spt_kingdom_hero_party),
        (try_begin),
          (lt, ":rand", 50),
          (assign, ":party_template", ":party_template_a"), #Armies
        (else_try),
          (lt, ":rand", 75),
          (assign, ":party_template", ":party_template_b"),
        (else_try),
          (assign, ":party_template", ":party_template_c"),
        (else_try),
          (assign, ":party_template", ":party_template_d"),
        (try_end),
      (else_try),
      (try_end),

...
Code:
        (try_begin),
          (faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_1"),
      
          (faction_set_slot, ":faction_no",  slot_faction_deserter_troop, "trp_swadian_deserter"),
          (faction_set_slot, ":faction_no",  slot_faction_guard_troop, "trp_romaroth_cavalry"),
          (faction_set_slot, ":faction_no",  slot_faction_messenger_troop, "trp_swadian_messenger"),
          (faction_set_slot, ":faction_no",  slot_faction_prison_guard_troop, "trp_swadian_prison_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_castle_guard_troop, "trp_swadian_castle_guard"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"),
          (faction_set_slot, ":faction_no",  slot_faction_reinforcements_d, "pt_kingdom_1_reinforcements_d"),

...
Code:
  ("kingdom_1_reinforcements_a", "{!}kingdom_1_reinforcements_a", 0, 0, fac_commoners, 0, [(trp_romaroth_recruit,100,200)]), #Romaroth Infantry 1
  ("kingdom_1_reinforcements_b", "{!}kingdom_1_reinforcements_b", 0, 0, fac_commoners, 0, [(trp_romaroth_levy_footman,100,200)]), #Romaroth Infantry 2
  ("kingdom_1_reinforcements_c", "{!}kingdom_1_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_romaroth_footman,100,200)]), #Romaroth Infantry 3
  ("kingdom_1_reinforcements_d", "{!}kingdom_1_reinforcements_d", 0, 0, fac_commoners, 0, [(trp_sarranid_recruit,100,200)]), #Romaroth Infantry 3

Did everything you wrote above, but for some reason, kingdom reinforcements d (which I set for both lords and garrisons) do not appear in the game at all. What could cause that?
 
Upvote 0
your added reinforcements have no chance to spawn

(else_try), (eq, ":party_type", spt_kingdom_hero_party), (try_begin), (lt, ":rand", 50), #tocan: 50% chance (assign, ":party_template", ":party_template_a"), #Armies (else_try), (lt, ":rand", 75), (assign, ":party_template", ":party_template_b"), (else_try), (lt, ":rand", 95), #tocan add something like this with your number (assign, ":party_template", ":party_template_c"), (else_try), #tocan dont need to add something because this is the last try (assign, ":party_template", ":party_template_d"), (try_end), (else_try), (try_end),
 
Upvote 1
Solution
Back
Top Bottom