SP Tutorial Module System Adding a Weapon/Item

Did you find this useful

  • Yes

    Votes: 80 62.5%
  • No

    Votes: 48 37.5%

  • Total voters
    128

Users who are viewing this thread

Reval95 said:
Exporting item data...
        File "process_items,py" , line 29, in write_items
          ofile.write (" %s %d "%(item variation[0], item_variation[1]))
TypeError: 'long' object is not subscriptable

you have a syntax error. Visit the Q&A thread https://forums.taleworlds.com/index.php/topic,6575.0.html and post your item code (a few lines before it, a few after it), using CODE tag

Code:
my item code from module_items.py goes here

you need to follow the basic rules for a field (number of elements and the "(", "[", ",", ")", "]" that make a entry

Code:
####################################################################################################################
#  Each item record contains the following fields:
#  1) Item id: used for referencing items in other files.
#     The prefix itm_ is automatically added before each item id.
#  2) Item name. Name of item as it'll appear in inventory window
#  3) List of meshes.  Each mesh record is a tuple containing the following fields:
#    3.1) Mesh name.
#    3.2) Modifier bits that this mesh matches.
#     Note that the first mesh record is the default.
#  4) Item flags. See header_items.py for a list of available flags.
#  5) Item capabilities. Used for which animations this item is used with. See header_items.py for a list of available flags.
#  6) Item value.
#  7) Item stats: Bitwise-or of various stats about the item such as:
#      weight, abundance, difficulty, head_armor, body_armor,leg_armor, etc...
#  8) Modifier bits: Modifiers that can be applied to this item.
#  9) [Optional] Triggers: List of simple triggers to be associated with the item.
#  10) [Optional] Factions: List of factions that item can be found as merchandise.
####################################################################################################################
 
Back
Top Bottom