I don't like how bandits and caravan party have generic name, so I gave them random name to make me easier to identify them.
Here's the code I use.
* Only first 10 string constants I wrote above, you need 100, you can define by yourself. Let some of next_xx, "{s50}" only to give a chance producing shorter name.
Next, on module_scripsts.py
The constant that produce name was stored on slot, consider it as leader's name, so we can use it on party encounter conversation too.
Here's the code I use.
## Name Strings
("first_0","Jo"),("first_1","Al"),("first_2","Ar"),("first_3","Bo"),("first_4","Pa"),
("first_5","Et"),("first_6","Ju"),("first_7","Ve"),("first_8","Cho"),("first_9","Goth"),
... make until 99
("next_0","{s50}"),("next_1","{s50}hen"),("next_2","{s50}zan"),("next_3","{s50}"),("next_4","{s50}ty"),
("next_5","{s50}der"),("next_6","{s50}san"),("next_7","{s50}glas"),("next_8","{s50}sep"),("next_9","{s50}y"),
... make until 99
("first_0","Jo"),("first_1","Al"),("first_2","Ar"),("first_3","Bo"),("first_4","Pa"),
("first_5","Et"),("first_6","Ju"),("first_7","Ve"),("first_8","Cho"),("first_9","Goth"),
... make until 99
("next_0","{s50}"),("next_1","{s50}hen"),("next_2","{s50}zan"),("next_3","{s50}"),("next_4","{s50}ty"),
("next_5","{s50}der"),("next_6","{s50}san"),("next_7","{s50}glas"),("next_8","{s50}sep"),("next_9","{s50}y"),
... make until 99
first_word_begin = "str_first_0"
next_word_begin = "str_next_0"
slot_party_dna = 1
next_word_begin = "str_next_0"
slot_party_dna = 1
Next, on module_scripsts.py
("get_name_from_dna_to_s50",
[(store_script_param, ":dna", 1),
(store_mod, "ffset1", ":dna", 100),
(val_div, ":dna", 100),
(store_mod, "ffset2", ":dna", 100),
(val_div, ":dna", 100),
(store_mod, "ffset3", ":dna", 100),
(val_add, "ffset1", first_word_begin),
(val_add, "ffset2", next_word_begin),
(val_add, "ffset3", next_word_begin),
(str_store_string, s50, "ffset1"),
(str_store_string, s50, "ffset2"),
(str_store_string, s50, "ffset3"), ]),
[(store_script_param, ":dna", 1),
(store_mod, "ffset1", ":dna", 100),
(val_div, ":dna", 100),
(store_mod, "ffset2", ":dna", 100),
(val_div, ":dna", 100),
(store_mod, "ffset3", ":dna", 100),
(val_add, "ffset1", first_word_begin),
(val_add, "ffset2", next_word_begin),
(val_add, "ffset3", next_word_begin),
(str_store_string, s50, "ffset1"),
(str_store_string, s50, "ffset2"),
(str_store_string, s50, "ffset3"), ]),
("randomize_party_name",
[(store_script_param, ":with_party", 1),
(assign, ":party_no", reg0),
(str_store_party_name, s1, ":party_no"),
(store_random_in_range, ":dna", 0, 1000000),
(party_set_slot, ":party_no", slot_party_dna, ":dna"),
(call_script, "script_get_name_from_dna_to_s50", ":dna"),
(try_begin),
(eq, ":with_party", 0), (str_store_string, s1, "@{s50}'s {s1}"), # No suffix
(else_try),
(eq, ":with_party", 1), (str_store_string, s1, "@{s50}'s {s1} gank"), # For Bandits
(else_try),
(eq, ":with_party", 2), (str_store_string, s1, "@{s50}'s {s1} group"), # For Commoners
(else_try),
(str_store_string, s1, "@{s50}'s {s1} party"),
(try_end),
(party_set_name, ":party_no", s1), ]),
[(store_script_param, ":with_party", 1),
(assign, ":party_no", reg0),
(str_store_party_name, s1, ":party_no"),
(store_random_in_range, ":dna", 0, 1000000),
(party_set_slot, ":party_no", slot_party_dna, ":dna"),
(call_script, "script_get_name_from_dna_to_s50", ":dna"),
(try_begin),
(eq, ":with_party", 0), (str_store_string, s1, "@{s50}'s {s1}"), # No suffix
(else_try),
(eq, ":with_party", 1), (str_store_string, s1, "@{s50}'s {s1} gank"), # For Bandits
(else_try),
(eq, ":with_party", 2), (str_store_string, s1, "@{s50}'s {s1} group"), # For Commoners
(else_try),
(str_store_string, s1, "@{s50}'s {s1} party"),
(try_end),
(party_set_name, ":party_no", s1), ]),
("spawn_bandits",
[(set_spawn_radius,1),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_manhunters"),
(lt,":num_parties", num_max_zendar_manhunters),
(spawn_around_party,"p_zendar","pt_manhunters"),
(call_script, "script_randomize_party_name",2),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_mountain_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_mountain_bandits"),
(call_script, "script_randomize_party_name",1),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_forest_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_forest_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_forest_bandits"),
(call_script, "script_randomize_party_name",1),
(try_end),
... do the same to the looter next below
[(set_spawn_radius,1),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_manhunters"),
(lt,":num_parties", num_max_zendar_manhunters),
(spawn_around_party,"p_zendar","pt_manhunters"),
(call_script, "script_randomize_party_name",2),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_mountain_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_mountain_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_mountain_bandits"),
(call_script, "script_randomize_party_name",1),
(try_end),
(try_begin),
(store_num_parties_of_template, ":num_parties", "pt_forest_bandits"),
(lt,":num_parties",14),
(store_random,":spawn_point",num_mountain_bandit_spawn_points),
(val_add,":spawn_point","p_forest_bandit_spawn_point"),
(spawn_around_party,":spawn_point","pt_forest_bandits"),
(call_script, "script_randomize_party_name",1),
(try_end),
... do the same to the looter next below
...
(party_set_faction, ":result", ":faction_no"),
(try_begin),
(eq, ":party_type", spt_kingdom_caravan),
(party_set_slot, ":result", slot_party_home_center, ":spawn_center"),
(try_end),
(party_set_slot, ":result", slot_party_type, ":party_type"),
(party_set_slot, ":result", slot_party_ai_state, spai_undefined),
(try_begin),
(neq, ":party_name_str", "str_no_string"),
(party_set_name, ":result", ":party_name_str"),
(else_try),
(call_script, "script_randomize_party_name", 0),
(try_end),
...
(party_set_faction, ":result", ":faction_no"),
(try_begin),
(eq, ":party_type", spt_kingdom_caravan),
(party_set_slot, ":result", slot_party_home_center, ":spawn_center"),
(try_end),
(party_set_slot, ":result", slot_party_type, ":party_type"),
(party_set_slot, ":result", slot_party_ai_state, spai_undefined),
(try_begin),
(neq, ":party_name_str", "str_no_string"),
(party_set_name, ":result", ":party_name_str"),
(else_try),
(call_script, "script_randomize_party_name", 0),
(try_end),
...
The constant that produce name was stored on slot, consider it as leader's name, so we can use it on party encounter conversation too.