Is it possible to compile only some parts of a mod? I want a way to compile only the troops and item file to distribute to a team member so he can make changes, compile and test them himself.
KratosMKII said:Is it possible to compile only some parts of a mod? I want a way to compile only the troops and item file to distribute to a team member so he can make changes, compile and test them himself.
kalarhan said:KratosMKII said:Is it possible to compile only some parts of a mod? I want a way to compile only the troops and item file to distribute to a team member so he can make changes, compile and test them himself.
you can run the process_XXX.py files yourself, the .bat file just runs all of them in a certain order. As there are plenty of dependencies you will need to study and see what you need to do for each .txt file.
items is a easy one, while troops depends on items, and so on.
now the second part above didnt make sense, so not sure what you are trying to do on "to distribute to a team member so he can make changes, compile and test them himself". The other dude will also need all module_XXX.py files, you cant send him .txt files if he will need to compile code for other stuff.
KratosMKII said:Edit: I run process_troops.py and in the console it says that it's exporting troop data. It then closes but it only generates .pyc files. What to do with them?
Cigic said:Heraldic deployable pavise
Hi all,
I've spent too much time trying to resolve this.
When shiled spawns as a scene prop, instead of the heraldry I get only a black surface.
Here is code:
module_items
module_tableau _materials["pavise", "Tower Shield", [("tableau_shield_pavise_3_new" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,470 , weight(6)|hit_points(500)|body_armor(1|spd_rtng(7|shield_width(43)|shield_height(90),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_3", ":agent_no", ":troop_no")])]],
("pavise_shield_3a", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
module_mission_templates
module_scene_props:#pavise
Pavise = (0, 0, 0,
[],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
#==click g && has pavise
(try_begin),
#(agent_has_item_equipped, ":player_agent", "itm_pavise"),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(eq, ":shield_item", "itm_pavise"),
(key_clicked, key_g),
(clear_omitted_keys),
(scene_prop_get_num_instances, ":num_props", "spr_pavise"),
(position_move_y, pos2, 50),
(set_spawn_position, pos2),
(assign, ":pav_found", 0),#pf
#FOR # props if prop at LATENT spot
(try_for_range, ":prop_no", 0, ":num_props"),
(eq, ":pav_found", 0),#pf
(scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
(prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
(position_get_z, ":z_coor", pos3),
(eq, ":z_coor", -100*100),#-100 LATENT spot
(prop_instance_set_position, ":scene_prop_id", pos2),#pavise move
(get_player_agent_no, ":player_agent"),
(agent_unequip_item, ":player_agent", "itm_pavise"),
(assign, ":pav_found", 1),#pf
(try_end),
(try_begin),
(lt, ":pav_found", 1),#pf
(spawn_scene_prop, "spr_pavise"),#pavise spawn
(get_player_agent_no, ":player_agent"),
(agent_unequip_item, ":player_agent", "itm_pavise"),
(try_end),
(try_end),
(scene_prop_get_num_instances, ":num_props", "spr_pavise"),
#==click h && near proped pavise
(try_begin),
(key_clicked, key_h),
(clear_omitted_keys),
#FOR # props if prop close to player
(try_for_range, ":prop_no", 0, ":num_props"),
(scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
(prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
(get_distance_between_positions, ":player_distance", pos2, pos3),
(le, ":player_distance", 100),
(position_set_z, pos3, -100*100),#-100 LATENT spot
(prop_instance_set_position, ":scene_prop_id", pos3),#pavise move
(set_spawn_position, pos2),
(position_move_y, pos2, 50),
(spawn_item, "itm_pavise"),#pavise spawn
(try_end),
#(scene_prop_set_visibility, ":scene_prop_id", 0),
#(init_position, pos1),
(try_end),
])
("pavise",sokf_moveable|sokf_destructible,"tableau_shield_pavise_prop_3","bo_tableau_shield_pavise_prop_3", [
#check_castle_door_use_trigger,
(ti_on_init_scene_prop,
[ (cur_scene_prop_set_tableau_material, "tableau_pavise_shield_3a", "trp_player"),
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 100),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
#(assign, reg0, ":z_difference"),
#(display_message, "@{!}z dif : {reg0}"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
Please help
THANKS.
(cur_scene_prop_set_tableau_material, "tableau_pavise_shield_3a", "trp_player"),
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
Problem is that it generates only the .pyc files. When i go to the output module folder, the troop file hasn't changed at all. I went through each file and checked the dependencies. It also doesn't generate the file if i execute it in a folder with all the module files.kalarhan said:KratosMKII said:Edit: I run process_troops.py and in the console it says that it's exporting troop data. It then closes but it only generates .pyc files. What to do with them?
process_XXX.py creates the XXXX.txt files. So check your module folder and the new file should be there (as normal).
in other words: instead of creating ALL .txt files, you created just ONE .txt file.
*.pyc files can be ignored/removed (they are machine code created from the *.py files. It is a Python thingy. If curious you can google to learn more about it)
KratosMKII said:Problem is that it generates only the .pyc files
I made a bat file but this is what i get:kalarhan said:KratosMKII said:Problem is that it generates only the .pyc files
there is no secret here. If your module system is compiling, you can run any of the files (taking care of dependencies). Remember to check your module_info.py for the path.
on a console/terminal you can run the command "python process_troops.py"
or just create a new .bat file for that
C:\Users\Username\Desktop\Troop>process_troops.py
Exporting troops data
Traceback (most recent call last):
File "C:\Users\Username\Desktop\Troop\process_troops.py", line 110, in <module>
save_troops()
File "C:\Users\Username\Desktop\Troop\process_troops.py", line 38, in save_troo
ps
for inventory_item in inventory_list:
TypeError: 'long' object is not iterable
KratosMKII said:I made a bat file but this is what i get:
Ok i do that. Thank you.kalarhan said:KratosMKII said:I made a bat file but this is what i get:
fix your bugs and syntax errors, verify any special dependency. If build_module.bat works, you can run troops by itself as well. As one is just a small part of the other.
Arch3r said:Cigic said:Heraldic deployable pavise
Hi all,
I've spent too much time trying to resolve this.
When shiled spawns as a scene prop, instead of the heraldry I get only a black surface.
Here is code:
module_items
module_tableau _materials["pavise", "Tower Shield", [("tableau_shield_pavise_3_new" ,0)], itp_merchandise|itp_type_shield|itp_cant_use_on_horseback|itp_wooden_parry, itcf_carry_board_shield,470 , weight(6)|hit_points(500)|body_armor(1|spd_rtng(7|shield_width(43)|shield_height(90),imodbits_shield, [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_pavise_shield_3", ":agent_no", ":troop_no")])]],
("pavise_shield_3a", 0, "sample_shield_matte", 512, 512, 0, 0, 0, 0,
[
(store_script_param, ":banner_mesh", 1),
(set_fixed_point_multiplier, 100),
(init_position, pos1),
(position_set_x, pos1, 100),
(position_set_y, pos1, 120),
(cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
(init_position, pos1),
(position_set_z, pos1, 10),
(cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_3", pos1, 0, 0),
(cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
]),
module_mission_templates
module_scene_props:#pavise
Pavise = (0, 0, 0,
[],
[
(get_player_agent_no, ":player_agent"),
(agent_get_position, pos2, ":player_agent"),
#==click g && has pavise
(try_begin),
#(agent_has_item_equipped, ":player_agent", "itm_pavise"),
(agent_get_wielded_item, ":shield_item", ":player_agent", 1),
(eq, ":shield_item", "itm_pavise"),
(key_clicked, key_g),
(clear_omitted_keys),
(scene_prop_get_num_instances, ":num_props", "spr_pavise"),
(position_move_y, pos2, 50),
(set_spawn_position, pos2),
(assign, ":pav_found", 0),#pf
#FOR # props if prop at LATENT spot
(try_for_range, ":prop_no", 0, ":num_props"),
(eq, ":pav_found", 0),#pf
(scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
(prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
(position_get_z, ":z_coor", pos3),
(eq, ":z_coor", -100*100),#-100 LATENT spot
(prop_instance_set_position, ":scene_prop_id", pos2),#pavise move
(get_player_agent_no, ":player_agent"),
(agent_unequip_item, ":player_agent", "itm_pavise"),
(assign, ":pav_found", 1),#pf
(try_end),
(try_begin),
(lt, ":pav_found", 1),#pf
(spawn_scene_prop, "spr_pavise"),#pavise spawn
(get_player_agent_no, ":player_agent"),
(agent_unequip_item, ":player_agent", "itm_pavise"),
(try_end),
(try_end),
(scene_prop_get_num_instances, ":num_props", "spr_pavise"),
#==click h && near proped pavise
(try_begin),
(key_clicked, key_h),
(clear_omitted_keys),
#FOR # props if prop close to player
(try_for_range, ":prop_no", 0, ":num_props"),
(scene_prop_get_instance, ":scene_prop_id", "spr_pavise", ":prop_no"),
(prop_instance_get_position, pos3, ":scene_prop_id"), #pos3 holds position of current prop
(get_distance_between_positions, ":player_distance", pos2, pos3),
(le, ":player_distance", 100),
(position_set_z, pos3, -100*100),#-100 LATENT spot
(prop_instance_set_position, ":scene_prop_id", pos3),#pavise move
(set_spawn_position, pos2),
(position_move_y, pos2, 50),
(spawn_item, "itm_pavise"),#pavise spawn
(try_end),
#(scene_prop_set_visibility, ":scene_prop_id", 0),
#(init_position, pos1),
(try_end),
])
("pavise",sokf_moveable|sokf_destructible,"tableau_shield_pavise_prop_3","bo_tableau_shield_pavise_prop_3", [
#check_castle_door_use_trigger,
(ti_on_init_scene_prop,
[ (cur_scene_prop_set_tableau_material, "tableau_pavise_shield_3a", "trp_player"),
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 100),
]),
(ti_on_scene_prop_destroy,
[
(play_sound, "snd_dummy_destroyed"),
(assign, ":rotate_side", 86),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":attacker_agent_no"),
(set_fixed_point_multiplier, 100),
(prop_instance_get_position, pos1, ":instance_no"),
(try_begin),
(ge, ":attacker_agent_no", 0),
(agent_get_position, pos2, ":attacker_agent_no"),
(try_begin),
(position_is_behind_position, pos2, pos1),
(val_mul, ":rotate_side", -1),
(try_end),
(try_end),
(init_position, pos3),
(try_begin),
(ge, ":rotate_side", 0),
(position_move_y, pos3, -100),
(else_try),
(position_move_y, pos3, 100),
(try_end),
(position_move_x, pos3, -50),
(position_transform_position_to_parent, pos4, pos1, pos3),
(position_move_z, pos4, 100),
(position_get_distance_to_ground_level, ":height_to_terrain", pos4),
(val_sub, ":height_to_terrain", 100),
(assign, ":z_difference", ":height_to_terrain"),
#(assign, reg0, ":z_difference"),
#(display_message, "@{!}z dif : {reg0}"),
(val_div, ":z_difference", 3),
(try_begin),
(ge, ":rotate_side", 0),
(val_add, ":rotate_side", ":z_difference"),
(else_try),
(val_sub, ":rotate_side", ":z_difference"),
(try_end),
(position_rotate_x, pos1, ":rotate_side"),
(prop_instance_animate_to_position, ":instance_no", pos1, 70), #animate to position 1 in 0.7 second
(try_end),
]),
(ti_on_scene_prop_hit,
[
(store_trigger_param_1, ":instance_no"),
(store_trigger_param_2, ":damage"),
(try_begin),
(scene_prop_get_hit_points, ":hit_points", ":instance_no"),
(val_sub, ":hit_points", ":damage"),
(gt, ":hit_points", 0),
(play_sound, "snd_dummy_hit"),
(else_try),
(neg|multiplayer_is_server),
(play_sound, "snd_dummy_destroyed"),
(try_end),
(try_begin),
(this_or_next|multiplayer_is_server),
(neg|game_in_multiplayer_mode),
(particle_system_burst, "psys_dummy_smoke", pos1, 3),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
(try_end),
]),
]),
Please help
THANKS.
the problem may lay here, in module_scene_props:
As header_operations describes this operation as:Code:(cur_scene_prop_set_tableau_material, "tableau_pavise_shield_3a", "trp_player"),
Can only be used inside ti_on_init_scene_prop trigger in module_scene_props.py. Assigns tableau to the scene prop instance. Value of <instance_code> will be passed to tableau code. Commonly used for static banners.
Your tableau code is as follows:
Now, if you look there, you're expecting a banner mesh to be passed in (store_script_param, ":banner_mesh", 1), but you are passing a troop (trp_player).Code:(store_script_param, ":banner_mesh", 1), (set_fixed_point_multiplier, 100), (init_position, pos1), (position_set_x, pos1, 100), (position_set_y, pos1, 120), (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0), (init_position, pos1), (position_set_z, pos1, 10), (cur_tableau_add_mesh, "mesh_tableau_mesh_shield_pavise_3", pos1, 0, 0), (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
ti_on_item_dropped
Somebody said:Don't hook the code on a 0,0,0 trigger, there's a specific one just for dropping itemsYou can't just add random parameters to triggers and hope it works. I recommend storing the player agent's id in a global and use it inside the init code, or store the banner mesh directly and pass that into the scene prop to pass to the tableau.Code:ti_on_item_dropped
Cigic said:Would you be so kind to write me one option in more detail?
# SCENE PROP TRIGGERS (used in module_scene_props)
ti_on_scene_prop_init = -40.0 # A scene prop instance has been created on the scene.
ti_on_init_scene_prop = ti_on_scene_prop_init # Alternate syntax
# trigger param 1 = prop instance_id reference
ti_on_scene_prop_hit = -42.0 # A scene prop has been hit by some agent.
# Note that on client-side in multiplayer missions only trigger param 1 and position registers are available. Trigger params 2..7 are only available to server or in singleplayer.
# trigger param 1 = prop instance_id reference
# trigger param 2 = amount of damage delivered to the scene prop (not available on client side in multiplayer)
# trigger param 3 = attacker agent_id (not available on client side in multiplayer)
# trigger param 4 = item_id of the weapon used to attack
# trigger param 5 = weapon item modifier
# trigger param 6 = item_id of missile used to attack (if attack was by ranged weapon)
# trigger param 7 = missile item modifier
# pos1 = position of the hit area
# pos2 = X field holds attacker's agent_id reference
# Trigger Result: if set, damage dealt to prop
ti_on_scene_prop_destroy = -43.0 # A destructible scene prop has been destroyed by some agent. Does not fire on client side in multiplayer missions.
# trigger param 1 = prop instance_id reference
# trigger param 2 = attacker agent_id
ti_on_scene_prop_start_use = -47.0 # An agent is attempting to activate a usable scene prop. Useful if you want a scene prop to be activated instantly without any timeout. Does not fire on client side in multiplayer missions.
# trigger param 1 = agent_id of the agent who has started using the scene prop
# trigger param 2 = prop instance_id reference
ti_on_scene_prop_cancel_use = -48.0 # An agent has cancelled using the scene prop. Does not fire on client side in multiplayer missions.
# trigger param 1 = agent_id of the agent who cancelled using the scene prop
# trigger param 2 = prop instance_id reference
ti_on_scene_prop_use = -44.0 # A usable scene prop has been activated by some agent. Does not fire on client side in multiplayer missions.
# trigger param 1 = agent_id of the agent who activated the scene prop
# trigger param 2 = prop instance_id reference
ti_on_scene_prop_is_animating = -45.0 # Called each frame when a scene prop is animating.
# trigger param 1 = prop instance_id reference
# trigger param 2 = remaining animation time (apparently in 1/100th of second).
ti_on_scene_prop_animation_finished = -46.0 # Animation sequence has been completed for a scene prop.
# trigger param 1 = prop instance_id reference
ti_scene_prop_deformation_finished = -76.0 # Deformation sequence has been completed for a scene prop.
# trigger param 1 = prop instance_id reference
kalarhan said:Cigic said:Would you be so kind to write me one option in more detail?
see header_triggers.py for the list of triggers and parameters for each type. You cant use a item trigger on a scene prop, or a item trigger on a mission template trigger, and so on.
^ example above is for propsCode:# SCENE PROP TRIGGERS (used in module_scene_props) ti_on_scene_prop_init = -40.0 # A scene prop instance has been created on the scene. ti_on_init_scene_prop = ti_on_scene_prop_init # Alternate syntax # trigger param 1 = prop instance_id reference ti_on_scene_prop_hit = -42.0 # A scene prop has been hit by some agent. # Note that on client-side in multiplayer missions only trigger param 1 and position registers are available. Trigger params 2..7 are only available to server or in singleplayer. # trigger param 1 = prop instance_id reference # trigger param 2 = amount of damage delivered to the scene prop (not available on client side in multiplayer) # trigger param 3 = attacker agent_id (not available on client side in multiplayer) # trigger param 4 = item_id of the weapon used to attack # trigger param 5 = weapon item modifier # trigger param 6 = item_id of missile used to attack (if attack was by ranged weapon) # trigger param 7 = missile item modifier # pos1 = position of the hit area # pos2 = X field holds attacker's agent_id reference # Trigger Result: if set, damage dealt to prop ti_on_scene_prop_destroy = -43.0 # A destructible scene prop has been destroyed by some agent. Does not fire on client side in multiplayer missions. # trigger param 1 = prop instance_id reference # trigger param 2 = attacker agent_id ti_on_scene_prop_start_use = -47.0 # An agent is attempting to activate a usable scene prop. Useful if you want a scene prop to be activated instantly without any timeout. Does not fire on client side in multiplayer missions. # trigger param 1 = agent_id of the agent who has started using the scene prop # trigger param 2 = prop instance_id reference ti_on_scene_prop_cancel_use = -48.0 # An agent has cancelled using the scene prop. Does not fire on client side in multiplayer missions. # trigger param 1 = agent_id of the agent who cancelled using the scene prop # trigger param 2 = prop instance_id reference ti_on_scene_prop_use = -44.0 # A usable scene prop has been activated by some agent. Does not fire on client side in multiplayer missions. # trigger param 1 = agent_id of the agent who activated the scene prop # trigger param 2 = prop instance_id reference ti_on_scene_prop_is_animating = -45.0 # Called each frame when a scene prop is animating. # trigger param 1 = prop instance_id reference # trigger param 2 = remaining animation time (apparently in 1/100th of second). ti_on_scene_prop_animation_finished = -46.0 # Animation sequence has been completed for a scene prop. # trigger param 1 = prop instance_id reference ti_scene_prop_deformation_finished = -76.0 # Deformation sequence has been completed for a scene prop. # trigger param 1 = prop instance_id reference
For how to use variables like globals read https://forums.taleworlds.com/index.php/topic,142422.0.html
Janycz said:Hello! How can I fix such a bug with red-green water? (Bug with cows on water I fixed: I deleted TexturesHD).
Recently I fixed an issue with red-green-black water. I just offed HDR in game options. No HDR = no bug.kalarhan said:Janycz said:Hello! How can I fix such a bug with red-green water? (Bug with cows on water I fixed: I deleted TexturesHD).
are you using the latest Warband (1.174)? Do you still have the texture issue with a new Native campaign - cows invasion? From there compare the differences with your old assets on your mod.