I'm not sure I understood your question correctly, but:
1. All items that you provide your custom companion in module_troops.py cannot have any modifiers.
2. You can give your companion some items via script at the start of the game (script_initialize_npcs seems the most sensible place for this, but any place in script_game_start or it's children scripts will do). Giving items this way at the start of the game is equivalent of giving them to troop in module_troops.py, but in script you can specify item modifiers.
To clarify, you are saying that it is not possible for Companions starting equipment to be 'Lordly Great Helm' and 'Masterwork Example Sword' items in the module_troops.py?
Also since the scripts is also .py file, my question still stands, if the name of an item is "itm_Example_Sword", how would I turn it into a Lordly Example Sword in the game?
To clarify, you are saying that it is not possible for Companions starting equipment to be 'Lordly Great Helm' and 'Masterwork Example Sword' items in the module_troops.py?
Also since the scripts is also .py file, my question still stands, if the name of an item is "itm_Example_Sword", how would I turn it into a Lordly Example Sword in the game?
It't not a question of what is a py file. In a script you can add an item to a troop with troop_add_item command, and this command understands item modifiers. So you would write something like:
You can give items with modifiers to whatever troop you want, but you need to edit the module system compiler.
Here is what you need to do:
1.open process_troops.py
2.search for this piece of code
Code:
for inventory_item in inventory_list:
# add_tag_use(tag_uses,tag_item,inventory_item)
file.write("%d 0 "%inventory_item)
3.replace it with this one
Code:
for inventory_item in inventory_list:
# add_tag_use(tag_uses,tag_item,inventory_item)
if(type(inventory_item) == types.ListType) or (type(inventory_item) == types.TupleType):
file.write("%d %d "%(inventory_item[0], inventory_item[1]<<24))
else:
file.write("%d 0 "%inventory_item)
4.Done.
Normally, the troop's inventory list would look like this:
Instead of (<item_id>, <item_modifier>) you can also use [<item_id>, <item_modifier>].
Note: you can mix between items with modifiers and items without modifiers (notice in the example how the first two items have a modifier, while the third one doesn't).
Hmm, seems to be a max of 88 total companions that can be added to the game, sigh and I wrote a java file to spit out thousands of copy pasta companions (at least my comp why give up and die then)
Cheers and thanks again
Edit: @Dragon, you posted that as I was writing this one, I'll definitely try doing that, will save a ton of lines of code in the script init file (along the lines of exactly 616 code lines) for all of the only 88 (grumble) of my copy pasta companions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.