Hello.
I'm looking for a way, how to export item type via python/process_item.py.
I am aware how to export item stats, name or price. however, I don't know how to find item type.
My modified function "write_items" in process_items.py looks like this:
So, question is - How to print/get item type?
I'm looking for a way, how to export item type via python/process_item.py.
I am aware how to export item stats, name or price. however, I don't know how to find item type.
My modified function "write_items" in process_items.py looks like this:
Python:
def write_items(variable_list,variable_uses,tag_uses,quick_strings):
mycursor = mydb.cursor()
mycursor.execute("TRUNCATE TABLE items")
itemkinds_file_name = export_dir + "item_kinds1.txt"
ofile = open(itemkinds_file_name,"w")
ofile.write("itemsfile version 3\n")
ofile.write("%d\n"%len(items))
for item in items:
if (item[3] & itp_merchandise) > 0:
id_no = find_object(items,convert_to_identifier(item[0]))
add_tag_use(tag_uses,tag_item,id_no)
ofile.write(" itm_%s %s %s %d "%(convert_to_identifier(item[0]),replace_spaces(item[1]),replace_spaces(item[1]),len(item[2])))
item_variations = item[2]
for item_variation in item_variations:
mycursor = mydb.cursor()
sql = "INSERT INTO items (name, weight, full_name, price) VALUES (%s, %s, %s, %s)"
val = (item[0], get_weight(item[6]), item[1], item[5])
print(item[0], item[1], item[2], item[3], item[4], item[5], item[6])
mycursor.execute(sql, val)
mydb.commit()
ofile.write(" %s %d "%(item_variation[0],item_variation[1]))
ofile.write(" %d %d %d %d %f %d %d %d %d %d %d %d %d %d %d %d %d\n"%(item[3], item[4], item[5], item[7],
get_weight(item[6]),
get_abundance(item[6]),
get_head_armor(item[6]),
get_body_armor(item[6]),
get_leg_armor(item[6]),
get_difficulty(item[6]),
get_hit_points(item[6]),
get_speed_rating(item[6]),
get_missile_speed(item[6]),
get_weapon_length(item[6]),
get_max_ammo(item[6]),
get_thrust_damage(item[6]),
get_swing_damage(item[6]),
))
if (len(item) > 9):
ofile.write(" %d\n"%(len(item[9])))
for item_faction in item[9]:
ofile.write(" %d"%item_faction)
ofile.write("\n")
else:
ofile.write(" 0\n")
trigger_list = []
if (len(item) > 8):
trigger_list = item[8]
save_simple_triggers(ofile,trigger_list, variable_list,variable_uses,tag_uses,quick_strings)
ofile.close()
So, question is - How to print/get item type?