Python error, I havn't got a clue what its trying to tell me, help please.

正在查看此主题的用户

Grant2600

Recruit
Hi, I got this python error, i have just started modding this game and its probably a obvious mistake but whatever it is I havn't got a clue how to fix it, I have only added some more troops and some items, I haven't made any new textures or models just changed the prefference id, in game name and things like damage

i cant insert an image of the error because im not sure how to get the code for an image so i'll write out the error...


Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 105, in (module)
    save_troops()
  File "process_troops.py", line 32, in save_troops
    file.write("\ntrp_%s %s %s %d %d %d %d %d %d\n    "%(convert_to_identifier(tro
op[0]),replace_spaces(troop[1]),replace_spaces(reoop[2]),troop[3],troop[4],troop
[5],  troop[6],  troop[13],  troop[14]))
TypeError: %d format: a number is required,not list


after this is goes back to exporting the rest of the files correctly but i cant seem to find the problem for this one becuase it talks about process files other than module files and i havn't edited any process files or any other files other than module files

If any cant help me it would be much appreciated

Thanks :smile:


 
If you can't debug by yourself,
1, Press ctrl+z to undo until there is no error.
2, Don't change your source code so much at a time. When you changed a line of the source code, You should build your source code quickly. Then you can know where there is the error.
3, Check comma, "[]" -box brackets, "{}" - braces.
4, Take backup your source code.
 
thanks for the help guys, I didn,t find the problem but I undone my steps intill everything compiled correctly, now i'll be sure to run buildmodule.bat more often :grin:

Thanks.
 
Actually sorry I found the tuple that is causing the problem but I cant see anything wrong with it could someone please point it out.





["persian_recruit","Persian Recruit","Persian Recruits",tf_guarantee_boots|tf_guarantee_armor|
tf_guarantee_helmet,0,fac_commoners,
  [itm_leather_jerkin,itm_leather_boots,itm_shortened_spear,itm_sword_medieval_b_small,itm_skullcap],
  str_7|agi_8|level(3),wp(60),knows_common, mercenary_face_1, mercenary_face_2],


Thanks.
 
thanks, I was looking at another tuple a couple mins ago and replace the ,0, with no_scene,reserved. I was missing the sixth part of the tuple, its all exporting correctly now


Thanks for the help :grin:
 
后退
顶部 底部