Indentation Error:unexpected indent problem.Please Help!

  • 主题发起人 ContTrabiyuo
  • 开始时间

正在查看此主题的用户

ContTrabiyuo

how can i solve this problem:
插入代码块:
Initializing...
Traceback (most recent call last):
  File "process_global_variables.py", line 9, in <module>
    from module_dialogs import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_dialogs.py", line 1438
    [party_tpl|pt_soyguncular,"start", [(eq,"$talk_context",tc_party_encounter)]
, "Hey you there! Why you are looking for?", "order2",[]],
    ^
IndentationError: unexpected indent
Sorry for bad language
module_dialogs.py:
插入代码块:
party_tpl|pt_soyguncular,"start", [(eq,"$talk_context","tc_party_encounter")], "Hey you there! Why you are looking for?", "order2",[]],
  [party_tpl|pt_soyguncular|plyr,"order2", [], "For stollen pieces. Before cutting your head give it to me!", "order3",[]],
  [party_tpl|pt_soyguncular,"order3", [], "Hahaha! Before give me 4 million denars", "order4",[]],
  [party_tpl|pt_soyguncular|plyr,"order4", [], "Good joke. Prepare to war", "close_window",[[encounter_attack]]],
  [party_tpl|pt_soyguncular,"order2", [], "Nothing", "close_window",[]],

  [party_tpl|pt_soyguncular,"start", [(eq,"$talk_context",tc_hero_defeated)], "Please don't kill me i will give your wanted","relikwia",[]],
  [party_tpl|pt_soyguncular|plyr,"relikwia", [], "Okey, tell me where is the stollen pieces", "relikwia2",[]],
  [party_tpl|pt_soyguncular,"relikwia2", [], "I dont have stolled pieces. We took it to our cave. It's near the Thir","relikwia3",[]],
  [party_tpl|pt_soyguncular|plyr,"relikwia3", [], "Damn!", "close_window",[(assign, "$g_leave_encounter",1)]],
i added that dialogs by using kolba's thread
 
please display the code before
party_tpl|pt_soyguncular,"start", [(eq,"$talk_context","tc_party_encounter")], "Hey you there! Why you are looking for?", "order2",[]],
and after
[party_tpl|pt_soyguncular|plyr,"relikwia3", [], "Damn!", "close_window",[(assign, "$g_leave_encounter",1)]],
 
No, I mean where did you included your new code in the file module_dialogs, this may be the "location" that cause that error
so display all the  (existing) codes/dialogs/lines before and after you new dialogs ...
 
try this one :
  [trp_den, "start", [], "Hi,how can i help?","cevap1",[]],
  [trp_usta, "start", [[eq,"$talk_to_prens", 1]], "Hi {playername}, welcome to our kamp. Before training you must make some quests.","gerfcevap",[(assign,"$talk_to_prens",1)]],
  [trp_usta|other(trp_gerf), "gerfcevap", [], "Usta, bla bla","ustacevap",[]],
  [trp_usta, "ustacevap", [], "Ne zamandan beri sacma konusuyorsun?","gerfcevap2",[]],
  [trp_usta|other(trp_gerf), "gerfcevap2", [], "(Homurdanir)","ustacevap2",[]],
  [trp_usta, "ustacevap2", [], "Bosver sen onu. Kampin son zamanlarindaki gidisatindan acemileri sorumlu tutuyor. O yuzden boyle","soru",[]],
  [trp_usta|plyr, "soru", [], "Devam edin lutfen.","ustacevap3",[]],
  [trp_usta, "ustacevap3", [(neg|check_quest_active,"qst_anagorev"),(neg|check_quest_finished,"qst_anagorev"),], "Evet, simdi sana ilk olarak bir is vericem. Gidip prensle konusmani istiyorum kendisi talimden sorumludur. Ilerde bulabilirsin.","close_window",[]],
  [trp_usta|plyr, "soru", [], "Kamp neden boyle?","ustacevap4",[]],
  [trp_usta, "ustacevap4", [], "Artan savaslardan dolayi boyleyiz. Imparatorlugun ihtisamli gunlerinde en otedeki issiz colde bile adimiz gecerdi. Ah! Ah! O eski gunler.","ustacevap4devam",[]],
  [trp_usta, "ustacevap4devam", [], "Bunlari simdi bilmesen de olur. Simdi amacina odaklanmalisin.","ustagorev",[]],
  [trp_usta, "ustagorev", [(neg|check_quest_active,"qst_anagorev"),(neg|check_quest_finished,"qst_anagorev"),], "Evet simdi sana ilk olarak bir is vericem. Gidip prensle konusmani istiyorum kendisi talimden sorumludur. Ilerde bulabilirsin.","close_window",
  [
  (setup_quest_text, "qst_anagorev"),
  (str_store_string, s2, "str_anagorev"),
  (quest_set_slot, "qst_anagorev"),
  (call_script,"script_start_quest" ,"qst_anagorev" ,"trp_usta"),
  (assign, "$talk_to_prens", 0)]],

  [trp_prens, "start", [(check_quest_active,"qst_anagorev")], "Kimsin?.","prens11",[]],
  [trp_prens|plyr, "prens11", [], "Yeni gelenlerdenim. Beni usta yolladi.","prens111",[]],
  [trp_prens, "prens111", [], "Anladim. (Devam etmek icin bir daha konusun)","close_window",[(call_script, "script_end_quest", "qst_anagorev"),(add_xp_as_reward,30)]],

  [trp_prens, "start", [[eq,"$holy_relic",2]], "Merhaba {playername}.","bye2",[(assign,"$holy_relic",2)]],
  [trp_prens|plyr, "bye2", [], "Merhaba , Prens.","close_window",[]],
  [trp_prens, "start", [[eq,"$holy_relic",1]], "Lavta mi bulabildin mi?","relic_find_question",[]],
  [trp_prens|plyr, "relic_find_question", [(player_has_item,"itm_lute")], "Evet! Bu biraz zor oldu.", "relic_znaleziona",[(call_script,"script_end_quest","qst_anagorev2")]],
  [trp_prens|plyr, "relic_find_question", [], "Henüz değil.", "close_window",[]],
  [trp_prens, "relic_znaleziona", [], "Gercekten mi! Tebrikler {genc adam/kadin}! Sana odul vermecegim. Bu kitap bir odul. Dukkanlarda satabilirsin.","close_window",[[assign,"$holy_relic",2]]],
  [trp_prens, "start", [[eq,"$holy_relic",0]], "Evet, sana ilk isini vericem. Ustaya kendini kanitlaman lazim.Hazir misin?", "god1",[]],
  [trp_prens|plyr, "god1", [], "Evet!", "god2",[]],
  [trp_prens, "god2", [], "Guzel. Birkac soysuz herif ustanin lavtasini caldi bana kalsa iyi yaptilar cunku hergun burada onun sacma sarkisinin dinlemek zorunda kaliyorduk. Ama yapacak bir sey yok neyse senden bu lavtayi geri almani istiyorum. Haydutlar gozculerin dedigine gore veidar yakinlarindaymis", "god3",[]],
  [trp_prens|plyr, "god3", [], "Harika, bu super bir teklif. O lavtayi geri alacagim!", "close_window",[ 
  (call_script,"script_start_quest","qst_anagorev2","trp_prens"),
  (set_spawn_radius,1),
  (spawn_around_party,"p_village_48","pt_soyguncular")
  (setup_quest_text, "qst_anagorev2"),
  (str_store_string, s2, "str_anagorev2"),
  ]],
  [party_tpl|pt_soyguncular,"start", [(eq,"$talk_context","tc_party_encounter")], "Hey you there! Why you are looking for?", "order2",[]],
  [party_tpl|pt_soyguncular|plyr,"relikwia3", [], "Yine ugrasicaz.","close_window",[(assign, "$g_leave_encounter",1)]],
  [party_tpl|pt_soyguncular|plyr,"order2", [], "Calinti mallar icin! Kafanizi kesmeden once onu bana verin!", "order3",[]],
  [party_tpl|pt_soyguncular,"order3", [], "Hahaha! Once bana 4 milyon dinar vermelisin!", "order4",[]],
  [party_tpl|pt_soyguncular|plyr,"order4", [], "Guzel saka. O zaman savas icin hazirlan!", "close_window",[[encounter_attack]]],
  [party_tpl|pt_soyguncular,"order2", [], "Birsey yok...", "close_window",[]],

  [party_tpl|pt_soyguncular,"start", [(eq,"$talk_context",tc_hero_defeated)], "Lutfen beni oldurme sana istedigini veririm.","relikwia",[]],
  [party_tpl|pt_soyguncular|plyr,"relikwia", [], "Peki bana calinti mallari ver bende gitmene izin vereyim.", "relikwia2",[]],
  [party_tpl|pt_soyguncular,"relikwia2", [], "Mallar bende degil ki hepsini siginagimiza goturduk. Siginak Thir yakinlarinda.","relikwia3",[]],       
  [party_tpl|pt_soyguncular|plyr,"relikwia3", [], "Damn!", "close_window",[(assign, "$g_leave_encounter",1)]],



]#this is at the end of the file
 
This kind of error (indentation) is usually a bad syntax, like missing a comma ",", or a "]", etc. And usually the error is on the line above the error message.

1) Copy the indicated line and quote it here. You need to copy 5-10 lines before that point, and 5-10 lines after that point at the very least.

2) Delete your new code, make sure it compiles. Then add your new code slowly, bit by bit, until you can find the error. That helps if you can't visually find the problem.
^if you are adding 20 new dialogs, try adding 1 to 5 first, then adding more, until you get the 20.

3) Use WRECK instead, better error handling (suggestion)
 
ok, you have some extra "]"
remove them :
one in the end of file  (remove one of them)
插入代码块:
]]

and one before (remove it)
插入代码块:
]
[trp_nurse_for_lady, "start", ..... [
 
something wrong with "num_trade_goods = itm.siege_supply - itm.spice"
in module_constants.py
try to replace  itm. by itm_  like : num_trade_goods = itm_siege_supply - itm_spice


 
add "," (in the line before (setup_quest_text, "qst_anagorev2"), )
(spawn_around_party,"p_village_48","pt_soyguncular"),
 
builder of the gods 说:
I really have no idea this is random ****
not random at all  :mrgreen:

ContTrabiyuo 说:
you are so awesome thanks a lot worked but i have a problem:
插入代码块:
Traceback (most recent call last):
  File "process_init.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\process_operations.py", line 17, in <module>
    from module_items import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_items.py", line 1, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_global_variables.py", line 8, in <module>
    from module_triggers import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_triggers.py", line 9, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from module_map_icons import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_map_icons.py", line 2, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Exporting faction data...
Traceback (most recent call last):
  File "process_items.py", line 7, in <module>
    from module_items import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_items.py", line 1, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_scenes.py", line 5, in <module>
    from module_scenes import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_scenes.py", line 5, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from module_scene_props import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_scene_props.py", line 7, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from module_tableau_materials import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_tableau_materials.py", line 6, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_presentations.py", line 7, in <module>
    from module_presentations import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_presentations.py", line 7, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 7, in <module>
    from module_game_menus import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_game_menus.py", line 8, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from module_scripts import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_scripts.py", line 4, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from module_mission_templates import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_mission_templates.py", line 8, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from module_game_menus import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_game_menus.py", line 8, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from module_simple_triggers import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_simple_triggers.py", line 10, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_dialogs.py", line 8, in <module>
    from module_triggers import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_triggers.py", line 9, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\process_operations.py", line 17, in <module>
    from module_items import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_items.py", line 1, in <module>
    from module_constants import *
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\module_constants.py", line 470, in <module>
    num_trade_goods = itm.siege_supply - itm.spice
NameError: name 'itm' is not defined
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
what can i do?
You need to revisit the thread for WRECK, you are trying to use the old compiler (build_module.bat) on a module system written for WRECK (that has a alternative compiler and syntax).

Read the explanation on the OP again, download that module system or convert yours, and remove the old compiler. That is, if you want to use WRECK as your compiler (which is a good idea)
 
ContTrabiyuo 说:
yeah i sawed this thread before but i don't understand because my english is so bad.I tried to use google translate result:fail.

Try checking the Non English forums for a language you are more confortable with, maybe you can find a good modding community

I wouldn't know, as I focus only on this one (keep in mind English is my 4th language, not my first either).

If you can't understand the tool then go back to Native compiler, at least there are more people around that can help you with it.
 
ContTrabiyuo 说:
Wow do you know anything about turkish?
nope

What the oblivion is that error!?!!:
插入代码块:
COMPILER INTERNAL ERROR:
Traceback (most recent call last):
  File "compile.py", line 310, in <module>
    entities[index] = entity_def['processor'](entities[index], index)
  File "C:\Users\user\Desktop\mb_warband_module_system_1166_lav\Module_system 1.
166\compiler.py", line 1065, in process_troops
    result.append((' %d' * num_weapon_proficiencies) % tuple([e[9][index] for in
dex in xrange(num_weapon_proficiencies)]))
KeyError: 0


COMPILATION FAILED.
this is error line but i cant understand i didnt make anything in compiler.py:
插入代码块:
result.append((' %d' * num_weapon_proficiencies) % tuple([e[9][index] for index in xrange(num_weapon_proficiencies)]))

Learn to read the error message.

Compile.py is your compiler. Syntax has rules, you must follow them, or compiler can't understand what you are doing. And it explodes.

You have a troop (check around that line 1065) that is not following the syntax, so the compiler can't load the values for proficiences (one handed, two handed, bow ...) weapons

Learn to work on baby steps. A small change, compile your code. Don't work for hours and try to compile it later. Small changes, so the error will be easy to spot.
 
ContTrabiyuo 说:
i understand.How do i begin? Adding dialogs or adding scenes and troops?

There is no right answer for that question. Each new feature is different, so just remember to test it often and compile often, eventually you will learn more about MBScript and can move faster with changes.

If you want to avoid a lot of issues learn to use a source control system. Git is perfect for modding. Github is a great public/free website to keep your backups. And on the plus side it is easy to show people what you are doing, and ask for help.
 
后退
顶部 底部