How to determine if items will use a certain modifier

Users who are viewing this thread

lukaszirn

Recruit
I am new at modding, and having some problems making my troops use an item with a certain modifier (cracked, reinforced, lordly...etc),

I have for example my nord footman, and I want him to have a itm_cracked_leather_cap, but that causes an error (unsurprisingly) and the only lists of modifers I could find were from .6 something (03?)
["nord_footman","Nord Footman","Nord Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws,
  [itm_fighting_axe,itm_one_handed_war_axe_a,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_javelin,
    itm_leather_cap,itm_skullcap,itm_nomad_vest,itm_shirt,itm_leather_boots,itm_nomad_boots],

So yeah thanks for helping a noob, its your daily good dead  :o.
 
Also could you influence the probability of a troop getting an item by using
["nord_footman","Nord Footman","Nord Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws,
  [itm_fighting_axe,itm_one_handed_war_axe_a,itm_spear,itm_spear,itm_spear,itm_spear,itm_spear,itm_spear,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_javelin,itm_throwing_axes,
    itm_leather_cap,itm_skullcap,itm_nomad_vest,itm_shirt,itm_leather_boots,itm_nomad_boots],

instead of
["nord_footman","Nord Footman","Nord Footmen",tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield,0,0,fac_outlaws,
  [itm_fighting_axe,itm_one_handed_war_axe_a,itm_spear,itm_tab_shield_round_a,itm_tab_shield_round_b,itm_javelin,itm_throwing_axes,
    itm_leather_cap,itm_skullcap,itm_nomad_vest,itm_shirt,itm_leather_boots,itm_nomad_boots],
 
The modifiers are set it module_troops.py

You can change which modifiers go with which item but they appear randomly (..ish).

You can't set a troop to have a cracked leather cap (not sure that you could have a cracke leather cap anyway. it kind of makes no sense).

The only way to do it would be to duplicate the leather cap item and rename it "cracked leather cap". Then, obviously, remove the modifiers and reduce the stats.

As for influencing the probabilty, I don't know. I presume that it would work like that but i'm not sure.
 
The easy way - make a new item copied directly from the leather cap, except without any modifiers. Rename the item cracked leather cap and decrease its cost and armor value to whatever it needs to be. Then assign that item to the troop.



mfberg

edit - too slow!!
 
Darn, I had hoped to differentiate some units by their quality of armor, I guess there would be no simple solution to this except for changing the actual code...
hmm.......
I know duplicating every item and make 1. item=normal-low quality/ 2. item=normal-high quality solve it but that would be boring as hell...

Um...also on an off chance does anyone know how to put health on wepaons and the shield failing system?
or is that way to far out there for a simple noobmodder like me?
 
mfberg said:
The easy way - make a new item copied directly from the leather cap, except without any modifiers. Rename the item cracked leather cap and decrease its cost and armor value to whatever it needs to be. Then assign that item to the troop.



mfberg

edit - too slow!!

My second victim of the day.

lukaszirn said:
Darn, I had hoped to differentiate some units by their quality of armor, I guess there would be no simple solution to this except for changing the actual code...
hmm.......
I know duplicating every item and make 1. item=normal-low quality/ 2. item=normal-high quality solve it but that would be boring as hell...

Um...also on an off chance does anyone know how to put health on wepaons and the shield failing system?
or is that way to far out there for a simple noobmodder like me?

I wouldn't try putting health on weapons. Firstyly because it's hard. Secondly because it would suck.

What do you want to do with the shield failing system?

btw, if you want to mod, you have to be prepared to do boring work.

but, seriously, don't do that with the cracked leather caps and stuff. Not every unit needs different equipment and there's already a limit on the number of items. It's just a waste.
 
Ok I am trying to expand the troop trees and i can't texture or code very well, so I was trying to find a way to give units a larger difference...

the shlied breaking/failing system was a random idea going through my head...  I was going to apply it to lances, so going in circles and lancing would no longer be a good idea...just a random thought

and Captain lust, I just checked for some nord armor mod resources, which I will attempt to use to individualize every unit, so I no longer need the cracked idea...

Thank you for all the help everyone
 
It is possible to set a modifier to troop’s items, but it requires a bit coding.
Instead of adding equipment in module_troop.py it is possible to add equipment in module_script.py
If you add (troop_add_item, “trp_nord_footman”,”itm_leather_cap”, imod_cracked), somewhere in game_start script, a nord footman will get a cracked leather cap and will use from time to time.
Not sure but I believe the native looting code for such nord footman still have a chance to produce a harden leather cap.
 
Rognar, would I have to remove leather cap from the module_troops.py for the nord_footman entry?
and thank you for the help, I may include that
 
If you want that nord footman can use only cracked leather cap, yes, you have to remove leather cap from the module_troops.py for the nord_footman entry.
 
Back
Top Bottom