Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Somebody said:
Go in edit mode, grab some ethnically appropriate facecodes, paste them in module_troops.
Would I have to put it next to each one or is it possible to apply it to everyone? Also how can i get it so they have a black body, because i was looking through the Body textures and I couldnt find any for Black people.
 
dunde said:
celestial, slot_troop_spouse for married ladies should be set to their husbands, otherwise, they will be considered as unmarried.

Thank you! I didn't realize I had the values reversed. That was the problem. I appreciate it :smile:

CR
 
("initialize_aristocracy",
  [
    #LORD OCCUPATIONS, BLOOD RELATIONSHIPS, RENOWN AND REPUTATIONS
   
  #  #King ages
    # (try_for_range, ":cur_troop", kings_begin, kings_end),
  #  (troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
  #  (store_random_in_range, ":age", 50, 60),
  #  (troop_set_slot, ":cur_troop", slot_troop_age, ":age"),
  #  (eq, ":cur_troop", "trp_kingdom_5_lord"),
      #
    #(try_end),
    (troop_set_slot, "trp_kingdom_1_lord", slot_troop_age, 21), 
    (troop_set_slot, "trp_kingdom_2_lord", slot_troop_age, 16), 
    (troop_set_slot, "trp_kingdom_3_lord", slot_troop_age, 44), 
    (troop_set_slot, "trp_kingdom_4_lord", slot_troop_age, 67), 
    (troop_set_slot, "trp_kingdom_5_lord", slot_troop_age, 27), 
    (troop_set_slot, "trp_kingdom_6_lord", slot_troop_age, 41),
    (troop_set_slot, "trp_kingdom_7_lord", slot_troop_age, 37),
    (troop_set_slot, "trp_kingdom_8_lord", slot_troop_age, 5:cool:,
    (troop_set_slot, "trp_kingdom_9_lord", slot_troop_age, 44),
    (troop_set_slot, "trp_kingdom_10_lord", slot_troop_age, 52),
    (troop_set_slot, "trp_kingdom_11_lord", slot_troop_age, 21),
    (troop_set_slot, "trp_kingdom_12_lord", slot_troop_age, 41),
    (troop_set_slot, "trp_kingdom_13_lord", slot_troop_age, 34),

    (troop_set_slot, "trp_knight_1_1", slot_troop_age, 31), 
    (troop_set_slot, "trp_kingdom_1_lady_1", slot_troop_spouse, "trp_knight_1_1"),
    (troop_set_slot, "trp_kingdom_1_lady_2", slot_troop_father, "trp_knight_1_1"),
    (troop_set_slot, "trp_kingdom_1_lady_3", slot_troop_father, "trp_knight_1_1"),

    (troop_set_slot, "trp_knight_1_2", slot_troop_age, 45), 
    (troop_set_slot, "trp_kingdom_1_lady_5", slot_troop_spouse, "trp_knight_1_2"),
    (troop_set_slot, "trp_kingdom_1_lady_4", slot_troop_father, "trp_knight_1_2"),

    (troop_set_slot, "trp_knight_1_4", slot_troop_age, 51), 
    (troop_set_slot, "trp_kingdom_1_lady_6", slot_troop_spouse, "trp_knight_1_4"),
    (troop_set_slot, "trp_kingdom_1_lady_7", slot_troop_father, "trp_knight_1_4"),
    (troop_set_slot, "trp_knight_1_15", slot_troop_father, "trp_knight_1_4"),

    (troop_set_slot, "trp_knight_1_6", slot_troop_age, 52), 
    (troop_set_slot, "trp_kingdom_1_lady_8", slot_troop_spouse, "trp_knight_1_6"),
    (troop_set_slot, "trp_kingdom_1_lady_9", slot_troop_father, "trp_knight_1_6"),
    (troop_set_slot, "trp_kingdom_1_lady_10", slot_troop_father, "trp_knight_1_6"),
    (troop_set_slot, "trp_knight_1_14", slot_troop_father, "trp_knight_1_6"),

    (troop_set_slot, "trp_knight_1_11", slot_troop_age, 41), 
    (troop_set_slot, "trp_kingdom_1_lady_11", slot_troop_spouse, "trp_knight_1_11"),
    (troop_set_slot, "trp_kingdom_1_lady_12", slot_troop_father, "trp_knight_1_11"),
    (troop_set_slot, "trp_kingdom_1_lady_13", slot_troop_father, "trp_knight_1_11"),

    (troop_set_slot, "trp_knight_1_3", slot_troop_age, 43),
    (troop_set_slot, "trp_knight_1_5", slot_troop_age, 36),
    (troop_set_slot, "trp_knight_1_7", slot_troop_age, 21),
    (troop_set_slot, "trp_knight_1_8", slot_troop_age, 16),
    (troop_set_slot, "trp_knight_1_9", slot_troop_age, 41),
    (troop_set_slot, "trp_knight_1_10", slot_troop_age, 3:cool:,
    (troop_set_slot, "trp_kingdom_1_lady_14", slot_troop_spouse, "trp_knight_1_10"),
    (troop_set_slot, "trp_kingdom_1_lady_15", slot_troop_father, "trp_knight_1_10"),
    (troop_set_slot, "trp_kingdom_1_lady_16", slot_troop_father, "trp_knight_1_10"),
    (troop_set_slot, "trp_knight_1_12", slot_troop_age, 44),
    (troop_set_slot, "trp_kingdom_1_lady_17", slot_troop_spouse, "trp_knight_1_12"),
    (troop_set_slot, "trp_kingdom_1_lady_18", slot_troop_father, "trp_knight_1_12"),
    (troop_set_slot, "trp_kingdom_1_lady_19", slot_troop_father, "trp_knight_1_12"),
    (troop_set_slot, "trp_knight_1_13", slot_troop_age, 27),
    (troop_set_slot, "trp_knight_1_14", slot_troop_age, 21),
    (troop_set_slot, "trp_knight_1_15", slot_troop_age, 23),
    (troop_set_slot, "trp_knight_1_15", slot_troop_age, 17),


  #King ages
  (try_for_range, ":cur_troop", kings_begin, kings_end),
(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
(store_random_in_range, ":age", 50, 60),
(troop_set_slot, ":cur_troop", slot_troop_age, ":age"),
##diplomacy start+
#(eq, ":cur_troop", "trp_kingdom_5_lord"),#<-- There was no reason for this to be in the loop, so moved it out.
#(troop_set_slot, ":cur_troop", slot_troop_age, 47),
  (try_end),
  (troop_set_slot, "trp_kingdom_5_lord", slot_troop_age, 47),#<-- Moved from above
  ##diplomacy end+

  #The first thing - family structure
  #lords 1 to 8 are patriarchs with one live-at-home son and one daughter. They come from one of six possible ancestors, thus making it likely that there will be two sets of siblings
  #lords 9 to 12 are unmarried landowners with sisters
  #lords 13 to 20 are sons who still live in their fathers' houses
  #For the sake of simplicity, we can assume that all male aristocrats in prior generations either married commoners or procured their brides from the Old Country, thus discounting intermarriage

  (try_for_range, ":cur_troop", kingdom_ladies_begin, kingdom_ladies_end),
(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_lady),
  (try_end),

  (assign, ":cur_lady", "trp_kingdom_1_lady_1"),

  (try_for_range, ":cur_troop", lords_begin, lords_end),
(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),

(store_random_in_range, ":father_age_at_birth", 23, 26),
# (store_random_in_range, ":mother_age_at_birth", 19, 22),

(try_begin),
(is_between, ":cur_troop", "trp_knight_1_1", "trp_knight_2_1"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_1_1"),
(assign, ":ancestor_seed", 1),

(else_try),
(is_between, ":cur_troop", "trp_knight_2_1", "trp_knight_3_1"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_2_1"),
(assign, ":ancestor_seed", 7),

(else_try),
(is_between, ":cur_troop", "trp_knight_3_1", "trp_knight_4_1"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_3_1"),
(assign, ":ancestor_seed", 13),

(else_try),
(is_between, ":cur_troop", "trp_knight_4_1", "trp_knight_5_1"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_4_1"),
(assign, ":ancestor_seed", 19),

(else_try),
(is_between, ":cur_troop", "trp_knight_5_1", "trp_knight_6_1"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_5_1"),
(assign, ":ancestor_seed", 25),

(else_try),
(is_between, ":cur_troop", "trp_knight_6_1", "trp_kingdom_1_pretender"),
(store_sub, ":npc_seed", ":cur_troop", "trp_knight_6_1"),
(assign, ":ancestor_seed", 31),

(try_end),


(try_begin),
(lt, ":npc_seed", :cool:, #NPC seed is the order in the faction
##diplomacy start+ do not overwrite reputation if it was already set explicitly
(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
(try_begin),
(lt, ":reputation", 1),
#Original behavior:
(assign, ":reputation", ":npc_seed"),
(try_end),
##diplomacy end+
(store_random_in_range, ":age", 45, 64),

##diplomacy start+ only set father if not already set
(try_begin),#<- dplmc+ added
(troop_slot_eq, ":cur_troop", slot_troop_father, -1),#<- dplmc+ added
(store_random_in_range, ":father", 0, 6), #six possible fathers
(val_add, ":father", ":ancestor_seed"),
(troop_set_slot, ":cur_troop", slot_troop_father, ":father"),
(try_end),#<- dplmc+ added
##diplomacy end+

#wife
##diplomacy start+ do not rebind an already-set wife
(try_begin),
(troop_slot_eq, ":cur_troop", slot_troop_spouse, -1),
#There may be a better solution, but to avoid oddities disable automatic spouses if there is a gender mismatch.
#Mods that add additional races may want to tweak this (for example if some races shouldn't intermarry).
(call_script, "script_dplmc_store_is_female_troop_1_troop_2", ":cur_troop", ":cur_lady"),
#Types are stored to reg0 and reg1.
(neq, reg0, reg1),#lord and lady aren't both female or both non-female
(val_mul, reg0, reg1),
(eq, reg0, 0),#at least one of lord or lady is non-female
##diplomacy end+
(troop_set_slot, ":cur_troop", slot_troop_spouse, ":cur_lady"),
(troop_set_slot, ":cur_lady", slot_troop_spouse, ":cur_troop"),
(store_random_in_range, ":wife_reputation", 20, 26),
(try_begin),
(eq, ":wife_reputation", 20),
(assign, ":wife_reputation", lrep_conventional),
(try_end),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, ":wife_reputation"),


(call_script, "script_init_troop_age", ":cur_lady", 49),
(call_script, "script_add_lady_items", ":cur_lady"),

(val_add, ":cur_lady", 1),
##diplomacy start+
(try_end),
##diplomacy end+

#daughter
##diplomacy start+
(try_begin),
##diplomacy end+
(troop_set_slot, ":cur_lady", slot_troop_father, ":cur_troop"),
(store_sub, ":mother", ":cur_lady", 1),
(call_script, "script_init_troop_age", ":cur_lady", 19),
##diplomacy start+
#fix native bug (daughters are their own mothers)
#(troop_set_slot, ":cur_lady", slot_troop_mother, ":cur_lady"),
(troop_set_slot, ":cur_lady", slot_troop_mother, ":mother"),
(try_begin),
#swap father and mother slots if the lord was female (do nothing if both were female)
(call_script, "script_dplmc_store_is_female_troop_1_troop_2", ":cur_troop", ":mother"),
(neq, reg0, 0),#:cur_troop is female
(eq, reg1, 0),#:mother is not female
(troop_set_slot, ":cur_lady", slot_troop_mother, ":cur_troop"),
(troop_set_slot, ":cur_lady", slot_troop_father, ":mother"),
(try_end),
##diplomacy end+
(store_random_in_range, ":lady_reputation", lrep_conventional, 34), #33% chance of father-derived
(try_begin),
(le, ":lady_reputation", 25),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, ":lady_reputation"),
(else_try),
(eq, ":lady_reputation", 26),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_conventional),
(else_try),
(eq, ":lady_reputation", 27),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_moralist),
(else_try),
(assign, ":guardian_reputation", ":reputation"),
(try_begin),
(this_or_next|eq, ":guardian_reputation", lrep_martial),
(eq, ":guardian_reputation", 0),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_conventional),
(else_try),
(eq, ":guardian_reputation", lrep_quarrelsome),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_otherworldly),
(else_try),
(eq, ":guardian_reputation", lrep_selfrighteous),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_ambitious),
(else_try),
(eq, ":guardian_reputation", lrep_cunning),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_adventurous),
(else_try),
(eq, ":guardian_reputation", lrep_goodnatured),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_adventurous),
(else_try),
(eq, ":guardian_reputation", lrep_debauched),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_ambitious),
(else_try),
(eq, ":guardian_reputation", lrep_upstanding),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, lrep_moralist),
(try_end),
(try_end),

(call_script, "script_add_lady_items", ":cur_lady"),
(val_add, ":cur_lady", 1),
##diplomacy start+
(try_end),
##diplomacy end+
#high renown

(else_try), #Older unmarried lords
(is_between, ":npc_seed", 8, 12),

(store_random_in_range, ":age", 25, 36),
##diplomacy start+ do not overwrite reputation if it was already set explicitly
(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
(try_begin),
(lt, ":reputation", 1),
#Original behavior:
(store_random_in_range, ":reputation", 0, :cool:,
(try_end),
##diplomacy end+

(store_random_in_range, ":sister_reputation", 20, 26),
(try_begin),
(eq, ":sister_reputation", 20),
(assign, ":sister_reputation", lrep_conventional),
(try_end),
(troop_set_slot, ":cur_lady", slot_lord_reputation_type, ":sister_reputation"),

(troop_set_slot, ":cur_lady", slot_troop_guardian, ":cur_troop"),
##diplomacy start+
#Initialize parents
(try_begin),
(troop_slot_eq, ":cur_troop", slot_troop_father, -1),
(store_mul, ":new_index", ":cur_troop", DPLMC_VIRTUAL_RELATIVE_MULTIPLIER),#defined in module_constants.py
(val_add, ":new_index", DPLMC_VIRTUAL_RELATIVE_FATHER_OFFSET),#defined in module_constants.py
(troop_set_slot, ":cur_troop", slot_troop_father, ":new_index"),
(troop_slot_eq, ":cur_lady", slot_troop_father, -1),
(troop_set_slot, ":cur_lady", slot_troop_father, ":new_index"),
(try_end),
(try_begin),
(troop_slot_eq, ":cur_troop", slot_troop_mother, -1),
(store_mul, ":new_index", ":cur_troop", DPLMC_VIRTUAL_RELATIVE_MULTIPLIER),#defined in module_constants.py
(val_add, ":new_index", DPLMC_VIRTUAL_RELATIVE_MOTHER_OFFSET),#defined in module_constants.py
(troop_set_slot, ":cur_troop", slot_troop_mother, ":new_index"),
(troop_slot_eq, ":cur_lady", slot_troop_mother, -1),
(troop_set_slot, ":cur_lady", slot_troop_mother, ":new_index"),
(try_end),
##diplomacy end+

(call_script, "script_init_troop_age", ":cur_lady", 21),
(call_script, "script_add_lady_items", ":cur_lady"),

(val_add, ":cur_lady", 1),

(else_try), #Younger unmarried lords
#age is father's minus 20 to 25
(store_sub, ":father", ":cur_troop", 12),
##diplomacy start+
#Some submods don't pay attention to this aspect of the troop list, and
#so initialization produces absurd or impossible results.  Prevent such
#things from appearing in the game.
(try_begin),
#"father" can be father or mother
#(troop_get_type, ":parent_type", ":father"),
(try_begin),
#(eq, ":parent_type", tf_female),
(call_script, "script_cf_dplmc_troop_is_female", ":father"),
(assign, ":parent_slot", slot_troop_mother),
(assign, ":eek:ther_parent_slot", slot_troop_father),
(else_try),
(assign, ":parent_slot", slot_troop_father),
(assign, ":eek:ther_parent_slot", slot_troop_mother),
(try_end),

(troop_slot_eq, ":cur_troop", ":parent_slot", -1),
(store_add, ":logical_minimum_age", ":father_age_at_birth", 16),
(troop_slot_ge, ":father", slot_troop_age, ":logical_minimum_age"),
#Passed test
(troop_set_slot, ":cur_troop", ":parent_slot", ":father"),
#Set mother if not already specified
(try_begin),
(troop_slot_eq, ":cur_troop", ":eek:ther_parent_slot", -1),
(troop_get_slot, ":mother", ":father", slot_troop_spouse),
(troop_set_slot, ":cur_troop", ":eek:ther_parent_slot", ":mother"),
(try_end),

(troop_get_slot, ":father_age", ":father", slot_troop_age),
(store_sub, ":age", ":father_age", ":father_age_at_birth"),

(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
(try_begin),
#Don't change reputation if it already has been set
(lt, ":reputation", 1),
#50% chance of having father's rep
(store_random_in_range, ":reputation", 0, 16),

(gt, ":reputation", 7),
(troop_get_slot, ":reputation", ":father", slot_lord_reputation_type),
(try_end),
(else_try),
#Average age is [45,63] minus [23,25], so [22, 38]
(store_random_in_range, ":age", 22, 39),
(troop_get_slot, ":reputation", ":cur_troop", slot_lord_reputation_type),
#Don't change reputation if it already has been set
(lt, ":reputation", 1),
(store_random_in_range, ":reputation", 0, :cool:,
(try_end),
#diplomacy end+
(try_end),

(try_begin),
(eq, ":reputation", 0),
(assign, ":reputation", 1),
(try_end),

        (troop_set_slot, ":cur_troop", slot_lord_reputation_type, ":reputation"),

(call_script, "script_init_troop_age", ":cur_troop", ":age"),
  (try_end),

  (try_begin),
    (eq, "$cheat_mode", 1),
    (assign, reg3, "$cheat_mode"),
    (display_message, "@{!}DEBUG -- Assigned lord reputation and relations"),

#     (display_message, "str_assigned_lord_reputation_and_relations_cheat_mode_reg3"), #This string can be removed
  (try_end),

  (try_for_range, ":cur_troop", pretenders_begin, pretenders_end),
(troop_set_slot, ":cur_troop", slot_troop_occupation, slto_inactive_pretender),
(store_random_in_range, ":age", 25, 30),
(troop_set_slot, ":cur_troop", slot_troop_age, ":age"),
(eq, ":cur_troop", "trp_kingdom_5_pretender"),
(troop_set_slot, ":cur_troop", slot_troop_age, 45),
  (try_end),
]),

Seems the new version of Diplomacy messed up my family relations. Could anyone tell me what to do to make it work again?
 
Hello, I have a question about animation replacing:

1. I have created an animation for "crossbow_cstance", basically the standing with crossbow drawn animation.
2. I have replaced the original "crossbow_cstance" animation in CommonRes with this new one and looked at it in game. It worked perfectly.

Now I don't actually want to replace the CommonRes files, I want the animation to be mod related. So I:
1. created a new brf file with my new animation. And named my new animation to be identical to the one I want to replace ("crossbow_cstance").
2. added the new brf to module.ini load resources.

to my knowledge this should replace the original animation with my new animation. But this didn't work. So I tried a new idea:
1. renamed my new animation "crossbow_cstance_edited".
2. changed the name of the animation in my "module_animations.py" to the new name.
Code:
 ["stand_crossbowf", 0, amf_client_prediction,
   [2.0, "crossbow_cstance_edited", 0, 60, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.0],  
 ],
3. Built the mod.

Now characters dissapear when using the new animation. :shock:

Does anyone know what I am doing wrong?

EDIT: I think I've solved the problem. My animation had no frames! I don't know why it worked when replacing the original file. I've changed the animation to have the same number of frames as the original and now its working just fine.
 
New question!

So I discovered the add_companion_party in the header_operations file. What I want to do is place a standard bearer in the lord parties of four factions. I need a check to see if they currently have a standard bearer, then if they don't, to add one. I want the standard bearer to act as a "hero" and "companion" to the lords. This prevents me from having to add them into the party templates and having several bearers per party.

Would anyone know how to write a script for that? This is sort of what I had in mind
I declared in the

module_constants
slot_party_standard_bearer

standard_bearers_begin = "trp_american_standard_bearer"
standard_bearers_end = "trp_pirate_flag_bearer"

kingdom_1_lords_begin = "trp_knight_1_1"
kingdom_1_lords_end "trp_knight_2_1"

In module_troops

["american_standard_bearer", "American Standard Bearer", "American Standard Bearers", tf_hero|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield|tf_guarantee_ranged, no_scene, reserved, fac_kingdom_1, [itm_swedish_musketeer_uniform,itm_black_tricorne_private,itm_gaiters_white,itm_infantry_hanger,itm_french_pistol,itm_cartridges,itm_flag_of_13_american_colonies], def_attrib|level(14), wp(85), knows_common|knows_ironflesh_2|knows_shield_2|knows_athletics_2|knows_power_strike_2, american_face_young_1, american_face_old_2 ],
["british_red_standard", "Brtish Standard Bearer", "Standard Bearers", tf_hero|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield|tf_guarantee_ranged, no_scene, reserved, fac_kingdom_2, [itm_cartridges,itm_british_bearskin,itm_gaiters_black_long,itm_infantry_sword,itm_flag_of_british_red_ensign,itm_huge_flintlock_pistol_pair,itm_british_3rd_footguards_officer], def_attrib|level(19), wp(100), knows_athletics_3|knows_ironflesh_2|knows_power_strike_3|knows_shield_2, british_face_young_1, british_face_older_2 ],
["french_royal_bearer", "French Standard Bearer", "French Standard Bearers", tf_hero|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield|tf_guarantee_ranged, no_scene, reserved, fac_kingdom_3, [itm_french_royal_deux_ponts_grenadier,itm_french_bearskin_hat,itm_french_gaiters_white,itm_pistol_cartridges,itm_infantry_sword,itm_flag_of_france_royal_roussillon,itm_french_pistol], def_attrib|level(21), wp(130), knows_riding_7|knows_power_draw_5|knows_ironflesh_3|knows_horse_archery_7|knows_power_throw_4|knows_shield_1, french_face_middle_1, french_face_older_2 ],
["spanish_ordinance_bearer", "Spanish Standard Bearer", "Spanish Standard Bearers", tf_hero|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_helmet|tf_guarantee_shield|tf_guarantee_ranged, no_scene, reserved, fac_kingdom_4, [itm_infantry_sword,itm_spanish_infanteria_uniform,itm_gaiters_white,itm_pistol_cartridges,itm_flag_of_spain_ordonnance,itm_spanish_cavalry_pistol_pair,itm_british_bearskin], def_attrib|level(19), wp(115), knows_ironflesh_4|knows_power_strike_4|knows_power_throw_3|knows_riding_2|knows_athletics_4|knows_shield_3, spanish_face_young_1, spanish_face_older_2 ],


Now, in module_scripts,

(try_for_range, ":troop_no", kingdom_1_lords_begin, kingdom_1_lords_end),
    (troop_slot_ge , "trp_american_standard_bearer", slot_party_standard_bearer, 0)
            (add_companion_party, "trp_american_standard_bearer")
(try_end)

I have a grave feeling this is completely incorrect syntax. Any help?

Thanks again in advance.

CR
 
celestialred said:
(try_for_range, ":troop_no", kingdom_1_lords_begin, kingdom_1_lords_end),
    (troop_slot_ge , "trp_american_standard_bearer", slot_party_standard_bearer, 0)
            (add_companion_party, "trp_american_standard_bearer")
(try_end)

I have a grave feeling this is completely incorrect syntax. Any help?
Your feeling is quite correct.

In order to do this without any scripting, you could simply add a standard bearer to the reinforcement party templates of those factions and ensure they each have such a troop...but if your concern is that the party has a standard bearer at all times, that won't do as they could die or end up with multiple bearers after a few reinforcements, so scripting would likely be best.

You'll want to loop through all parties, not through a range of troops:
(try_for_parties, ":party_no"),

will get you started there. If you are talking lord's parties in the field, you want to be sure that
(party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party),

Then, you'll want to check if that party has the troop you want. For that, you'll need to loop through the party's troop stacks. For that, you'll need:
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(try_for_range, ":stack", 0, ":num_stacks"),
    (party_stack_get_troop_id, ":troop", ":party_no", ":stack"),

and that should get you started looping through the troops a party actually has. Check for equality with the appropriate standard bearer (likely the best way to do this would be to store the relevant standard bearer's troop ID in a faction slot and then retrieve it via (store_faction_of_party) and (faction_get_slot). So you won't need your _begin, _end looping ranges, at least not for this. See scripts and the use of slots like slot_faction_tier_1_troop for more ideas here.

Finally, the command to add your troop is
(party_add_members,<party_id>,<troop_id>,<number>),
though you might want to use (party_force_add_members,<party_id>,<troop_id>,<number>),
in case the lord is at his party member limit
 
Caba`drin said:
celestialred said:
(try_for_range, ":troop_no", kingdom_1_lords_begin, kingdom_1_lords_end),
    (troop_slot_ge , "trp_american_standard_bearer", slot_party_standard_bearer, 0)
            (add_companion_party, "trp_american_standard_bearer")
(try_end)

I have a grave feeling this is completely incorrect syntax. Any help?
Your feeling is quite correct.

In order to do this without any scripting, you could simply add a standard bearer to the reinforcement party templates of those factions and ensure they each have such a troop...but if your concern is that the party has a standard bearer at all times, that won't do as they could die or end up with multiple bearers after a few reinforcements, so scripting would likely be best.

You'll want to loop through all parties, not through a range of troops:
(try_for_parties, ":party_no"),

will get you started there. If you are talking lord's parties in the field, you want to be sure that
(party_slot_eq, ":party_no", slot_party_type, spt_kingdom_hero_party),

Then, you'll want to check if that party has the troop you want. For that, you'll need to loop through the party's troop stacks. For that, you'll need:
(party_get_num_companion_stacks, ":num_stacks", ":party_no"),
(try_for_range, ":stack", 0, ":num_stacks"),
    (party_stack_get_troop_id, ":troop", ":party_no", ":stack"),

and that should get you started looping through the troops a party actually has. Check for equality with the appropriate standard bearer (likely the best way to do this would be to store the relevant standard bearer's troop ID in a faction slot and then retrieve it via (store_faction_of_party) and (faction_get_slot). So you won't need your _begin, _end looping ranges, at least not for this. See scripts and the use of slots like slot_faction_tier_1_troop for more ideas here.

Finally, the command to add your troop is
(party_add_members,<party_id>,<troop_id>,<number>),
though you might want to use (party_force_add_members,<party_id>,<troop_id>,<number>),
in case the lord is at his party member limit

Thank you Caba'drin! I'm going to attempt this and see if I can get it to work. I really appreciate it, thank you.

CR
 
Where could I find what makes the game load up pic_looter etc into the game and how could I add more or differentones for the different parties that I have got roaming about.
 
xPearse said:
Where could I find what makes the game load up pic_looter etc into the game and how could I add more or differentones for the different parties that I have got roaming about.
You'll find that in game_menus, specifically the menu "simple_encounter".

The files themselves are declared in module_meshes.

To add new ones, you'd need to create a .dds texture and assign it to a 2D mesh in a .brf, then load that .brf resource in module.ini and declare the mesh in module_meshes
 
celestialred said:
I have a grave feeling this is completely incorrect syntax. Any help?
Keep in mind that the hero troop entity shares health globally - one standard bearer hero will always have the same health as another of the same faction. If you used them as regular troops instead and want a head count, try using party_count_companions_of_type (not sure of performance). You can also loop over all kingdom heroes and fetch slot_troop_leaded_party instead of iterating over all the parties, if it makes any difference.
 
Caba`drin said:
xPearse said:
Where could I find what makes the game load up pic_looter etc into the game and how could I add more or differentones for the different parties that I have got roaming about.
You'll find that in game_menus, specifically the menu "simple_encounter".

The files themselves are declared in module_meshes.

To add new ones, you'd need to create a .dds texture and assign it to a 2D mesh in a .brf, then load that .brf resource in module.ini and declare the mesh in module_meshes

Thanks for that. Now I know what to do.
 
Is there a way that if a faction wants to go to war, they have to declare war first??
and is there a way to put "war goals" in game, so before a Faction declares war they have to choose a war goal first, like, "Annexation, turn to vassal state, ect"

Oh yes and appointing a Defence minister (to declare war, you have to talk to the him", Finance minister, ect... :smile:

Thanks :smile: "I could really use the help" :smile:
 
How to add horse whistle? (when you press a button you whistle, and closest free horse goes toward you)
I searched for osp scripts but i couldnt find any.

P.S I am talking about multiplayer, if that matters.
 
im trying to install latest version of dejawolfs medieval helm pack (http://forums.taleworlds.com/index.php/topic,76943.0.html)

ive added the .brf to resources in my mod folder
ive added the textures to the textures mod folder
ive done the load_mod_resource in the module.ini file

im stuck at item_kinds1.txt - what do i put in here?
it doesnt say what i have to add, but everyone seems to know what to put in there except for me

any help appreciated
 
Status
Not open for further replies.
Back
Top Bottom