Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Dj_FRedy said:
I think it refers as reputation martial, fighting, cunning, etc...
To set it you can do it with the operation:
Code:
troop_set_slot                           =  500  # (troop_set_slot, <troop_id>, <slot_no>, <value>),

Variables are defined in 'module_troops' and 'module_constants'.
<troop_id>: well, troop id to modify
<slot_no> to configure: 'slot_lord_reputation_type'
Different <value>: search 'lrep_none' and the different reputations below
Code:
(troop_set_slot, "trp_knight_1_1", slot_lord_reputation_type, lrep_martial),
We establish Count Klargus the martial reputation.

You can place this operation at the end of the 'game_start' script, for example, and start a new game, or you can create a new menu, in 'module_game_menus' and set your changes there, this already needs more knowledge of ModSys, or the module system.

Thank you so much, I had been poking around in module_scripts at the "initialize_aristocracy" section in a very frustrated manner haha.
I am using the Floris Dev Suite as my base for adding new factions etc. I was starting to think that Lord reputations were just out of my reach!

I hope I am not pushing it here but I would like to pick your brain one more time.

In Floris expanded, Sea-Travel seems to be enabled for everyone except Kings and Vassals. How would I go about letting Kings and Vassals travel the sea?

Again, thank you so much for your help and time!
 
In the Floris mod, the navigation system is only enabled/codified for the Player, Royal Traders and Sea Raiders, if that's what you mean.

Making the other parties use this system would require a deep coding, as a point to consider, the current system is a mere idea of what was intended in the beginning... the lack of time of the Floris modders did the rest, an unfinished work but still playable.
 
I was frustrated trying to figure out how to trigger silverstag bodysliding without starting dplmc battle continuation script or straight out finish the battle second after body finally switched.  :facepalm:

I set my default $enable_bodysliding to BODYSLIDING_ALL_TROOPS during game start.
here are my script.

lead_charge
Code:
(
    "lead_charge",mtf_battle_mode|mtf_synch_inventory,charge,
    "You lead your men to battle.",
    [
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),
     ],
    [
      (ti_on_agent_spawn, 0, 0,
     [
      (eq, "$bodyslide_spawn_block", 0),
     ],
       [
         (store_trigger_param_1, ":agent_no"),
         (call_script, "script_agent_reassign_team", ":agent_no"),

         (assign, ":initial_courage_score", 5000),

         (agent_get_troop_id, ":troop_id", ":agent_no"),
         (store_character_level, ":troop_level", ":troop_id"),
         (val_mul, ":troop_level", 35),
         (val_add, ":initial_courage_score", ":troop_level"), #average : 20 * 35 = 700

         (store_random_in_range, ":randomized_addition_courage", 0, 3000), #average : 1500
         (val_add, ":initial_courage_score", ":randomized_addition_courage"),

         (agent_get_party_id, ":agent_party", ":agent_no"),
         (party_get_morale, ":cur_morale", ":agent_party"),

         (store_sub, ":morale_effect_on_courage", ":cur_morale", 70),
         (val_mul, ":morale_effect_on_courage", 30), #this can effect morale with -2100..900
         (val_add, ":initial_courage_score", ":morale_effect_on_courage"),

         #average = 5000 + 700 + 1500 = 7200; min : 5700, max : 8700
         #morale effect = min : -2100(party morale is 0), average : 0(party morale is 70), max : 900(party morale is 100)
         #min starting : 3600, max starting  : 9600, average starting : 7200
         (agent_set_slot, ":agent_no", slot_agent_courage_score, ":initial_courage_score"),
         ]),

      common_battle_init_banner,

      (ti_on_agent_killed_or_wounded, 0, 0, [],
       [
        (store_trigger_param_1, ":dead_agent_no"),
        (store_trigger_param_2, ":killer_agent_no"),
        (store_trigger_param_3, ":is_wounded"),

        (try_begin),
          (ge, ":dead_agent_no", 0),
          (neg|agent_is_ally, ":dead_agent_no"),
          (agent_is_human, ":dead_agent_no"),
          (agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
##          (str_store_troop_name, s6, ":dead_agent_troop_id"),
##          (assign, reg0, ":dead_agent_no"),
##          (assign, reg1, ":killer_agent_no"),
##          (assign, reg2, ":is_wounded"),
##          (agent_get_team, reg3, ":dead_agent_no"),
          #(display_message, "@{!}dead agent no : {reg0} ; killer agent no : {reg1} ; is_wounded : {reg2} ; dead agent team : {reg3} ; {s6} is added"),
          (party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
          (eq, ":is_wounded", 1),
          (party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
        (try_end),

        (call_script, "script_apply_death_effect_on_courage_scores", ":dead_agent_no", ":killer_agent_no"),
       ]),

      common_battle_tab_press,

      (ti_question_answered, 0, 0, [],
       [(store_trigger_param_1,":answer"),
        (eq,":answer",0),
        (assign, "$pin_player_fallen", 0),
        (try_begin),
          (store_mission_timer_a, ":elapsed_time"),
          (gt, ":elapsed_time", 20),
          (str_store_string, s5, "str_retreat"),
          (call_script, "script_simulate_retreat", 10, 20, 1),
        (try_end),
        (call_script, "script_count_mission_casualties_from_agents"),
        (finish_mission,0),]),

      (ti_before_mission_start, 0, 0, [],
       [
         (team_set_relation, 0, 2, 1),
         (team_set_relation, 1, 3, 1),
         (call_script, "script_place_player_banner_near_inventory_bms"),

         (party_clear, "p_routed_enemies"),

         (assign, "$g_latest_order_1", 1),
         (assign, "$g_latest_order_2", 1),
         (assign, "$g_latest_order_3", 1),
         (assign, "$g_latest_order_4", 1),
         ]),


      (0, 0, ti_once, [], [(assign,"$g_battle_won",0),
                           (assign,"$defender_reinforcement_stage",0),
                           (assign,"$attacker_reinforcement_stage",0),
                           (call_script, "script_place_player_banner_near_inventory"),
                           (call_script, "script_combat_music_set_situation_with_culture"),
                           (assign, "$g_defender_reinforcement_limit", 2),
                           ##diplomacy begin
                           #(call_script, "script_init_death_cam"),
                            (assign, "$g_dplmc_charge_when_dead", 0),
                           ##diplomacy end
                           ]),

      common_music_situation_update,
      common_battle_check_friendly_kills,

      (1, 0, 5, [

      #new (25.11.09) starts (sdsd = TODO : make a similar code to also helping ally encounters)
      #count all total (not dead) enemy soldiers (in battle area + not currently placed in battle area)
      (call_script, "script_party_count_members_with_full_health", "p_collective_enemy"),
      (assign, ":total_enemy_soldiers", reg0),

      #decrease number of agents already in battle area to find all number of reinforcement enemies
      (assign, ":enemy_soldiers_in_battle_area", 0),
      (try_for_agents,":cur_agent"),
        (agent_is_human, ":cur_agent"),
        (agent_get_party_id, ":agent_party", ":cur_agent"),
        (try_begin),
          (neq, ":agent_party", "p_main_party"),
          (neg|agent_is_ally, ":cur_agent"),
          (val_add, ":enemy_soldiers_in_battle_area", 1),
        (try_end),
      (try_end),
      (store_sub, ":total_enemy_reinforcements", ":total_enemy_soldiers", ":enemy_soldiers_in_battle_area"),

      (try_begin),
        (lt, ":total_enemy_reinforcements", 15),
        (ge, "$defender_reinforcement_stage", 2),
        (eq, "$defender_reinforcement_limit_increased", 0),
        (val_add, "$g_defender_reinforcement_limit", 1),
        (assign, "$defender_reinforcement_limit_increased", 1),
      (try_end),
      #new (25.11.09) ends






      (lt,"$defender_reinforcement_stage","$g_defender_reinforcement_limit"),
                 (store_mission_timer_a,":mission_time"),
                 (ge,":mission_time",10),
                 (store_normalized_team_count,":num_defenders", 0),
                 (lt,":num_defenders",6)],
           [(add_reinforcements_to_entry,0,7),(assign, "$defender_reinforcement_limit_increased", 0),(val_add,"$defender_reinforcement_stage",1)]),

      (1, 0, 5, [(lt,"$attacker_reinforcement_stage",2),
                 (store_mission_timer_a,":mission_time"),
                 (ge,":mission_time",10),
                 (store_normalized_team_count,":num_attackers", 1),
                 (lt,":num_attackers",6)],
           [(add_reinforcements_to_entry,3,7),(val_add,"$attacker_reinforcement_stage",1)]),

      common_battle_check_victory_condition,
      common_battle_victory_display,

      (1, 4,
      ##diplomacy begin
      0,
      ##diplomacy end
      [(main_hero_fallen)],
          [
              ##diplomacy begin
           (display_message, "@Ya ded ini", message_negative),
              (try_begin),
            #(store_trigger_param_1, ":agent_no"),
            #(call_script, "script_agent_reassign_team", ":agent_no"),
            #(eq, $enable_deahtcam, 1),
            #(eq, ":spawned", 1),
                (call_script, "script_cf_dplmc_battle_continuation"),
              (else_try),
                ##diplomacy end
                (assign, "$pin_player_fallen", 1),
                (str_store_string, s5, "str_retreat"),
                (call_script, "script_simulate_retreat", 10, 20, 1),
                (assign, "$g_battle_result", -1),
                (set_mission_result,-1),
                (call_script, "script_count_mission_casualties_from_agents"),
                (finish_mission,0),
                ##diplomacy begin
              (try_end),
              ##diplomacy end
            ]),

      common_battle_inventory,


      #AI Triggers
      (0, 0, ti_once, [
          (store_mission_timer_a,":mission_time"),(ge,":mission_time",2),
          ],
       [(call_script, "script_select_battle_tactic"),
        (call_script, "script_battle_tactic_init"),
        #(call_script, "script_battle_calculate_initial_powers"), #deciding run away method changed and that line is erased
        ]),

      (3, 0, 0, [
          (call_script, "script_apply_effect_of_other_people_on_courage_scores"),
              ], []), #calculating and applying effect of people on others courage scores

      (3, 0, 0, [
          (try_for_agents, ":agent_no"),
            (agent_is_human, ":agent_no"),
            (agent_is_alive, ":agent_no"),
            (store_mission_timer_a,":mission_time"),
            (ge,":mission_time",3),
            (call_script, "script_decide_run_away_or_not", ":agent_no", ":mission_time"),
          (try_end),
              ], []), #controlling courage score and if needed deciding to run away for each agent

      (5, 0, 0, [
          (store_mission_timer_a,":mission_time"),

          (ge,":mission_time",3),

          (call_script, "script_battle_tactic_apply"),
          ], []), #applying battle tactic

      common_battle_order_panel,
      common_battle_order_panel_tick,

    ]
    ##diplomacy begin
    + dplmc_battle_mode_triggers + dplmc_horse_cull + auxiliary_player,  #SB : horse cull
    ##diplomacy end
  ),

  (
    "village_attack_bandits",mtf_battle_mode|mtf_synch_inventory,charge,
    "You lead your men to battle.",
    [
     (3,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
     (1,mtef_team_0|mtef_use_exact_number,0,aif_start_alarmed, 7,[]),
     (1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
     ],
    [
      common_battle_tab_press,
      common_battle_init_banner,

      (ti_question_answered, 0, 0, [],
       [(store_trigger_param_1,":answer"),
        (eq,":answer",0),
        (assign, "$pin_player_fallen", 0),
        (str_store_string, s5, "str_retreat"),
        (call_script, "script_simulate_retreat", 10, 20, 1),
        (assign, "$g_battle_result", -1),
        (call_script, "script_count_mission_casualties_from_agents"),
        (finish_mission,0),]),

      (0, 0, ti_once, [], [(assign, "$g_battle_won", 0),
                           (assign, "$defender_reinforcement_stage", 0),
                           (assign, "$attacker_reinforcement_stage", 0),
                           (try_begin),
                             (eq, "$g_mt_mode", vba_after_training),
                             (add_reinforcements_to_entry, 1, 6),
                           (else_try),
                             (add_reinforcements_to_entry, 1, 29),
                           (try_end),
                           #SB : deathcam
                           (call_script, "script_init_death_cam"),
                           (call_script, "script_combat_music_set_situation_with_culture"),
                           ]),

      common_music_situation_update,
      common_battle_check_friendly_kills,
      common_battle_check_victory_condition,
      common_battle_victory_display,

      (1, 4,
      ##diplomacy begin
      0,
      ##diplomacy end
      [(main_hero_fallen)],
          [
              ##diplomacy begin
              (try_begin),
                (call_script, "script_cf_dplmc_battle_continuation"),
              (else_try),
                ##diplomacy end
                (assign, "$pin_player_fallen", 1),
                (str_store_string, s5, "str_retreat"),
                (call_script, "script_simulate_retreat", 10, 20, 1),
                (assign, "$g_battle_result", -1),
                (set_mission_result, -1),
                (call_script, "script_count_mission_casualties_from_agents"),
                (finish_mission, 0),
                ##diplomacy begin
              (try_end),
              ##diplomacy end
              ]),

      common_battle_inventory,
      common_battle_order_panel,
      common_battle_order_panel_tick,

    ]
    ##diplomacy begin
    + dplmc_battle_mode_triggers + dplmc_horse_cull + auxiliary_player  #SB : horse cull
    ##diplomacy end
  ),

silverstag bodysliding script
Code:
initialise_auxiliary_player = (ti_before_mission_start, 0, 0, 
	[],
	[
		#reset global variables
		#(display_message, "@Ya ded", message_negative),
		#(assign, "$enable_bodysliding", BODYSLIDING_ALL_TROOPS),
		(assign, "$player_has_bodyslided", 0), #variable for player party after party rebalancing
		(neq, "$enable_bodysliding", 0),  #is active player enabled?
		
		#backup player party
		(assign, "$g_move_heroes", 1),
		(party_clear, "p_temp_casualties_3"),
		(call_script, "script_party_add_party", "p_temp_casualties_3", "p_main_party"),
		(set_player_troop, "trp_player"), #just in case?
		(assign, "$bodysliding_last_troop", "trp_player"),
])

auxiliary_player_check = (5, 0, 0, 
	[
		#(display_message, "@Ya ded1", message_negative),
		#(display_message, "@Ya ded", message_negative),
		(neq, "$enable_bodysliding", 0),
		(get_player_agent_no,":agent"),
		(neg|agent_is_alive, ":agent"),
		#(display_message, "@Ya ded2", message_negative),
	],
	[
		(set_fixed_point_multiplier, 100),
		#(display_message, "@Ya ded3", message_negative),
		(get_player_agent_no, ":player_agent"),
		(agent_get_team, ":player_team", ":player_agent"),
		(agent_get_group, ":player_group", ":player_agent"),
		(agent_get_position, pos1, ":player_agent"),
		# (agent_get_division, ":player_division", ":p_agent"),
		(assign, ":spawned", 0),
		(assign, ":bodyslide_target", -1),
		(assign, ":bodyslide_agent", -1),
		(assign, ":closest_distance", 1000000),
		#(display_message, "@Ya ded4", message_negative),
		
		## CHECK FOR COMPANIONS FIRST
		(try_for_agents, ":agent_no"),
		#(display_message, "@Ya ded5", message_negative),
			(eq, ":bodyslide_target", -1),
			(agent_is_human, ":agent_no"),
			(agent_is_alive, ":agent_no"),
			(agent_get_team, ":agent_team", ":agent_no"),
			(eq, ":agent_team", ":player_team"),
			(agent_get_party_id, ":agent_party",":agent_no"),
			(eq, ":agent_party", "p_main_party"),
			(agent_get_troop_id, ":troop_no", ":agent_no"),
			(is_between, ":troop_no", companions_begin, companions_end),
			(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_player_companion),
			# Check for distance.
			(agent_get_position, pos2, ":agent_no"),
			(get_distance_between_positions_in_meters, ":distance", pos1, pos2),
			(lt, ":distance", ":closest_distance"),
			(assign, ":bodyslide_target", ":troop_no"),
			(assign, ":bodyslide_agent", ":agent_no"),
			(assign, ":closest_distance", ":distance"),
			#(display_message, "@Ya ded6", message_negative),
			
			### DIAGNOSTIC+ ###
			# (assign, reg31, ":closest_distance"),
			#(str_store_troop_name, s31, ":bodyslide_target"),
			#(display_message, "@You have assumed control of {s31} to continue the battle.", gpu_debug),
			### DIAGNOSTIC- ###
		(try_end),
		
		## IF NO COMPANION AVAILABLE, CHECK FOR ANOTHER TROOP TYPE.
		(try_begin),
		#(display_message, "@Ya ded7", message_negative),
			(eq, ":bodyslide_target", -1),
			(eq, "$enable_bodysliding", BODYSLIDING_ALL_TROOPS),
			(try_for_agents, ":agent_no"),
				(eq, ":bodyslide_target", -1),
				(agent_is_human, ":agent_no"),
				(agent_is_alive, ":agent_no"),
				(agent_get_team, ":agent_team", ":agent_no"),
				(eq, ":agent_team", ":player_team"),
				(agent_get_troop_id, ":troop_no", ":agent_no"),
				(agent_get_party_id, ":agent_party",":agent_no"),
				(eq, ":agent_party", "p_main_party"),
				# Check for distance.
				(agent_get_position, pos2, ":agent_no"),
				(get_distance_between_positions_in_meters, ":distance", pos1, pos2),
				(lt, ":distance", ":closest_distance"),
				(assign, ":bodyslide_target", ":troop_no"),
				(assign, ":bodyslide_agent", ":agent_no"),
				(assign, ":closest_distance", ":distance"),
				#(display_message, "@Ya ded8", message_negative),
				(assign, "$blok", 1),
				
				### DIAGNOSTIC+ ###
				 (assign, reg31, ":closest_distance"),
				(str_store_troop_name, s31, ":bodyslide_target"),
				#(display_message, "@You have assumed control of {s31} to continue the battle."),
				### DIAGNOSTIC- ###
			(try_end),
		(try_end),
		
		(try_begin),
		#(display_message, "@Ya ded9", message_negative),
			(ge, ":bodyslide_target", 1),
			(ge, ":bodyslide_agent", 0),
			# (eq, ":spawned", 0),
			# (agent_is_human, ":agent"),
			# (agent_is_alive, ":agent"),
			# (agent_get_team, ":agent_team", ":agent"),
			# (agent_get_party_id, ":agent_party",":agent"),
			# (eq, ":agent_party", "p_main_party"),
			# (agent_get_division, ":agent_division", ":p_agent"),
			# (agent_get_group, ":agent_group", ":p_agent"),
			# # (eq, ":player_team", ":agent_team"),
			# # (eq, ":player_division", ":agent_division"),
			# (agent_get_troop_id,":troop_id", ":agent"),
			# ##
			# (this_or_next|troop_slot_eq, ":troop_id", slot_troop_occupation, slto_player_companion),
			# ##
			# (neg|is_between, ":troop_id", active_npcs_begin, active_npcs_end), #just in case
			## Store Target Troop's Inventory
			(call_script, "script_dplmc_copy_inventory", ":bodyslide_target", BODYSLIDING_STORAGE),
			(assign, "$bodysliding_last_troop", ":bodyslide_target"),
			(set_player_troop, ":bodyslide_target"),
			(store_agent_hit_points,":hp",":bodyslide_agent",1),
			(agent_get_position, pos1, ":bodyslide_agent"),
			(position_set_z, pos1, -2000), 
			(position_set_x, pos1, 0), 
			(position_set_y, pos1, 0), 
			(agent_get_position, pos0, ":bodyslide_agent"),
			(set_spawn_position, pos0),
			(agent_get_horse, ":horse", ":bodyslide_agent"),
			(try_begin),
			#(display_message, "@Ya ded10", message_negative),
				(gt, ":horse", 0),
				(agent_set_position,":horse",pos1),
				(remove_agent, ":horse"),
				#(display_message, "@Ya ded11", message_negative),
			(try_end),
			(agent_set_position,":bodyslide_agent", pos1),
			(agent_set_slot, ":bodyslide_agent", slot_agent_possessed, 1), 
			(agent_get_slot, ":index", ":bodyslide_agent", slot_agent_index_value), #lance recruitment flag
			(remove_agent, ":bodyslide_agent"),
			(assign, "$bodyslide_spawn_block", 1),
			(spawn_agent, ":bodyslide_target"),
			(assign, "$bodyslide_spawn_block", 0),
			(assign, ":player_agent", reg0),
			(agent_set_slot, ":player_agent", slot_agent_index_value, ":index"),
			(agent_set_team, ":player_agent", ":player_team"),
			#(agent_set_division, ":player_agent", ":agent_division"),
			(agent_set_hit_points, ":player_agent" ,":hp",1),
			(agent_set_group, ":player_agent", ":player_group"),
			(agent_set_slot, ":player_agent", slot_agent_possessed, 2), 
			(agent_set_slot, ":player_agent", slot_agent_real_troop, ":bodyslide_target"),
			#(display_message, "@Ya ded12", message_negative),
			(try_begin),
			#(display_message, "@Ya ded13", message_negative),
				(agent_get_horse, ":p_horse", ":player_agent"),
				(gt, ":p_horse", 0), #player is mounted
				(lt, ":horse", 0), #AI is not mounted!
				(agent_set_position,":p_horse",pos1),
				(remove_agent, ":p_horse"),
				#(display_message, "@Ya ded14", message_negative),
			(try_end),
			(set_player_troop, "trp_player"),
			(assign, ":spawned", 1),
			#(display_message, "@Ya ded15", message_negative),
			(assign, "$player_has_bodyslided", 1), #checks that player spawned and will need to manualy correct party
		(try_end),
		#(display_message, "@Ya ded16", message_negative),
		(eq, ":bodyslide_target", -1),
		(eq, ":spawned", 0),
		#(display_message, "@Ya ded17", message_negative),
		(neq, "$cam_free", 1),
		(call_script, "script_init_death_cam"),
])

#... buch of code here ...

#aux player
auxiliary_player = [
	initialise_auxiliary_player,
	auxiliary_player_check,
]

Everytime i die my character bodysliding into my troops for a moment then either procceeding to call dplmc battle continuation script or just end the battle.
 
Personally I haven't understood very well what you want to do, activate the bodysliding of the silverstag-mod when your character dies without activating the diplomacy-mod battle continuation, or activate it without the character dies...?

Also doesn't specify the changes you've made, although at first glance I can get an idea... For now, I'm seeing a call to the script 'cf_dplmc_battle_continuation', if you intend not to activate this feature, it shouldn't be there.

EDIT: Ok, I see that for the script to be activated it is necessary to have the global 'g_dplmc_battle_continuation' to 0, which is changed in the mod menu. Forget then my second sentence, unless I have not deactivated the option in the menu...  :party:
 
Dj_FRedy said:
Personally I haven't understood very well what you want to do, activate the bodysliding of the silverstag-mod when your character dies without activating the diplomacy-mod battle continuation, or activate it without the character dies...?

Also doesn't specify the changes you've made, although at first glance I can get an idea... For now, I'm seeing a call to the script 'cf_dplmc_battle_continuation', if you intend not to activate this feature, it shouldn't be there.

EDIT: Ok, I see that for the script to be activated it is necessary to have the global 'g_dplmc_battle_continuation' to 0, which is changed in the mod menu. Forget then my second sentence, unless I have not deactivated the option in the menu...  :party:

I'm apologies for my bad english.

The things is. silverstag bodysliding script did run after my main character die on battlefield but soon after that, the game still assume my character as die and continue [(main_hero_fallen)] part in 'lead_charge' which in turn call 'cf_dplmc_battle_continuation' script or just end the battle.

EDIT: i still want to have 'cf_dplmc_battle_continuation' activated after all of my bodyslided charater dies, but couldn't figure out how?. Because in original silverstag module, the game still have battle continuation along with bodysliding script together.

EDIT2: I did as you suggest by deactivate battle continuation script, but the battle just end without bodyslided to my troops
 
I'm not sure what changes he has made. Can you please list in which files you have added the Silverstag BODYSLIDING code?

I also don't know your level of understanding of ModSys, don't get me wrong, but I would tell you to follow the trail of all constants, global variables, called scripts, troops, which adds the modification/bodyslided.
 
Dj_FRedy said:
I'm not sure what changes he has made. Can you please list in which files you have added the Silverstag BODYSLIDING code?

I also don't know your level of understanding of ModSys, don't get me wrong, but I would tell you to follow the trail of all constants, global variables, called scripts, troops, which adds the modification/bodyslided.

nah is ok! i still new to this ModSys, still many to learn after read modding and syntax guideline.

So here the list of file i add silverstag BODYSLDING code:
-module_mission_template.py
-module_constant.py
-module_script.py (give "$enabled_bodysliding", BODYSLIDING_ALL_TROOPS values by the game start)
-module_troops.py (for "trp_bodysliding_temp")

thats all! thanks for the help ! :grin: :grin:
 
Ok, only my thoughts:
In 'auxiliary_player_check'
Code:
(assign, "$blok", 1),
no idea what it's for, it may be junk code, it doesn't matter much, but there it is.

At the end of this trigger:
Code:
(neq, "$cam_free", 1),
this global belongs to the death cam of the PBoD mod added to Silverstag, if you don't use PBoD, well, delete it.

Code:
    (try_begin),
      (eq, "$g_dplmc_cam_activated", 0),
      (eq, "$enable_bodysliding", 0), #Bodysliding block
If you use Diplomacy's death cam, don't forget to add the global variable one that blocks it.

In the menu 'battle_debrief', at the beginning, I have also found reference code, have a look at it.
 
Dj_FRedy said:
Ok, only my thoughts:
In 'auxiliary_player_check'
Code:
(assign, "$blok", 1),
no idea what it's for, it may be junk code, it doesn't matter much, but there it is.

At the end of this trigger:
Code:
(neq, "$cam_free", 1),
this global belongs to the death cam of the PBoD mod added to Silverstag, if you don't use PBoD, well, delete it.

Code:
    (try_begin),
      (eq, "$g_dplmc_cam_activated", 0),
      (eq, "$enable_bodysliding", 0), #Bodysliding block
If you use Diplomacy's death cam, don't forget to add the global variable one that blocks it.

In the menu 'battle_debrief', at the beginning, I have also found reference code, have a look at it.

Ah yes i'm sorry those $blok was actually i use to test the script before, it doesn't actually work, and about the $cam_free it was suppose to be commented before since it was longer any use in newest diplomacy source i use. I was thinking about change the (call_script, "script_init_death_cam"), to call dplmc_battle_continuation script instead,

Sorry i forgot to include the 'battle_debrief' part in module_game_menus.py it was my fault
The things is, i don't even know myself what it do, but from what i can see the script in 'battle_debfrief' in module_game_menus.py was actually mean to copy player inventory from BODYSLIDING_STORAGE to "$bodysliding_last_troop". But i coudn't figure out the script on next line

module_game_menu.py
Code:
(
    "battle_debrief",mnf_scale_picture|mnf_disable_all_keys,
    "{s11}^^Your Casualties:{s8}{s10}^^Enemy Casualties:{s9}",
    "none",
    [
     (try_begin),
	   (eq, "$player_has_bodyslided", 1),
	   
	   (call_script, "script_dplmc_copy_inventory", BODYSLIDING_STORAGE, "$bodysliding_last_troop"),
	   (assign, "$bodysliding_last_troop", -1),

EDIT: It Fixed!!

thanks for your advice to add BODYSLIDING block inside dplmc_battle_continuation script, the lack of block inside dplmc_battle_continuation script turns out to be the reason why it just finish the battle or change into spectator mod after player bodyslided to their troops.

So the reason why the game procced to finish the battle or go to spectator mod was the lack of BODYSLIDING block inside dplmc_battle_continuation script and the fact that the script i call before at the end of 'auxiliary_player_check' was "script_init_death_cam" instead of "script_dplmc_battle_continuation".

Many Thanks! :grin: :grin:

EDIT2: so in other word the "script_dplmc_battle_continuation" calling part in 'lead_charge' [(main_hero_fallen)], was actually not used and if all the troops die it just continue to calculate end battle, so it safe to delete it right?
 
It was actually fine as you had it, 'init_death_cam' at the end of the trigger 'auxiliary_player_check', comment it(#) in the trigger '0, 0, ti_once,' and keep '1, 4, 0,' with 'cf_dplmc_battle_continuation'. Just make sure to comment(#) the script 'init_death_cam' in all the mission templates that you are going to use with Bodysliding as you have done in '0, 0, ti_once,'.
 
Hello fellow modders!

I did not mod for a long, long time and last time I tried, I got pretty frustrated with a simple error and I quickly stopped. I am more of a scener than a coder, but now wanted to make my own private modification in Warband. I tried to implement the Tavern Animations LSP from Slawomir into the MS of the newest Diplomacy version.

So now my problem:
After I implemented the code needed and compiled using the build_module_lav.bat I got the following error. Link to the screenshot.

Code:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... FAILED.
MODULE `mission_templates` ERROR:
Traceback (most recent call last):
  File "compile.py", line 95, in <module>
    from module_mission_templates import *
  File "C:\Users\Simon\Desktop\TAoC 2019\TAoC Source Nov19\module_mission_templates.py", line 2540
    ),
    ^
SyntaxError: invalid syntax


COMPILATION FAILED.

Script processing has ended as of 13:48:58,99
Drücken Sie eine beliebige Taste . . .

So this tells me now to go check out line 2540 in my module_mission_templates.py. The thing is, that I did not change something in this line allthough the bracket there is connected to a bracket to the code I changed.
In the instructions it said paste the new mission templates lines into the beginning of the file, so I placed them right on top of the other files I had to implement.

Code:
##dedal begin
dedal_tavern_animations = (
	ti_on_agent_spawn,1,0,[
		(eq, "$talk_context", tc_tavern_talk),
		(store_trigger_param_1,":agent"),
		(agent_get_troop_id,":troop",":agent"),
		(try_begin),
			(is_between,":troop","trp_musican_male","trp_musicans_end"),
			(try_begin),
				(agent_has_item_equipped,":agent","itm_dedal_lutnia"),
				(agent_set_stand_animation, ":agent", "anim_lute_sitting"),
				(agent_set_animation, ":agent", "anim_lute_sitting"),
				(agent_play_sound,":agent","snd_dedal_tavern_lute"),
			(else_try),
				(agent_has_item_equipped,":agent","itm_dedal_lira"),
				(agent_set_stand_animation, ":agent", "anim_lyre_sitting"),
				(agent_set_animation, ":agent", "anim_lyre_sitting"),
				(agent_play_sound,":agent","snd_dedal_tavern_lyre"),
			(try_end),
			(store_random_in_range,":r",0,300),
			(agent_set_animation_progress,":agent",":r"),
		(else_try),
			(is_between,":troop",tavern_minstrels_begin,tavern_minstrels_end),
			(try_begin),
				(agent_has_item_equipped,":agent","itm_dedal_lutnia"),
				(agent_set_stand_animation, ":agent", "anim_lute_standing"),
				(agent_set_animation, ":agent", "anim_lute_standing"),
				(agent_play_sound,":agent","snd_dedal_tavern_lute"),
			(else_try),
				(agent_has_item_equipped,":agent","itm_dedal_lira"),
				(agent_set_stand_animation, ":agent", "anim_lyre_standing"),
				(agent_set_animation, ":agent", "anim_lyre_standing"),
				(agent_play_sound,":agent","snd_dedal_tavern_lyre"),
			(try_end),
			(store_random_in_range,":r",0,300),
			(agent_set_animation_progress,":agent",":r"),
		(else_try),
			(is_between,":troop",walkers_begin,walkers_end),
			(try_begin),
				(agent_has_item_equipped,":agent","itm_dedal_kufel"),
				(agent_set_stand_animation, ":agent", "anim_sitting_drinking_low"),
				(agent_set_animation, ":agent", "anim_sitting_drinking_low"),
				(store_random_in_range,":r",0,300),
			(else_try),
				(agent_set_stand_animation, ":agent", "anim_sitting_low"),
				(agent_set_animation, ":agent", "anim_sitting_low"),
				(store_random_in_range,":r",0,300),
			(try_end),
			(agent_set_animation_progress,":agent",":r"),
		(try_end),
	],[])
##dedal end
mission_templates = [
  (
	("town_default",0,-1,
	 "Default town visit",[
		(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,pilgrim_disguise),
		(1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(2,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(3,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(4,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(5,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(6,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(7,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
		(8,mtef_scene_source,af_override_horse,0,1,[]),
		(9,mtef_scene_source,af_override_horse,0,1,[]),
		(10,mtef_scene_source,af_override_horse,0,1,[]),
		(11,mtef_scene_source,af_override_horse,0,1,[]),
		(12,mtef_scene_source,af_override_horse,0,1,[]),
		(13,mtef_scene_source,0,0,1,[]),
		(14,mtef_scene_source,0,0,1,[]),
		(15,mtef_scene_source,0,0,1,[]),
		(16,mtef_visitor_source,af_override_horse,0,1,[]),
		(17,mtef_visitor_source,af_override_horse,0,1,[]),
		(18,mtef_visitor_source,af_override_horse,0,1,[]),
		(19,mtef_visitor_source,af_override_horse,0,1,[]),
		(20,mtef_visitor_source,af_override_horse,0,1,[]),
		(21,mtef_visitor_source,af_override_horse,0,1,[]),
		(22,mtef_visitor_source,af_override_horse,0,1,[]),
		(23,mtef_visitor_source,af_override_horse,0,1,[]),
		(24,mtef_visitor_source,af_override_horse,0,1,[]),
		(25,mtef_visitor_source,af_override_horse,0,1,[]),
		(26,mtef_visitor_source,af_override_horse,0,1,[]),
		(27,mtef_visitor_source,af_override_horse,0,1,[]),
		(28,mtef_visitor_source,af_override_horse,0,1,[]),
		(29,mtef_visitor_source,af_override_horse,0,1,[]),
		(30,mtef_visitor_source,af_override_horse,0,1,[]),
		(31,mtef_visitor_source,af_override_horse,0,1,[]),
		
		#dedal begin
		(1,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#32
		(2,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#33
		(3,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#34
		(4,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#35
		(5,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#36
		(6,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#37
		(7,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#38
		(8,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#39
		(10,mtef_visitor_source,af_override_horse|af_override_gloves,0,1,[]),#40
	 ],[
		dedal_tavern_animations,
#dedal end
	
     [
      (1, 0, ti_once, [],
      [
        (store_current_scene, ":cur_scene"),
        (scene_set_slot, ":cur_scene", slot_scene_visited, 1),
        (try_begin),
          (gt, "$sneaked_into_town", disguise_none),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town_infiltrate),
        (else_try),
          (eq, "$talk_context", tc_tavern_talk),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_tavern),
        (else_try),
          (call_script, "script_music_set_situation_with_culture", mtf_sit_town),
        (try_end),
      ]),

      (ti_before_mission_start, 0, 0, [],
      [
        (call_script, "script_change_banners_and_chest"),
        (call_script, "script_initialize_tavern_variables"),
      ]),
      
      #SB : minstrels equip instruments
      (ti_on_agent_spawn, 0, 0,
        [
          (eq, "$talk_context", tc_tavern_talk),
          (store_trigger_param_1, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (is_between, ":troop_no", tavern_minstrels_begin, tavern_minstrels_end),
          (this_or_next|troop_slot_eq, ":troop_no", slot_troop_cur_center, "$current_town"),
          (party_slot_eq, "$current_town", slot_center_tavern_minstrel, ":troop_no"),
        ],
        #this only works for the "true" minstrel, last condition prohibits the one added from alternative_town in module_game_menus
        [
          (store_trigger_param_1, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (assign, ":item_no", -1),
          
          (store_item_kind_count, ":item_count", "itm_lyre", ":troop_no"),
          (try_begin),
            (this_or_next|gt, ":item_count", 0),
            (troop_has_item_equipped, ":troop_no", "itm_lyre"),
            (assign, ":item_no", "itm_lyre"),
          (else_try),
            (store_item_kind_count, ":item_count", "itm_lute", ":troop_no"),
            (this_or_next|gt, ":item_count", 0),
            (troop_has_item_equipped, ":troop_no", "itm_lute"),
            (assign, ":item_no", "itm_lute"),
          (try_end),
          (neq, ":item_no", -1),
          (agent_equip_item, ":agent_no", ":item_no"), #equip instrument
          (agent_set_wielded_item, ":agent_no", -1), #doff it
        ]),

      (ti_inventory_key_pressed, 0, 0,
      [ #SB : disable inventory while attacked in taverns
        (try_begin),
          (this_or_next|eq, "$g_main_attacker_agent", 0),
          (neq, "$talk_context", tc_tavern_talk),
          (set_trigger_result, 1),
        (else_try),
          (display_message, "@Dispatch your opponents first!"),
        (try_end),
      ], []),

      #tavern - belligerent drunk leaving/fading out
      (1, 0, 0,
      [
        (gt, "$g_belligerent_drunk_leaving", 0),
        (entry_point_get_position, pos0, 0),
        (agent_get_position, pos1, "$g_belligerent_drunk_leaving"),
        (get_distance_between_positions, ":dist", pos0, pos1),
        (le, ":dist", 150),
      ],
      [
        (agent_fade_out, "$g_belligerent_drunk_leaving"),
        (assign, "$g_belligerent_drunk_leaving", 0),
      ]),

      (ti_tab_pressed, 0, 0,
      [
        (try_begin),
          (eq, "$g_main_attacker_agent", 0),
          (set_trigger_result, 1),
        (else_try),
          (display_message, "str_cannot_leave_now"), #SB : message
        (try_end),
      ], []),

	  #tavern brawl triggers - drunk
      (2, 0, 0,
      [
	    (neg|conversation_screen_is_active),

		(eq, "$talk_context", tc_tavern_talk),

		(neg|troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),
		(troop_slot_eq, "trp_belligerent_drunk", slot_troop_cur_center, "$g_encountered_party"),
		(eq, "$drunks_dont_pick_fights", 0),
	  ],
	  [
	    (try_begin),
	      (eq, "$g_start_belligerent_drunk_fight", 0),
	      (assign, "$g_start_belligerent_drunk_fight", 1),

	      (try_for_agents, ":cur_agent"),
	        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
	        (eq, ":cur_agent_troop", "trp_belligerent_drunk"),
	        (assign, "$g_belligerent_drunk", ":cur_agent"),
	      (try_end),
	    (else_try),
	      (eq, "$g_start_belligerent_drunk_fight", 1),

	      (agent_is_active, "$g_belligerent_drunk"),
	      (agent_is_alive, "$g_belligerent_drunk"),
	      (get_player_agent_no, ":player_agent"),
	      (agent_get_position, pos0, ":player_agent"),
	      (agent_get_position, pos1, "$g_belligerent_drunk"),
	      (get_distance_between_positions, ":dist", pos0, pos1),
	      (position_get_z, ":pos0_z", pos0),
	      (position_get_z, ":pos1_z", pos1),
	      (store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
	      (try_begin),
	        (le, ":z_difference", 0),
	        (val_mul, ":z_difference", -1),
	      (try_end),
	      (store_mul, ":z_difference_mul_3", ":z_difference", 3),
	      (val_add, ":dist", ":z_difference_mul_3"),
	      (store_random_in_range, ":random_value", 0, 200),
	      (store_add, ":400_plus_random_200", 400, ":random_value"),
	      (le, ":dist", ":400_plus_random_200"),

 		  (call_script, "script_activate_tavern_attackers"),
  		  (start_mission_conversation, "trp_belligerent_drunk"),
  		  (assign, "$g_start_belligerent_drunk_fight", 2),
	    (try_end),
	  ]),

	  #tavern brawl triggers - assassin
      (2, 0, 0, [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(troop_slot_eq, "trp_hired_assassin", slot_troop_cur_center, "$g_encountered_party"),
	  ],
	  [
	    (try_begin),
	      (eq, "$g_start_hired_assassin_fight", 0),
	      (assign, "$g_start_hired_assassin_fight", 1),

	      (try_for_agents, ":cur_agent"),
	        (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
	        (eq, ":cur_agent_troop", "trp_hired_assassin"),
	        (assign, "$g_hired_assassin", ":cur_agent"),
	      (try_end),
	    (else_try),
	      (eq, "$g_start_hired_assassin_fight", 1),

	      (agent_is_active, "$g_hired_assassin"),
	      (agent_is_alive, "$g_hired_assassin"),
	      (get_player_agent_no, ":player_agent"),
	      (agent_get_position, pos0, ":player_agent"),
	      (agent_get_position, pos1, "$g_hired_assassin"),
	      (get_distance_between_positions, ":dist", pos0, pos1),
	      (position_get_z, ":pos0_z", pos0),
	      (position_get_z, ":pos1_z", pos1),
	      (store_sub, ":z_difference", ":pos1_z", ":pos0_z"),
	      (try_begin),
	        (le, ":z_difference", 0),
	        (val_mul, ":z_difference", -1),
	      (try_end),
	      (store_mul, ":z_difference_mul_3", ":z_difference", 3),
	      (val_add, ":dist", ":z_difference_mul_3"),
	      (store_random_in_range, ":random_value", 0, 200),
	      (store_add, ":400_plus_random_200", 400, ":random_value"),
	      (le, ":dist", ":400_plus_random_200"),

		  (call_script, "script_activate_tavern_attackers"),
		  (assign, "$g_start_hired_assassin_fight", 2),
		(try_end),
	  ]),

	  #Aftermath talks
      (3, 0, ti_once,
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),

		(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
		(agent_is_wounded, "$g_main_attacker_agent"),
      ],
      [
        (mission_enable_talk),

		(try_for_agents, ":agent"),
		  (agent_is_alive, ":agent"),
		  (agent_get_position, pos4, ":agent"),
		  (agent_set_scripted_destination, ":agent", pos4),
		(try_end),

		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),
	  ]),


	  #Aftermath talks
      (3, 0, ti_once,
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
		(main_hero_fallen),
      ],
      [
	  (jump_to_menu, "mnu_lost_tavern_duel"),
	  (finish_mission,0)

	  ]),


	  #No shooting in the tavern
      (1, 0, 0,
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),

		(get_player_agent_no, ":player_agent"),
		(agent_is_alive, ":player_agent"),
		## SB : move diplomacy standing check back up here in conditions
		(call_script, "script_dplmc_get_troop_standing_in_faction", "trp_player", "$g_encountered_party_faction"),
		(lt, reg0, DPLMC_FACTION_STANDING_MEMBER),
		(agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
		(gt, ":wielded_item", 0),
		(item_get_type, ":type", ":wielded_item"),
		(this_or_next|is_between, ":type", itp_type_bow, itp_type_goods),
		(is_between, ":type", itp_type_pistol, itp_type_bullets),
		# (is_between, ":wielded_item", "itm_darts", "itm_torch"),
		# (neq, ":wielded_item", "itm_javelin_melee"),
		# (neq, ":wielded_item", "itm_throwing_spear_melee"),
		# (neq, ":wielded_item", "itm_jarid_melee"),
		# (neq, ":wielded_item", "itm_light_throwing_axes_melee"),
		# (neq, ":wielded_item", "itm_throwing_axes_melee"),
		# (neq, ":wielded_item", "itm_heavy_throwing_axes_melee"),
        #SB : also add these conditions
        
      ],
      [
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		# ##diplomacy start+
		# #Turn of this !@#$%ing obnoxious and totally illogical restriction provided:
		# (try_begin),
			# #1) there is an actual fight
			# (gt, "$g_main_attacker_agent", 0),
			# (agent_is_alive, "$g_main_attacker_agent"),
			# (neg|agent_is_wounded, "$g_main_attacker_agent"),
			# #2) the player is the lord of this town, a mercenary captain in the kingdom's employ, or ruler of this kingdom
			# (store_faction_of_party , ":center_faction", "$g_encountered_party"),
			# (this_or_next|eq, ":center_faction", "$players_kingdom"),
				# (eq, ":center_faction", "fac_player_supporters_faction"),
		# (else_try),
		# #Else, original behavior:
			(start_mission_conversation, ":tavernkeeper"),
		# (try_end),
		##diplomacy stop+
	  ]),

      #SB : drunks are totally effective fighters
      (3, 0, 0,
      [
       (eq, "$talk_context", tc_tavern_talk),
       (ge, "$g_start_belligerent_drunk_fight", 1),
       (gt, "$g_main_attacker_agent", 0),
       (agent_is_alive, "$g_main_attacker_agent"),
       # (eq, "$g_belligerent_drunk_leaving", 0), #don't stumble while leaving
       (store_random_in_range, ":random_no", 0, 3),
       (eq, ":random_no", 0),
       ],
      [
      # (store_random_in_range, ":anim", "anim_strike_chest_front_stop", "anim_cheer"),
      (store_random_in_range, ":anim", "anim_strike3_head_left", "anim_fall_face_hold"),
      (agent_set_animation, "$g_main_attacker_agent", ":anim"),
      (store_random_in_range, ":progress", 0, 100),
      (agent_set_animation_progress, "$g_main_attacker_agent", ":progress"),
      ]),
      #Check for weapon in hand of attacker, also, everyone gets out of the way
      (1, 0, 0,
      [
        (gt, "$g_main_attacker_agent", 0),
      ],
      [
        (agent_get_wielded_item, ":wielded_item", "$g_main_attacker_agent", 0),
        (val_max, "$g_attacker_drawn_weapon", ":wielded_item"),

        (call_script, "script_neutral_behavior_in_fight"),
      ]),
    ],
  ),

I did not change any code besides the one I marked with ##dedal begin and ##dedal end. The last bracket seems to be the one with the mistake. It is connected to this part:

Code:
	("town_default",0,-1,
	 "Default town visit",[
To be exact it is connected to the ("town_default" for me this is in line 2194 and ends in 2540.

I sadly do not know how to fix this error. Might anyone of you have an idea? Or if I placed the first code wrong (I guess it is the trigger), do you know where to properly place it? Due to only the information "just put it somewhere at the beginning of the file" I did not really have an idea if the beginning is the first 50 lines of code or the first 2500 lines of code.

If you need more information I am happy to hand it out.

Thank you for your help!
 
simple put you have a syntax error that is breaking the entire file, so Python cant even read it into memory. You will need to review your changes and fix it. Its not a MBScript error, its a Python error.

you can start by deleting your changes and doing them again in small parts, saving, testing, saving, testing ... instead of all at once. When something breaks you fix that small part.
 
Don't get frustrated, you've just added an extra pair of brackets/parenthesis.

mission_templates = [
( <---
("town_default",0,-1,


[
dedal_tavern_animations,
#dedal end

    [ <---
 
kalarhan said:
simple put you have a syntax error that is breaking the entire file, so Python cant even read it into memory. You will need to review your changes and fix it. Its not a MBScript error, its a Python error.

you can start by deleting your changes and doing them again in small parts, saving, testing, saving, testing ... instead of all at once. When something breaks you fix that small part.

Dj_FRedy said:
Don't get frustrated, you've just added an extra pair of brackets/parenthesis.

mission_templates = [
( <---
("town_default",0,-1,


[
dedal_tavern_animations,
#dedal end

    [ <---

Thank you guys! The brackets were the problem!  :party: :smile:
 
Many party banners (world map) are horizontal, whereas the image on them is vertical. This doesn't look very good. So I was thinking of changing said banner shape to be better aligned with the image. How do I go about it? :neutral:
(please tell me the exact file I need to edit for this, don't just give me a code snippet)
Thank you.
 
You can edit the textures. A quick search to the folder: ..\MountBlade Warband\Textures.. banner_a.dds, banner_b.dds, banner_c.dds ...etc.
In 'materials.brf' are the materials, 'map_flags.brf' to see the results. A video with a method which you can follow:
https://www.youtube.com/watch?v=TNB4S5csgPs
more videos in case you get lost
https://www.youtube.com/watch?v=ZNlnyXJDtmw
https://www.youtube.com/watch?v=o23_-ofwGSs
a tuto that can serve you
https://forums.taleworlds.com/index.php/topic,58725.msg1518020.html#msg1518020
https://www.moddb.com/games/mount-blade-warband/tutorials/creating-and-adding-banners
more stuff
https://steamcommunity.com/sharedfiles/filedetails/?id=517287121
https://www.youtube.com/watch?v=snmyHj_wNl4
 
Dj_FRedy said:
You can edit the textures. A quick search to the folder: ..\MountBlade Warband\Textures.. banner_a.dds, banner_b.dds, banner_c.dds ...etc.
In 'materials.brf' are the materials, 'map_flags.brf' to see the results. A video with a method which you can follow:
https://www.youtube.com/watch?v=TNB4S5csgPs
more videos in case you get lost
https://www.youtube.com/watch?v=ZNlnyXJDtmw
https://www.youtube.com/watch?v=o23_-ofwGSs
a tuto that can serve you
https://forums.taleworlds.com/index.php/topic,58725.msg1518020.html#msg1518020
https://www.moddb.com/games/mount-blade-warband/tutorials/creating-and-adding-banners
more stuff
https://steamcommunity.com/sharedfiles/filedetails/?id=517287121
https://www.youtube.com/watch?v=snmyHj_wNl4
I know how to edit the textures, thank you, but it will hardly solve the issue: they modified textures will be aligned with some banner shapes, but will will be misalligned with others.
 
The other solution is to change the mesh of the banners to something more convenient, like this:
mb3.2.jpg


Check the following posts:
Better Banners Mod
Mount & Blade Banner and Flag Standardization Pack v2.01

To save to favorites: Mount&Blade Repository

 
Hey guys, I have a weird issue. Not a problem, but yeah, I want to figure it out. So, I implemented a "knocked-off horse" trigger, intended for lead charge mission template. It works, exactly as intended, meaning that when you deal a certain amount of damage or more to a mounted agent, the trigger activates and it knocks the agent of his horse. It works flawlessly.
But each time the trigger is activated, it produces a script error on opcode, Invalid Party ID -1, Lino no. 10.
Any ideas? Thanks!

Code:
#KNOCK OFF HORSE	
common_horse_fall =  (
         ti_on_agent_hit, 0, 0,
       [
        (store_trigger_param_1,":whogothit"),
		(store_trigger_param_3,":damagedone"),
		(store_random_in_range,":randnum",0,100),
      
      #Change/modify these to change your chances of beinh dehorsed, my percentage is twice the damage dealt.
		(val_sub,":randnum",":damagedone"),
		(val_sub,":randnum",":damagedone"),
      
      
		(store_agent_hit_points,":manhp",":whogothit"),
		(try_begin), # Knocked off horses script, base by Gaunt
   
			(ge, ":damagedone", 15), # Minimum damage needed
			(store_agent_hit_points,":hp",":whogothit"),
			(val_sub, ":hp", ":damagedone"),
			(ge, ":hp", 1), # So it dosn't run when it's not needed (agent dies anyway)

			(agent_is_human,":whogothit"),
	 
			(store_random_in_range,":chance",0,60), # Decrease this number (60) for higher chances of knocking riders off (and vice-versa).
			(ge,":chance", ":damagedone"), # If damage dealt is over or equal to the ":chance" number, knock-off occurs.
	 
			(agent_get_horse,":horse",":whogothit"),
			(neq,":horse",-1),
			(agent_get_item_id,":horsetype", ":horse"),
			(neq,":horsetype",-1),
			(agent_get_position,pos1,":horse"),
			#(agent_get_speed, pos2, ":horse"),
			(store_agent_hit_points,":horsehp",":horse"),
			(entry_point_get_position, pos3, 0),
			(agent_set_position,":horse",pos3),
			(remove_agent, ":horse"),
     
			(set_spawn_position, pos1),
			(spawn_horse,":horsetype",0),
			(agent_start_running_away, reg0),
			#(agent_set_horse_speed_factor, reg0, 100), #I don't think this works but it isn't necessary. <- Only changes max speed of the horse
			(agent_set_hit_points,reg0,":horsehp"),

		(try_end),
         
      ], [])	

#KNOCK OFF HORSE
 
Status
Not open for further replies.
Back
Top Bottom