Limit banner choices when the game chooses a new banner for a lord

正在查看此主题的用户

Nemeo

Sergeant at Arms
Hello,

According to what I understand in this piece of script, when the player picks a banner, the game gives the AI the last banner of the list:


#Correcting banners according to the player banner
      (troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop),
      (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"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
        (assign, ":end_cond", 0),
      (try_end),


What I'd like to do is to force the AI to take a specific banner. Something like:

#Correcting banners according to the player banner
      (troop_get_slot, ":selected_banner_spr", "trp_player", slot_troop_banner_scene_prop),
      (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"),
        (store_troop_faction, ":kingdom_hero_faction", ":cur_troop"),
(try_begin),
          (eq, ":kingdom_hero_faction", "fac_kingdom_1"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_one),
(else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_2"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_two),
(else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_3"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_three),
(else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_4"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_four),
(else_try),
          (eq, ":kingdom_hero_faction", "fac_kingdom_5"),
        (troop_set_slot, ":cur_troop", slot_troop_banner_scene_prop, banner_scene_props_end_minus_five),
(try_end),
        (assign, ":end_cond", 0),
      (try_end),

But I don't know if the "banner_scene_props_end_minus_x" exists. Could you tell me if it does? Or another way to do it ?
 
Thanks I knew this one. :smile: My goal is not to get one banner per faction.

When the player chooses a banner that was already used by another lord, the game picks another one for this lord. And apparently it picks the last one on the list whatever the faction he belongs to.

For my mod I want each faction to have its own background colour on the flag. So if the game always picks the same banner for the unlucky lord, be he rhodok, swadian or khergit, the color of his banner won't match the colour of his faction.
 
Then sorry, I don't know how to do it, you'd have a make a new script, because if the game chooses the last banner of the list, it doesn't consider the lord's faction, so you'd have to make a new script which takes the lord's faction in consideration, and gives it a specific/random flag between a list you choose, and I have no idea how to do this.
 
后退
顶部 底部