Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
You'd need to first add weapons to village walkers, and make sure that unarmed versions are set as the faction's town_walkers.

Code:
        (store_faction_of_party, ":fac", ":village_no"),
        (faction_get_slot, ":reinforcement", ":fac", slot_faction_reinforcements_a),    #get faction templates
        (faction_get_slot, ":villager", ":fac", slot_faction_village_walker_male_troop), #male defenders only
        (try_begin),
          (party_get_num_companions, ":party_size", ":village_no"),
          (lt, ":party_size", ":ideal_size"),
          (party_add_template, ":village_no", "pt_village_defenders"),
          (party_add_template, ":village_no", ":reinforcement"),
          (party_add_members, ":village_no", ":villager", 5),#arbitrary amount
        (try_end),
 
Somebody said:
You'd need to first add weapons to village walkers, and make sure that unarmed versions are set as the faction's town_walkers.

First, thanks for replying. Second, I'm not sure I'm following you on this. I need two versions of walker, one armed and one unarmed (I can't say I understand the difference here. My walkers are armed now) but, there has to be two versions?

Code:
        (store_faction_of_party, ":fac", ":village_no"),
        (faction_get_slot, ":reinforcement", ":fac", slot_faction_reinforcements_a),    #get faction templates
        (faction_get_slot, ":villager", ":fac", slot_faction_village_walker_male_troop), #male defenders only
        (try_begin),
          (party_get_num_companions, ":party_size", ":village_no"),
          (lt, ":party_size", ":ideal_size"),
          (party_add_template, ":village_no", "pt_village_defenders"),
          (party_add_template, ":village_no", ":reinforcement"),
          (party_add_members, ":village_no", ":villager", 5),#arbitrary amount
        (try_end),


Your code here...does it replace refresh_village_defenders tuple? I'm unsure where to insert this.
Reading this script, I don't see where two versions of villager or walker or what? come into play. But I'm a newb coder, and I appreciate your patience.
 
Native, in most of the cases, assigns different troops as walkers inside slots for cultures, which are then transferred to centers based on the owning factions. When you enter village/town centers, the people walking around are populated from these slots, and they are declared as follows
Code:
      (faction_set_slot, "fac_culture_1", slot_faction_town_walker_male_troop, "trp_town_walker_1"),
      (faction_set_slot, "fac_culture_1", slot_faction_town_walker_female_troop, "trp_town_walker_2"),
      (faction_set_slot, "fac_culture_1", slot_faction_village_walker_male_troop, "trp_village_walker_1"),
      (faction_set_slot, "fac_culture_1", slot_faction_village_walker_female_troop, "trp_village_walker_2"),
      (faction_set_slot, "fac_culture_1", slot_faction_town_spy_male_troop, "trp_spy_walker_1"),
      (faction_set_slot, "fac_culture_1", slot_faction_town_spy_female_troop, "trp_spy_walker_2"),
While it's probably okay for villagers to walk around with scythes/hammers/sickles/whatever, this shouldn't be the case in towns. Therefore, you can plausibly add some weapons/tools to the village walkers troops without affecting the appearance of their urban counterparts. However, in the case of the Khergits/Sarranids, this is not the case - since their culture is radically different from the rest of Calradia, they have distinct walkers wearing fur/robes/whatever, with one troop as both village and town walkers, and so you would need to make new troop entries for villagers and arm them accordingly.

Code:
      (store_script_param_1, ":village_no"),

      (assign, ":ideal_size", 50),
      (try_begin),
        (party_get_num_companions, ":party_size", ":village_no"),
        (lt, ":party_size", ":ideal_size"),
        (party_add_template, ":village_no", "pt_village_defenders"),
      (try_end),
As you can see here, an arbitrary defender limit of 50 is imposed, below which 10-20 peasants and 0-4 peasant women will reinforce the village. So either paste the code snippet below the assignment of ideal_size, or do your own calculations for it.
 
Somebody said:
Native, in most of the cases, assigns different troops as walkers inside slots for cultures, which are then transferred to centers based on the owning factions. When you enter village/town centers, the people walking around are populated from these slots, and they are declared as follows
Code:
      (faction_set_slot, "fac_culture_1", slot_faction_town_walker_male_troop, "trp_town_walker_1"),
      (faction_set_slot, "fac_culture_1", slot_faction_town_walker_female_troop, "trp_town_walker_2"),
      (faction_set_slot, "fac_culture_1", slot_faction_village_walker_male_troop, "trp_village_walker_1"),
      (faction_set_slot, "fac_culture_1", slot_faction_village_walker_female_troop, "trp_village_walker_2"),
      (faction_set_slot, "fac_culture_1", slot_faction_town_spy_male_troop, "trp_spy_walker_1"),
      (faction_set_slot, "fac_culture_1", slot_faction_town_spy_female_troop, "trp_spy_walker_2"),
While it's probably okay for villagers to walk around with scythes/hammers/sickles/whatever, this shouldn't be the case in towns. Therefore, you can plausibly add some weapons/tools to the village walkers troops without affecting the appearance of their urban counterparts. However, in the case of the Khergits/Sarranids, this is not the case - since their culture is radically different from the rest of Calradia, they have distinct walkers wearing fur/robes/whatever, with one troop as both village and town walkers, and so you would need to make new troop entries for villagers and arm them accordingly.

Code:
      (store_script_param_1, ":village_no"),

      (assign, ":ideal_size", 50),
      (try_begin),
        (party_get_num_companions, ":party_size", ":village_no"),
        (lt, ":party_size", ":ideal_size"),
        (party_add_template, ":village_no", "pt_village_defenders"),
      (try_end),
As you can see here, an arbitrary defender limit of 50 is imposed, below which 10-20 peasants and 0-4 peasant women will reinforce the village. So either paste the code snippet below the assignment of ideal_size, or do your own calculations for it.

I'm trying to follow you here dude, with appreciation, but I still don't know where that first tuple you wrote goes.

Your code here...does it replace refresh_village_defenders tuple? I'm unsure where to insert this.

I know it's obvious to you...
 
Does anyone know off-hand if it's possible to make damages display in game as something besides "#c" "#p" and "#b" (with # being some number)?  Like, if I wanted to rename piercing damaging to Armor Penetrating damage could I make a weapon doing 35p damage show up as doing "35AP" damage?  It's a minor cosmetic thing, but it's been hard for me to search for, so I'm hoping someone's seen where in the code I could do this.
 
Data\languages\en\

Code:
ui_cut_short|c
ui_pierce_short|p
ui_blunt_short|b
...
ui_swing|Swing: %d%s
ui_damage|Damage: %d%s
ui_thrust|Thrust: %d%s



Fearghus The Killer said:
Your code here...does it replace refresh_village_defenders tuple? I'm unsure where to insert this.
If you insist... Here's what I have.
Code:
    # script_refresh_village_defenders
    # Input: arg1 = village_no
    # Output: none
    ("refresh_village_defenders",
      [
        (store_script_param_1, ":village_no"),

        (party_get_slot, ":prosperity", ":village_no", slot_town_prosperity),
        (val_div, ":prosperity", 2),  #prosperity from 0 - 100, old ideal size 50
        (val_clamp, ":prosperity", 10, 50),
        (party_get_slot, ":owner", ":village_no", slot_town_lord),    #get owner        
        (try_begin),
            (eq, ":owner", "trp_player"),
            (party_get_slot, ":fac", ":village_no", slot_center_original_faction),
       (else_try),#if no owner (i.e. unassigned at beginning of game)
            (neg|is_between, ":owner", active_npcs_begin, active_npcs_end),
            (party_get_slot, ":fac", ":village_no", slot_center_original_faction),
            (faction_get_slot, ":owner", ":fac", slot_faction_leader),    #belongs to the king by default
        (else_try),
            (store_troop_faction, ":fac", ":owner"),     #get owner faction
        (try_end),
        (faction_get_slot, ":reinforcement", ":fac", slot_faction_reinforcements_a),    #get faction templates
        (try_begin),
          (neg|is_between, ":reinforcement", "pt_kingdom_1_reinforcements_a", "pt_steppe_bandit_lair"),
          (assign, ":reinforcement", "pt_village_defenders"),
        (try_end),
        (faction_get_slot, ":culture", ":fac", slot_faction_culture),    #get culture of owner
        (try_begin),#(party_get_slot, ":old_cult", ":village_no", slot_center_culture),    #get old culture
            (party_slot_eq, ":village_no", slot_center_culture, ":culture"),
            (troop_get_slot, ":renown", ":owner", slot_troop_renown),    #get owner renown
            (val_div, ":renown", 100),
            (val_add, ":prosperity", ":renown"),
        (else_try),
            (troop_get_slot, ":wealth", ":owner", slot_troop_wealth),    #get (foreign) owner wealth
            (val_div, ":wealth", 500),
            (val_add, ":prosperity", ":wealth"),
            (val_div, ":prosperity", 2),
        (try_end),
        (faction_get_slot, ":reinforcement", ":fac", slot_faction_reinforcements_a),    #get faction templates
        (faction_get_slot, ":villager", ":fac", slot_faction_village_walker_male_troop), #male defenders only
        (try_begin),
          (party_get_num_companions, ":party_size", ":village_no"),
          (lt, ":party_size", ":ideal_size"),
          (party_add_template, ":village_no", "pt_village_defenders"),
          (party_add_template, ":village_no", ":reinforcement"),
          (party_add_members, ":village_no", ":villager", 5),#arbitrary amount
        (try_end),
    ]),
 
Somebody said:
If you insist... Here's what I have.


Actually, "what you have" gave me an error because the "ideal size" declaration which you elaborated on earlier was left out. I put that back in, re-compiled just fine. I made a separate (and unarmed :???:) walker for Khergit towns and then armed my new trp_khergit_village_walker  to the teeth. Slotted them where they belong higher up in scripts.py

Tested. Doesn't work. Troops that show up to defend the Khergit village are farmers and peasant women.

When I analyze the code (with my limited code analyzing abilities) I see that it should work, but I have no clue why it doesn't...
 
That's because the script is called 4 times before they are assigned to a faction - in all likelihood they've already reached their ideal size and the next time the script is called (in 48 hour intervals), there will be no room for your new khergits.
 
Somebody said:
That's because the script is called 4 times before they are assigned to a faction - in all likelihood they've already reached their ideal size and the next time the script is called (in 48 hour intervals), there will be no room for your new khergits.

So, what I want to do can't be done?

BTW, I experimented a little trying to figure this thing out and attempted to"zero-out" pt_villager_defenders

Code:
("village_defenders","Village Defenders",icon_peasant,0,fac_commoners,merchant_personality,[(0,0,0),(0,0,0)]),

and of course the farmers still showed up.
 
I can't for the life of me work out how to make movable siege ladders.... move. I assumed it would be like the portcullis and winch, but it doesn't seem to be. Whats the secret trick to making these things work?

Cheers guys!
 
Lucke189 said:
Anyway, to add more ladders. Go to edit mode and go to the scene you want to change.
This is for multiplayer (For singleplayer you have to add some AI-things or something)

Just scroll down among the scene props until you find the ladders called something like "movable_ladder_14"
Just make sure they have "movable" in front.

Place it in its final position to the wall, then place an Entry point, at the bottom, pointing towards were you want it to be laying on the ground.
Entry Point has to have a number between 100-109, one for each ladder.

Restart the scene and the ladders will work.
 
When I see armors people have made they all seem to be on the same template of a body, where do I find this template and how do I put it into Wings/Blender?
 
Tell me, how would I script a "simple" bombing command .What I mean is that you select a place from the map and it will be "bombarded" with bombs from the sky. The bombs don't actually need to drop from the sky. I could just add the a sound effect which would give the whooming sound before it explodes. but the thing is, Id like to have 5 bombs per command. D: and that they wouldn't all hit at the same spot since it shouldn't be too accurate. Scatter around a bit you know.
 
zollum said:
When I see armors people have made they all seem to be on the same template of a body, where do I find this template and how do I put it into Wings/Blender?

For the most part it is the nude body model. You could find it in the commonres (that should be the name) folder.

Now for a problem I've been having. I can't compile the clean Warband Module System (but I can with M&B 1.011). Any ideas?
 
zollum said:
When I see armors people have made they all seem to be on the same template of a body, where do I find this template and how do I put it into Wings/Blender?

The armors used as templates I think just come from commonres brfs, which you can open with openBrf and export to Wings.
 
Status
Not open for further replies.
Back
Top Bottom