Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
What do the numbers mean Mason?

I've added some new towns, castles and villages and when I run build_module.bat I get this:

插入代码块:
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
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 process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\process_operations.py", line 20, in <module>
    from module_scripts import *
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\module_scripts.py", line 73843, in <module>
    modmerge(var_set)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\modmerger.py", line 239, in modmerge__
    _temp.__dict__[mergefn_name](var_dict)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2720, in modmerge
    modmerge_pbod_scripts(orig_scripts)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\pbod_scripts.py", line 2735, in modmerge_pbod_scripts
    process_script_directives(orig_scripts, scripts_directives)
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_scripts.py", line 57, in process_script_directives
    find_i = list_find_first_match_i(orig_scripts, cur_directive[1])
  File "C:\Users\Adam1\Downloads\RaW_2.5 Source Code\util_common.py", line 44, in list_find_first_match_i
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'int' object has no attribute 'lower'
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

I find that my mod hasn't updated afterwards. What is it trying to tell me and what do I need to fix?
 
Brivime 说:
I find that my mod hasn't updated afterwards. What is it trying to tell me and what do I need to fix?

when you run the build_module.bat it tries to create new .txt files (scripts.txt, etc) for your mod. If at any time something goes wrong it will explode (with those error and warning messages) and it won't finish it (so your .txt files will be corrupted)

you are using modmerger. At a quick glance it looks like you have a bad syntax on a script (probably a error on merging the code)
插入代码块:
AttributeError: 'int' object has no attribute 'lower

you could try showing your code here (it would help to see where the error is), or to wait for someone that works with modmerger and that may be able to help further.
 
I've compiled this module system before without trouble from modmerger but here is the code within modmerger.py

插入代码块:
from modmerger_options import *
from util_common import *

# make sure the following are define (should be in options.py)
try:
    mods_active
except NameError:
    mods_active = []
    
try:
    mods_process_order
except NameError:
    mods_process_order = []
    
from modmerger_header import *




# Return if a mod is active.
def mod_is_active(modname):
    try:
        mods_active.index(modname)
        return True
    except ValueError, IndexError:
        return False
        

# modcomp_name : name of module component less the "module_" prefix, e.g. for "module_items", it will be "items"   
#   must be one of the values in mod_components
def mod_get_process_order(modcomp_name):
    from util_common import list_find_first_match_i

    find_i = list_find_first_match_i(mods_process_order, modcomp_name)
    if(find_i > -1):
        return mods_process_order[find_i][1]

    return mods_active
    
	
# generic function that calls the "modmerge_{component_name}" function in each of the mod python files.
def modmerge_( modcomp_name, orig_objects ):
    mod_process_order = mod_get_process_order(modcomp_name)
    
    for x in mod_process_order:
        if(mod_is_active(x)):
            try:
                mergefn_name = "modmerge_%s"%(modcomp_name)
                _temp = __import__( "%s_%s"%(x,modcomp_name) , globals(), locals(), [mergefn_name],-1)
                logger.info("Merging objects \"%s\" from mod \"%s\"..."%(modcomp_name,x))
                _temp.__dict__[mergefn_name](orig_objects)
            except ImportError:
                errstring = "Component \"%s\" not found for mod \"%s\"." % (modcomp_name, x)
                logger.debug(errstring)
        else:
            errstring = "Mod \"%s\" not active for Component \"%s\"." % (x, modcomp_name)
            logger.debug(errstring)
         


	
# default merging function for items if modmerge or modmerge_items not found in target {mod}_items.py
# Items need special processing due to need to preserve the dummy item marking the end
# mod_name : code name of the target mod
# var_dict : variable dictionary from the original module_{component}.py
# return true if successful. False otherwise
def modmerge_items(mod_name, var_dict):
    # manually import required variables from {mod}_items.py
    var_name = "items"    
    modcomp_name = var_name
    src_module_name = "%s_%s"%(mod_name,modcomp_name)
    vars_to_import= [var_name]
    try:
        orig_items = var_dict[var_name]
    except KeyError:
        errstring = "Expected variable \"%s\" not found in module \"%s\" for mod \"%s\"." % (var_name, src_module_name, mod_name)
        raise KeyError(errstring)    
    try:
        _temp = __import__( src_module_name , globals(), locals(), vars_to_import,-1)
        item_end = orig_items.pop() # temporary remove item_end
        num_appended, num_replaced, num_ignored = add_objects(orig_items, _temp.items)
        orig_items.append(item_end) # push back item_end
        logger.info("Merged \"items\" from %s: appended=%d, replaced=%d, ignored=%d" % (src_module_name, num_appended, num_replaced, num_ignored))
        return True
    except ImportError:
        errstring = "Failed importing for component \"%s\" for mod \"%s\"." % (modcomp_name, mod_name)
        logger.debug(errstring)
    
    return False        
        
 


# default merging function for items if modmerge not found in target {mod}_{component}.py
# This version is for those components with only 1 major variable same as the component name and the data should be a list of tuples/list where first element is id
# mod_name : code name of the target mod
# var_dict : variable dictionary from the original module_{component}.py
# return true if successful. False otherwise
def modmerge_generic(mod_name, var_dict, modcomp_name, src_module_name, var_name):
    # manually import required variables from {mod}_items.py
    
    #modcomp_name = "items"
    src_module_name = "%s_%s"%(mod_name,modcomp_name)
    vars_to_import= [var_name]
    try:
        orig_objects = var_dict[var_name]
    except KeyError:
        errstring = "Expected variable \"%s\" not found in module \"%s\" for mod \"%s\"." % (var_name, src_module_name, mod_name)
        raise KeyError(errstring)
    
    try:
        _temp = __import__( src_module_name , globals(), locals(), vars_to_import,-1)
        num_appended, num_replaced, num_ignored = add_objects(orig_objects, _temp.__dict__[var_name])
        logger.info("Merged \"%s\" from %s: appended=%d, replaced=%d, ignored=%d" % (var_name, src_module_name, num_appended, num_replaced, num_ignored))
        return True
    except ImportError:
        errstring = "Failed importing for component \"%s\" for mod \"%s\"." % (modcomp_name, mod_name)
        logger.debug(errstring)
    
    return False       



# 2nd default merging function for items if modmerge not found in target {mod}_{component}.py
# This version is for those components with only 1 major variable same as the component name and the data should be just be appended (usually no simple, e.g. simple_triggers)
# mod_name : code name of the target mod
# var_dict : variable dictionary from the original module_{component}.py
# return true if successful. False otherwise
def modmerge_generic2(mod_name, var_dict, modcomp_name, src_module_name, var_name):
    # manually import required variables from {mod}_items.py
    
    #modcomp_name = "items"
    src_module_name = "%s_%s"%(mod_name,modcomp_name)
    vars_to_import= [var_name]
    try:
        orig_objects = var_dict[var_name]
    except KeyError:
        errstring = "Expected variable \"%s\" not found in module \"%s\" for mod \"%s\"." % (var_name, src_module_name, mod_name)
        raise KeyError(errstring)
    
    try:
        _temp = __import__( src_module_name , globals(), locals(), vars_to_import,-1)
        num_appended, num_replaced, num_ignored = add_objects(orig_objects, _temp.__dict__[var_name], ADDMODE_APPEND)
        logger.info("Merged \"%s\" from %s: appended=%d, replaced=%d, ignored=%d" % (var_name, src_module_name, num_appended, num_replaced, num_ignored))
        return True
    except ImportError:
        errstring = "Failed importing for component \"%s\" for mod \"%s\"." % (modcomp_name, mod_name)
        logger.debug(errstring)
    
    return False      

# Generic merge function that tries to detect the component name currently merging from calling module
# Must be called from one of the "module_*.py" files where applicable
def modmerge_100(orig_objects):
	## verify modulename
    import inspect, os.path, re
    callermodule = os.path.basename(inspect.stack()[1][1])
    result = re.match("^(module_([^.]*)).py", callermodule)
    if(result):
        callermodule = result.group(1)
        modcomp_name = result.group(2)
        logger.info("Detected: module = \"%s\", component name = \"%s\""%(callermodule,modcomp_name))
        try:
            mod_components.index(modcomp_name)
            modmerge_(modcomp_name,orig_objects)
        except KeyError:
            raise ValueError("Component \"%s\" not recognized."%(modcomp_name))
    else:
        errstring = "Must be called from a module_*.py"
        logger.error(errstring)
        raise ValueError(errstring)            
        

# version 200/201 functions
# Generic function that calls the "modmerge(variable_set)}" function in each of the mod python files.
# If the modmerge() function is not found in target module, it will try to merge target components using the most common settings.
def modmerge__( modcomp_name, var_dict ):
    mod_process_order = mod_get_process_order(modcomp_name)
    
    for x in mod_process_order:
        if(mod_is_active(x)):
            done = False

            mod_name = x
            src_module_name = "%s_%s"%(x,modcomp_name)
            #print "src_module_name=",src_module_name ## debug
            
            # 1) try to get localized modmerge() from target module
            try:
                mergefn_name = "modmerge"
                _temp = __import__( src_module_name ,{} , {}, [mergefn_name],-1)
                logger.info("Merging objects \"%s\" from mod \"%s\"..."%(modcomp_name,x))
                _temp.__dict__[mergefn_name](var_dict)
                done = True
            except ImportError:
                errstring = "Module \"%s\" not found for mod \"%s\"." % (src_module_name, mod_name)
                logger.debug(errstring)
            except KeyError:
                errstring = "\"%s\" not found in \"%s\" not found for mod \"%s\"." % (mergefn_name, src_module_name, mod_name)
                logger.debug(errstring)
                
            # 2) if modmerge() not found, try general method (which just append/replace main array)
            if not done:
                # start of specialized switch case
                component_type = get_component_type(modcomp_name)
                
                if modcomp_name == "items": # item is special case for type 2
                    done = modmerge_items(mod_name, var_dict)
                elif modcomp_name == "factions": # put factions here although is of type 4, but left out "default_kingdom_relations"
                    done = modmerge_generic(mod_name, var_dict, modcomp_name, src_module_name, modcomp_name)            
                #elif modcomp_name == "scripts": # put factions here although is of type 4, but left out "default_kingdom_relations"
                    #pass #TODO
                elif (modcomp_name in ["dialogs", "triggers", "simple_triggers"]):
                    done = modmerge_generic2(mod_name, var_dict, modcomp_name, src_module_name, modcomp_name)                            
                elif component_type & 2 : 
                    done = modmerge_generic(mod_name, var_dict, modcomp_name, src_module_name, modcomp_name)            
        else:
            errstring = "Mod \"%s\" not active for Component \"%s\"." % (x, modcomp_name)
            logger.debug(errstring)

# Generic merge function that tries to detect the component name currently merging from calling module
# Must be called from one of the "module_*.py" files where applicable
def modmerge(var_dict, modcomp_name=None):
    from modmerger_header import mod_components
    ## verify modulename
    if  modcomp_name is None:
        import inspect, os.path, re
        callermodule = os.path.basename(inspect.stack()[1][1])
        result = re.match("^(module_([^.]*)).py", callermodule)
        if(result):
            callermodule = result.group(1)
            modcomp_name = result.group(2)
            logger.info("Detected: module = \"%s\", component name = \"%s\""%(callermodule,modcomp_name))    
            #try:
                #mod_components.index(modcomp_name)
            #except KeyError:
                #raise ValueError("Component \"%s\" not recognized."%(modcomp_name))
        else:
            errstring = "Must be called from a module_*.py, called from module: %s" % callermodule
            logger.error(errstring)
            raise ValueError(errstring)          
    else:
        try:
            mod_components.index(modcomp_name)
        except KeyError:
            raise ValueError("Component \"%s\" not recognized."%(modcomp_name))
    
    if not modcomp_name is None:
        try:	 
            mod_components.index(modcomp_name)
            modmerge__(modcomp_name,var_dict)
        except KeyError:
            raise ValueError("Component \"%s\" not recognized."%(modcomp_name))
    else:
        raise ValueError("Component not specified and cannot be detected.")

           
 
Brivime 说:
I've compiled this module system before without trouble from modmerger but here is the code within modmerger.py

the issue is not with the compiler (unless you changed it), but with your modsys code. If you make a syntax mistake on a script, as a example, it cant finish the compilation. That is what the error message seems to indicate (with little info we have now).

the modmerger compiler was expecting a string (something like "ABC"), but at that point it got a numeric value (like 12), which breaks the process. Usually this is a consequence of user error (bug).
 
kalarhan 说:
the issue is not with the compiler (unless you changed it), but with your modsys code. If you make a syntax mistake on a script, as a example, it cant finish the compilation. That is what the error message seems to indicate (with little info we have now).

the modmerger compiler was expecting a string (something like "ABC"), but at that point it got a numeric value (like 12), which breaks the process. Usually this is a consequence of user error (bug).

Does the error mention where the missing string is? I've only made changes to module_troops.py, module_parties.py and module_scripts.py and the extent of my tinkering there was simply copy-pasting entries for towns.

Going back through the changes I've made, I haven't changed any letters to numbers.

 
Brivime 说:
Does the error mention where the missing string is? I've only made changes to module_troops.py, module_parties.py and module_scripts.py and the extent of my tinkering there was simply copy-pasting entries for towns.

Going back through the changes I've made, I haven't changed any letters to numbers.

syntax mistake is not something we do on purpose, it is usually a mistake that get past our visual inspection. That is why the compiler warns as about them, then we need to hunt them down  :grin:

check your module_scripts.py changes, it is the most likely place of your error (as I mentioned earlier). You may also post your entire modsys code (some modders do that) on dropbox or Github, if you want someone to give it a look (keep in mind that may not happen), if you are not sure about which parts you changed (you can't post the entire module_scripts.py on the forum)
 
I've trundled through and changed some things that seemed iffy but that hasn't fixed it.

Here is the full module system: https://www.dropbox.com/sh/snzb3ea7f5t51aq/AADuomsNhBZ5yAbNH71Sud1_a?dl=0

I've only made changes to things relevant to kingdom_10 and culture_10, that includes knights and ladies.

I've added towns 39 through to 40, castles 30 to 35 and villages 110 to 130 and all the things concerning those.

So only module_troops.py, module_parties.py, module_scenes.py and module_scripts.py have been edited and only things regarding 'Carthage/kingdom_10' have been changed.

I'll continue to go through it but any help and advice is much appreciated as this is my first attempt at modding and I really don't know what I'm doing.


EDIT:

I solved the problem, there was a misplaced "])," in module_scripts.py.

However, I have a new error now when I try to compile it:

插入代码块:
Error: Unable to find object: str_kingdom_10_adjective
ERROR: Illegal identifier: str_kingdom_10_adjective
 
Brivime 说:
插入代码块:
Error: Unable to find object: str_kingdom_10_adjective
ERROR: Illegal identifier: str_kingdom_10_adjective

str_XXX is a string, from module_strings.py

check if you have the entry for "kingdom_10_adjective" there, and if the syntax is OK.

remember you need to pre-compile the code when adding new stuff (items, props, etc), before you use them on scripts, ... or manually add it to the ID_XXX.py file and compile twice.

Brivime 说:
I solved the problem, there was a misplaced "])," in module_scripts.py.
that is a common example of bad syntax. You should compile your code often (add some stuff, compile it, add more), to avoid having to hunt too many places when things explode (baby steps)
 
HarryPham123 说:
need help how to fix this http://imgur.com/a/BZfxG
you can figure this out yourself i will give you a helping hand and explain the first error so you can do the others yourself
qIMwpqv.jpg

this is your first error list, we will fix the bottom one
error: Script error on opcode 581: invalid party idea at script dple_party_calculate_strength_in_terrain

So what did you do? you probably readed it and got super frustrated, but code is logicaly
error: Script error on opcode 581: invalid party idea at script dple_party_calculate_strength_in_terrain
so now you now there is a party that isn't pointing to something in dple_party_calculate_strength_in_terrain.

You could even without knowing anything about code just look the file and check if all your party ideas are pointing to somewhere.

What would be a better way would be to actually know errors, study them i'm pretty sure that caba drin wrote a tutorial about it somewhere.
so with KNOWLEDGE look again
error: Script error on opcode 581: invalid party idea at script dple_party_calculate_strength_in_terrain
when you studied errors of the module system you should now that the number 581 corresponds with a operation in header_operations
 
builder of the gods 说:
HarryPham123 说:
need help how to fix this http://imgur.com/a/BZfxG
you can figure this out yourself i will give you a helping hand and explain the first error so you can do the others yourself

actually you are looking at the symptoms, not the root cause. Note that his game doesn't have a party ID #0 (main_party, yours), which causes all those other errors.

as mentioned in a previous post: he needs to review his "game_start" script and what he added as the OSP. Something broke his player party, and that is the place he needs to start to look for the original issue.
 
Quick question about save game compatibility:

1) What changes 'break' saves, actually causes crashes? From searching,  I know that I can't increase/decrease the count of items, troops, triggers. What about  simple_triggers?

2) What changes 'softly' break saves, where it just doesn't execute in old saves, but players are still able to continue?



Thanks in advance
 
You can increase the amount of items/troops and it will work fine, just make sure you don't add stuff in the middle unless it's to replace placeholder items. Decreasing will break savegames (crashing when you try to load it). Generally speaking, if the engine lets you load up a savegame you're fine, but if you change slots around then the savegame won't know about it since it will retain old values.
 
Thanks. And with regards to simple_triggers? I slotted them in between dummy triggers (and added a few more dummy triggers), tested it out, and my savegame didnt crash. I assume I'm good to go, right? Thanks again
 
HI!

I wanna write simple script or trigger that would check if any party is a ship and then check its leader skl_navigation to modify party's speed on the water.

I can't find any piece of code in Warband that would modify party speed. Could you point me to any solution for that? Thanks in advance.


Details if needed: (what I've found till now)
I am trying to implement sea travels to my mod. For now I used https://forums.taleworlds.com/index.php?topic=316581.0 For now I disabled option for travel for npc lord parties. But I let some parties like looters or sea riders travelling by sea.

I saw that any party on the sea has the same speed - 15.0

How to get into mechanism of any party's speed? Is it hardcoded? I have found commented out "game_get_party_speed_multiplier" script in Warband, and Floris is somehow using it.
 
MadGuarang 说:
HI!

I wanna write simple script or trigger that would check if any party is a ship and then check its leader skl_navigation to modify party's speed on the water.

I can't find any piece of code in Warband that would modify party speed. Could you point me to any solution for that? Thanks in advance.


Details if needed: (what I've found till now)
I am trying to implement sea travels to my mod. For now I used https://forums.taleworlds.com/index.php?topic=316581.0 For now I disabled option for travel for npc lord parties. But I let some parties like looters or sea riders travelling by sea.

I saw that any party on the sea has the same speed - 15.0

How to get into mechanism of any party's speed? Is it hardcoded? I have found commented out "game_get_party_speed_multiplier" script in Warband, and Floris is somehow using it.

check VC MS
 
MadGuarang 说:
I can't find any piece of code in Warband that would modify party speed

Native has the script commented out.

插入代码块:
  #script_game_get_party_speed_multiplier
  # This script is called from the game engine when a skill's modifiers are needed
  # INPUT: arg1 = party_no
  # OUTPUT: trigger_result = multiplier (scaled by 100, meaning that giving 100 as the trigger result does not change the party speed)
  ("game_get_party_speed_multiplier",
    [

uncomment it and apply your own rules. VC has a implementation of this if you want a example.
 
Hey,

I want to scale a object in meter, that means, I have a scene prop and I want all scale x, y and z to be 5 meter.
(prop_instance_set_scale, ":instance_id", ":scale", ":scale", ":scale"),

would be the command. But how do I calculate it so it's meter?
 
If I remove items from item_kinds1 (with Morgh's tool) my game crashes when starting a new game. When this happened, I tried deleting just a couple of items and it was fine. Deleted a few more and it crashed. Are there items that can't be removed?
 
状态
不接受进一步回复。
后退
顶部 底部