Super specific: how do I add items with modifiers (Tempered, Masterwork,etc.) to NPCs?

Users who are viewing this thread

I know it can be done - mods like PoP do it. Sadly, the standard "troop_add_item" command doesn't seem to work right as the NPC just won't equip any item added that way.

How is it done?
 
Solution
Python:
troop_add_item                           = 1530  # (troop_add_item, <troop_id>, <item_id>, [modifier]),
                                                 # Adds an item to the troop, optionally with a modifier (see imod_* constants in header_item_modifiers.py).
Don't forget to add the respective modifier at the end. Is it some new weapon which you want to give them or is it their casual weapon which they have already at the beginning?
Python:
troop_add_item                           = 1530  # (troop_add_item, <troop_id>, <item_id>, [modifier]),
                                                 # Adds an item to the troop, optionally with a modifier (see imod_* constants in header_item_modifiers.py).
Don't forget to add the respective modifier at the end. Is it some new weapon which you want to give them or is it their casual weapon which they have already at the beginning?
 
Upvote 0
Solution
Python:
troop_add_item                           = 1530  # (troop_add_item, <troop_id>, <item_id>, [modifier]),
                                                 # Adds an item to the troop, optionally with a modifier (see imod_* constants in header_item_modifiers.py).
Don't forget to add the respective modifier at the end. Is it some new weapon which you want to give them or is it their casual weapon which they have already at the beginning?
As I said, that command doesn't seem to work properly here as the NPC won't equip any item I add that way.

If there's a way to just add the modifier to items they already have equipped on module_troops, I'm all ears. I didn't even know that was possible.
 
Upvote 0
Well, it should work since others are using it too. The best here would be that you post your code and explain how you are using it so that we can see it and point to possible errors.

Otherwise edit process_troops.py and edit it as follows:
Fixed it. Everything's working fine now. Ty.

Say, while I'm here, I got another issue I could use some help with. I've been dicking around with changing lords' flags and I've run into this issue:


For context, this is Klargus' castle. Klargus has a flag with a red background, I changed it to this blue one. Except for whatever reason, the back of his soldiers' heraldic armor is still red. Any idea why this is?
 
Upvote 0
For future references, always open up a new question, otherwise it gets messy with the answers.

The backside of the heraldry is done differently than the one at the front side. It's some kind of banner background color array thing, getting mentioned here. I see that @MadVader wrote about it in the post afterwards, perhaps he can explain it better to you than I since I have never looked into that yet.
 
Upvote 0
Back
Top Bottom