Flying Squirrel Entertainment

Mount & Blade Warband: Napoleonic Wars => Modifications => Topic started by: Ivkolya on October 03, 2019, 11:14:52 pm

Title: How to make a unit to have different set of uniform+hat?
Post by: Ivkolya on October 03, 2019, 11:14:52 pm
hello all, I'm making Ottoman Bashi-Bazouks for my mod, they had people of many nations, and accordingly different nations traditions, so there was a large variety of costumes. But simply give to the unit random uniforms and hats isn't a good way, because the hat must match other costume, it will be wrong to see an Albanian with Arab hat (as example). So is there a way to make hats matching uniform, but that are randomly given to the unit?
As a last resort, I can make different nations of Bashi-Bazouks as different units, but it's not so interesting.

And also can I give to a unit lance and musket simultaneously? In game there is or lance or musket :(
Title: Re: How to make a unit to have different set of uniform+hat?
Post by: Wolffe on October 18, 2019, 09:06:44 am
For as far as I know they will always be random when you give 1 troop multiple uniforms.
You could however just add another troop.

Hope this helps you out :p
Title: Re: How to make a unit to have different set of uniform+hat?
Post by: Ivkolya on October 19, 2019, 08:45:23 pm
Thank you :)
But I was hoping I can avoid making extra troops:)
Title: Re: How to make a unit to have different set of uniform+hat?
Post by: DarthKiller on October 28, 2019, 12:48:45 pm
I might be a bit late but just asking, is it a real modification or just a skin for nw?

Cause if it was a modification there are ways in scripting to actually achieve your goal (That however requires you to be able to use the mount & blade scripting language)
Title: Re: How to make a unit to have different set of uniform+hat?
Post by: Woeski on October 28, 2019, 07:33:37 pm
I might be a bit late but just asking, is it a real modification or just a skin for nw?

Cause if it was a modification there are ways in scripting to actually achieve your goal (That however requires you to be able to use the mount & blade scripting language)

The question is still how  :P
Title: Re: How to make a unit to have different set of uniform+hat?
Post by: Parrot on October 31, 2019, 09:54:23 pm
i managed this in b&i for the french militia; you assign one item to the head, trousers, and feet in the troops module file, then assign a pool of items to the torso. In the scripts file you add a check to the script that triggers on agent spawning, this will check for a specific item and then you can execute some code that will replace the items in the other slots, like this:

Code
	   (try_for_range_backwards,":equipment_slot",ek_item_0,ek_gloves),
     (agent_get_item_slot, ":item_id", ":agent_no", ":equipment_slot"),
     (gt,":item_id",-1), # even have an item there?
     (try_begin),
   (eq, ":item_id", "itm_fr_civ_black"),
   (agent_unequip_item, ":agent_no", "itm_fr_civ_hat_green", ek_head),
   (agent_unequip_item, ":agent_no", "itm_fr_civ_trousers_green", ek_foot),
   (agent_equip_item, ":agent_no", "itm_fr_civ_hat_black", ek_head),
   (agent_equip_item, ":agent_no", "itm_fr_civ_trousers_brown", ek_foot),
     (else_try),
   (eq, ":item_id", "itm_fr_civ_blue_01"),
   (agent_unequip_item, ":agent_no", "itm_fr_civ_hat_green", ek_head),
   (agent_unequip_item, ":agent_no", "itm_fr_civ_trousers_green", ek_foot),
   (agent_equip_item, ":agent_no", "itm_fr_civ_hat_blue_alt", ek_head),
   (agent_equip_item, ":agent_no", "itm_fr_civ_trousers_skyblue", ek_foot),
     (else_try),

as for the voices, use the same principle that applies to the highlanders and king's german legion in NW (i used this for the cantis in b&i, something you're trying to achieve too), but rather than point the script to the highlander voice tuple, point it to the normal female one and have it trigger only on the canti troop.