Giving identity to generic bandit parties (a name generator)

Users who are viewing this thread

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.

## 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
* 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.


first_word_begin = "str_first_0"
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, ":eek:ffset1", ":dna", 100),
  (val_div, ":dna", 100),
  (store_mod, ":eek:ffset2", ":dna", 100),
  (val_div, ":dna", 100),
  (store_mod, ":eek:ffset3", ":dna", 100),
  (val_add, ":eek:ffset1", first_word_begin),
  (val_add, ":eek:ffset2", next_word_begin),
  (val_add, ":eek:ffset3", next_word_begin),
  (str_store_string, s50, ":eek:ffset1"),
  (str_store_string, s50, ":eek:ffset2"),
  (str_store_string, s50, ":eek: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), ]),   

("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

        ...
        (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.
 
Good idea!
Further elaboration can add some flavor title from a list after the name of the leader: X the Bonecrusher/Bonemuncher/Skullbreaker/Cowshagger/Fishslapper/Threadspammer...

So the name of the party will be "<Gang> of <Name> the <Flavored>"
 
http://mbx.streetofeyes.com/index.php/topic,872.msg24833.html#msg24833

Older, clunkier and uglier but more precise :razz: Just throw in a couple of arrays to limit selection for party types.
 
KON_Air said:
http://mbx.streetofeyes.com/index.php/topic,872.msg24833.html#msg24833

Older, clunkier and uglier but more precise :razz: Just throw in a couple of arrays to limit selection for party types.

mmm, 'deathly knight' is still too generic name for me. I want name of the leader, and it stored/easily regenerated for party encounter conversation.


@ Temperer :
I spied your pc to read your todo list :smile:
well, like you said before, our modding objective have same direction, temperer.
BTW, I'm considering to remove randomizing and building an algoritm to get more predicted result, no repeating result but still feels random.
 
dunde said:
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.
How would we use it on the party encounter conversation?

This is great by the way... I met "****maru's ...... Party" :grin:
 
It was used for party name, but troop_set_name operation will give a chance to implement for npcs, including lords. We can alter their name after they re changed by faction defect, as we can save the dna generated their name into slot.
Mmmm, permanent death for lords scripts will be enhanced much by troop_set_name operation, for we can recycle the troop id for new lords after they death.
 
Unfortunately, there is no operation to facekey yet. I noticed there is troop_set_facekey_from_current_profile, but after reading the using on WB's MS, I think it only work for  player characters of MP.
 
I tried writing my own script for creating a leader and assigning it the name given to the party, but when i try to compile it i get a weird error that i dont understand; could anyone enlighten me as to what it means, or even better how to fix it  :smile:

Code:
(assign, ":spawned_party_id", reg0),
       (party_add_leader, ":spawned_party_id", "trp_mercenary_horseman", [(1)]),
       (troop_set_name, "trp_mercenary_horseman", "s50"),

 
Remove " from s50.
And, it's unwise to use troop_set_name for regular troop. Use this operation for heroes only if it's about unique names. For regular troops share same name  with every troops with same ID.
 
The error seems to persist no matter what i do with s50; ive tried with ", (, {, [ just s50 and just 50 but they all return either the previous error or a syntax error.

Doesn't really matter though, because as you pointed out the script is broken in the first place
 
Code:
       (party_add_leader, ":spawned_party_id", "trp_mercenary_horseman"),

you dont need [], [] means it optional params, if you use:
(party_add_leader, ":spawned_party_id", "trp_mercenary_horseman",2),
then the top slot of the party will be 2 mercenary horsemen. If you want 1 leader only, then you dont need 3rd param.
 
Hi

Is it posible assign bandits names for faction or culture?

I have bandits in my mod of different cultures (franks, irish, picts...) and it will be rare a warrior band of Franks with leader name pict, by example.

Thx u.
 
Back
Top Bottom