Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I'm not sure how you put it into module_mission_templates, but to be clear, it should be put in somewhere ABOVE "mission_templates = ["

I'll try to make it clearer what I'm suggesting with examples. Before any changes, you may have this:

tournament_triggers = [
  (ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest"),
                                      (assign, "$g_arena_training_num_agents_spawned", 0)]),
  (ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_arena")], []),
  (ti_tab_pressed, 0, 0, [],
  [(try_begin),
      (eq, "$g_mt_mode", abm_visit),
      (set_trigger_result, 1),
    (else_try),
      (question_box,"str_give_up_fight"),
    (try_end),
    ]),
  (ti_question_answered, 0, 0, [],
  [(store_trigger_param_1,":answer"),
    (eq,":answer",0),
    (try_begin),
      (eq, "$g_mt_mode", abm_tournament),
      (call_script, "script_end_tournament_fight", 0),
    (else_try),
      (eq, "$g_mt_mode", abm_training),
      (get_player_agent_no, ":player_agent"),
      (agent_get_kill_count, "$g_arena_training_kills", ":player_agent", 1),#use this for conversation
    (try_end),
    (finish_mission,0),
    ]),

  (1, 0, ti_once, [], [
      (eq, "$g_mt_mode", abm_visit),
      (call_script, "script_music_set_situation_with_culture", mtf_sit_travel),
      (store_current_scene, reg(1)),
      (scene_set_slot, reg(1), slot_scene_visited, 1),
      (mission_enable_talk),
      (get_player_agent_no, ":player_agent"),
      (assign, ":team_set", 0),
      (try_for_agents, ":agent_no"),
        (neq, ":agent_no", ":player_agent"),
        (agent_get_troop_id, ":troop_id", ":agent_no"),
        (is_between, ":troop_id", regular_troops_begin, regular_troops_end),
        (eq, ":team_set", 0),
        (agent_set_team, ":agent_no", 1),
        (assign, ":team_set", 1),
      (try_end),
    ]),
##
##  (0, 0, 0, [],
##  [
##      #refresh hit points for arena visit trainers
##      (eq, "$g_mt_mode", abm_visit),
##      (get_player_agent_no, ":player_agent"),
##      (try_for_agents, ":agent_no"),
##        (neq, ":agent_no", ":player_agent"),
##        (agent_get_troop_id, ":troop_id", ":agent_no"),
##        (is_between, ":troop_id", regular_troops_begin, regular_troops_end),
##        (agent_set_hit_points, ":agent_no", 100),
##      (try_end),
##    ]),
 
##      (1, 4, ti_once, [(eq, "$g_mt_mode", abm_fight),
##                      (this_or_next|main_hero_fallen),
##                      (num_active_teams_le,1)],
##      [
##          (try_begin),
##            (num_active_teams_le,1),
##            (neg|main_hero_fallen),
##            (assign,"$arena_fight_won",1),
##            #Fight won, decrease odds
##            (assign, ":player_odds_sub", 0),
##            (try_begin),
##              (ge,"$arena_bet_amount",1),
##              (store_div, ":player_odds_sub", "$arena_win_amount", 2),
##            (try_end),
##            (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
##            (val_add, ":player_odds_sub", 5),
##            (val_sub, ":player_odds", ":player_odds_sub"),
##            (val_max, ":player_odds", 250),
##            (party_set_slot, "$g_encountered_party", slot_town_player_odds, ":player_odds"),
##          (else_try),
##            #Fight lost, increase odds
##            (assign, ":player_odds_add", 0),
##            (try_begin),
##              (ge,"$arena_bet_amount",1),
##              (store_div, ":player_odds_add", "$arena_win_amount", 2),
##            (try_end),
##            (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
##            (val_add, ":player_odds_add", 5),
##            (val_add, ":player_odds", ":player_odds_add"),
##            (val_min, ":player_odds", 4000),
##            (party_set_slot, "$g_encountered_party", slot_town_player_odds, ":player_odds"),
##          (try_end),
##          (store_remaining_team_no,"$arena_winner_team"),
##          (assign, "$g_mt_mode", abm_visit),
##          (party_get_slot, ":arena_mission_template", "$current_town", slot_town_arena_template),
##          (set_jump_mission, ":arena_mission_template"),
##          (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
##          (modify_visitors_at_site, ":arena_scene"),
##          (reset_visitors),
##          (set_visitor, 35, "trp_veteran_fighter"),
##          (set_visitor, 36, "trp_hired_blade"),
##          (set_jump_entry, 50),
##          (jump_to_scene, ":arena_scene"),
##          ]),
 
  (0, 0, ti_once, [],
  [
    (eq, "$g_mt_mode", abm_tournament),
    (play_sound, "snd_arena_ambiance", sf_looping),
    (call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
    ]),

  (1, 4, ti_once, [(eq, "$g_mt_mode", abm_tournament),
                  (this_or_next|main_hero_fallen),
                  (num_active_teams_le, 1)],
  [
      (try_begin),
        (neg|main_hero_fallen),
        (call_script, "script_end_tournament_fight", 1),
        (call_script, "script_play_victorious_sound"),
        (finish_mission),
      (else_try),
        (call_script, "script_end_tournament_fight", 0),
        (finish_mission),
      (try_end),
      ]),

  (ti_battle_window_opened, 0, 0, [], [(eq, "$g_mt_mode", abm_training),(start_presentation, "prsnt_arena_training")]),
 
  (0, 0, ti_once, [], [(eq, "$g_mt_mode", abm_training),
                      (assign, "$g_arena_training_max_opponents", 40),
                      (assign, "$g_arena_training_num_agents_spawned", 0),
                      (assign, "$g_arena_training_kills", 0),
                      (assign, "$g_arena_training_won", 0),
                      (call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
                      ]),

  (1, 4, ti_once, [(eq, "$g_mt_mode", abm_training),
                  (store_mission_timer_a, ":cur_time"),
                  (gt, ":cur_time", 3),
                  (assign, ":win_cond", 0),
                  (try_begin),
                    (ge, "$g_arena_training_num_agents_spawned", "$g_arena_training_max_opponents"),#spawn at most 40 agents
                    (num_active_teams_le, 1),
                    (assign, ":win_cond", 1),
                  (try_end),
                  (this_or_next|eq, ":win_cond", 1),
                  (main_hero_fallen)],
  [
      (get_player_agent_no, ":player_agent"),
      (agent_get_kill_count, "$g_arena_training_kills", ":player_agent", 1),#use this for conversation
      (assign, "$g_arena_training_won", 0),
      (try_begin),
        (neg|main_hero_fallen),
        (assign, "$g_arena_training_won", 1),#use this for conversation
      (try_end),
      (assign, "$g_mt_mode", abm_visit),
      (set_jump_mission, "mt_arena_melee_fight"),
      (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
      (modify_visitors_at_site, ":arena_scene"),
      (reset_visitors),
      (set_visitor, 35, "trp_veteran_fighter"),
      (set_visitor, 36, "trp_hired_blade"),
      (set_jump_entry, 50),
      (jump_to_scene, ":arena_scene"),
      ]),


  (0.2, 0, 0,
  [
      (eq, "$g_mt_mode", abm_training),
      (assign, ":num_active_fighters", 0),
      (try_for_agents, ":agent_no"),
        (agent_is_human, ":agent_no"),
        (agent_is_alive, ":agent_no"),
        (agent_get_team, ":team_no", ":agent_no"),
        (is_between, ":team_no", 0 ,7),
        (val_add, ":num_active_fighters", 1),
      (try_end),
      (lt, ":num_active_fighters", 7),
      (neg|main_hero_fallen),
      (store_mission_timer_a, ":cur_time"),
      (this_or_next|ge, ":cur_time", "$g_arena_training_next_spawn_time"),
      (this_or_next|lt, "$g_arena_training_num_agents_spawned", 6),
      (num_active_teams_le, 1),
      (lt, "$g_arena_training_num_agents_spawned", "$g_arena_training_max_opponents"),
      ],
    [
      (assign, ":added_troop", "$g_arena_training_num_agents_spawned"),
      (store_div,  ":added_troop", "$g_arena_training_num_agents_spawned", 6),
      (assign, ":added_troop_sequence", "$g_arena_training_num_agents_spawned"),
      (val_mod, ":added_troop_sequence", 6),
      (val_add, ":added_troop", ":added_troop_sequence"),
      (val_min, ":added_troop", 9),
      (val_add, ":added_troop", "trp_arena_training_fighter_1"),
      (assign, ":end_cond", 10000),
      (get_player_agent_no, ":player_agent"),
      (agent_get_position, pos5, ":player_agent"),
      (try_for_range, ":unused", 0, ":end_cond"),
        (store_random_in_range, ":random_entry_point", 32, 40),
        (neq, ":random_entry_point", "$g_player_entry_point"), # make sure we don't overwrite player
        (entry_point_get_position, pos1, ":random_entry_point"),
        (get_distance_between_positions, ":dist", pos5, pos1),
        (gt, ":dist", 1200), #must be at least 12 meters away from the player
        (assign, ":end_cond", 0),
      (try_end),
      (add_visitors_to_current_scene, ":random_entry_point", ":added_troop", 1),
      (store_add, ":new_spawned_count", "$g_arena_training_num_agents_spawned", 1),
      (store_mission_timer_a, ":cur_time"),
      (store_add, "$g_arena_training_next_spawn_time", ":cur_time", 14),
      (store_div, ":time_reduction", ":new_spawned_count", 3),
      (val_sub, "$g_arena_training_next_spawn_time", ":time_reduction"),
      ]),

  (0, 0, 0,
  [
      (eq, "$g_mt_mode", abm_training)
      ],
    [
      (assign, ":max_teams", 6),
      (val_max, ":max_teams", 1),
      (get_player_agent_no, ":player_agent"),
      (try_for_agents, ":agent_no"),
        (agent_is_human, ":agent_no"),
        (agent_is_alive, ":agent_no"),
        (agent_slot_eq, ":agent_no", slot_agent_arena_team_set, 0),
        (agent_get_team, ":team_no", ":agent_no"),
        (is_between, ":team_no", 0 ,7),
        (try_begin),
          (eq, ":agent_no", ":player_agent"),
          (agent_set_team, ":agent_no", 6), #player is always team 6.
        (else_try),
          (store_random_in_range, ":selected_team", 0, ":max_teams"),
          # find strongest team
          (try_for_range, ":t", 0, 6),
            (troop_set_slot, "trp_temp_array_a", ":t", 0),
          (try_end),
          (try_for_agents, ":eek:ther_agent_no"),
            (agent_is_human, ":eek:ther_agent_no"),
            (agent_is_alive, ":eek:ther_agent_no"),
            (neq, ":agent_no", ":player_agent"),
            (agent_slot_eq, ":eek:ther_agent_no", slot_agent_arena_team_set, 1),
            (agent_get_team, ":eek:ther_agent_team", ":eek:ther_agent_no"),
            (troop_get_slot, ":count", "trp_temp_array_a", ":eek:ther_agent_team"),
            (val_add, ":count", 1),
            (troop_set_slot, "trp_temp_array_a", ":eek:ther_agent_team", ":count"),
          (try_end),
          (assign, ":strongest_team", 0),
          (troop_get_slot, ":strongest_team_count", "trp_temp_array_a", 0),
          (try_for_range, ":t", 1, 6),
            (troop_slot_ge, "trp_temp_array_a", ":t", ":strongest_team_count"),
            (troop_get_slot, ":strongest_team_count", "trp_temp_array_a", ":t"),
            (assign, ":strongest_team", ":t"),
          (try_end),
          (store_random_in_range, ":rand", 5, 100),
          (try_begin),
            (lt, ":rand", "$g_arena_training_num_agents_spawned"),
            (assign, ":selected_team", ":strongest_team"),
          (try_end),
          (agent_set_team, ":agent_no", ":selected_team"),
        (try_end),
        (agent_set_slot, ":agent_no", slot_agent_arena_team_set, 1),
        (try_begin),
          (neq, ":agent_no", ":player_agent"),
          (val_add, "$g_arena_training_num_agents_spawned", 1),
        (try_end),
      (try_end),
      ]),
  ]

mission_templates = [

Then after, you could have this (changes in red):

tournament_triggers = [
  (ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest"),
                                      (assign, "$g_arena_training_num_agents_spawned", 0)]),
  (ti_inventory_key_pressed, 0, 0, [(display_message,"str_cant_use_inventory_arena")], []),
  (ti_tab_pressed, 0, 0, [],
  [(try_begin),
      (eq, "$g_mt_mode", abm_visit),
      (set_trigger_result, 1),
    (else_try),
      (question_box,"str_give_up_fight"),
    (try_end),
    ]),
  (ti_question_answered, 0, 0, [],
  [(store_trigger_param_1,":answer"),
    (eq,":answer",0),
    (try_begin),
      (eq, "$g_mt_mode", abm_tournament),
      (call_script, "script_end_tournament_fight", 0),
    (else_try),
      (eq, "$g_mt_mode", abm_training),
      (get_player_agent_no, ":player_agent"),
      (agent_get_kill_count, "$g_arena_training_kills", ":player_agent", 1),#use this for conversation
    (try_end),
    (finish_mission,0),
    ]),

  (1, 0, ti_once, [], [
      (eq, "$g_mt_mode", abm_visit),
      (call_script, "script_music_set_situation_with_culture", mtf_sit_travel),
      (store_current_scene, reg(1)),
      (scene_set_slot, reg(1), slot_scene_visited, 1),
      (mission_enable_talk),
      (get_player_agent_no, ":player_agent"),
      (assign, ":team_set", 0),
      (try_for_agents, ":agent_no"),
        (neq, ":agent_no", ":player_agent"),
        (agent_get_troop_id, ":troop_id", ":agent_no"),
        (is_between, ":troop_id", regular_troops_begin, regular_troops_end),
        (eq, ":team_set", 0),
        (agent_set_team, ":agent_no", 1),
        (assign, ":team_set", 1),
      (try_end),
    ]),
##
##  (0, 0, 0, [],
##  [
##      #refresh hit points for arena visit trainers
##      (eq, "$g_mt_mode", abm_visit),
##      (get_player_agent_no, ":player_agent"),
##      (try_for_agents, ":agent_no"),
##        (neq, ":agent_no", ":player_agent"),
##        (agent_get_troop_id, ":troop_id", ":agent_no"),
##        (is_between, ":troop_id", regular_troops_begin, regular_troops_end),
##        (agent_set_hit_points, ":agent_no", 100),
##      (try_end),
##    ]),
 
##      (1, 4, ti_once, [(eq, "$g_mt_mode", abm_fight),
##                      (this_or_next|main_hero_fallen),
##                      (num_active_teams_le,1)],
##      [
##          (try_begin),
##            (num_active_teams_le,1),
##            (neg|main_hero_fallen),
##            (assign,"$arena_fight_won",1),
##            #Fight won, decrease odds
##            (assign, ":player_odds_sub", 0),
##            (try_begin),
##              (ge,"$arena_bet_amount",1),
##              (store_div, ":player_odds_sub", "$arena_win_amount", 2),
##            (try_end),
##            (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
##            (val_add, ":player_odds_sub", 5),
##            (val_sub, ":player_odds", ":player_odds_sub"),
##            (val_max, ":player_odds", 250),
##            (party_set_slot, "$g_encountered_party", slot_town_player_odds, ":player_odds"),
##          (else_try),
##            #Fight lost, increase odds
##            (assign, ":player_odds_add", 0),
##            (try_begin),
##              (ge,"$arena_bet_amount",1),
##              (store_div, ":player_odds_add", "$arena_win_amount", 2),
##            (try_end),
##            (party_get_slot, ":player_odds", "$g_encountered_party", slot_town_player_odds),
##            (val_add, ":player_odds_add", 5),
##            (val_add, ":player_odds", ":player_odds_add"),
##            (val_min, ":player_odds", 4000),
##            (party_set_slot, "$g_encountered_party", slot_town_player_odds, ":player_odds"),
##          (try_end),
##          (store_remaining_team_no,"$arena_winner_team"),
##          (assign, "$g_mt_mode", abm_visit),
##          (party_get_slot, ":arena_mission_template", "$current_town", slot_town_arena_template),
##          (set_jump_mission, ":arena_mission_template"),
##          (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
##          (modify_visitors_at_site, ":arena_scene"),
##          (reset_visitors),
##          (set_visitor, 35, "trp_veteran_fighter"),
##          (set_visitor, 36, "trp_hired_blade"),
##          (set_jump_entry, 50),
##          (jump_to_scene, ":arena_scene"),
##          ]),
 
  (0, 0, ti_once, [],
  [
    (eq, "$g_mt_mode", abm_tournament),
    (play_sound, "snd_arena_ambiance", sf_looping),
    (call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
    ]),

  (1, 4, ti_once, [(eq, "$g_mt_mode", abm_tournament),
                  (this_or_next|main_hero_fallen),
                  (num_active_teams_le, 1)],
  [
      (try_begin),
        (neg|main_hero_fallen),
        (call_script, "script_end_tournament_fight", 1),
        (call_script, "script_play_victorious_sound"),
        (finish_mission),
      (else_try),
        (call_script, "script_end_tournament_fight", 0),
        (finish_mission),
      (try_end),
      ]),

  (ti_battle_window_opened, 0, 0, [], [(eq, "$g_mt_mode", abm_training),(start_presentation, "prsnt_arena_training")]),
 
  (0, 0, ti_once, [], [(eq, "$g_mt_mode", abm_training),
                      (assign, "$g_arena_training_max_opponents", 40),
                      (assign, "$g_arena_training_num_agents_spawned", 0),
                      (assign, "$g_arena_training_kills", 0),
                      (assign, "$g_arena_training_won", 0),
                      (call_script, "script_music_set_situation_with_culture", mtf_sit_arena),
                      ]),

  (1, 4, ti_once, [(eq, "$g_mt_mode", abm_training),
                  (store_mission_timer_a, ":cur_time"),
                  (gt, ":cur_time", 3),
                  (assign, ":win_cond", 0),
                  (try_begin),
                    (ge, "$g_arena_training_num_agents_spawned", "$g_arena_training_max_opponents"),#spawn at most 40 agents
                    (num_active_teams_le, 1),
                    (assign, ":win_cond", 1),
                  (try_end),
                  (this_or_next|eq, ":win_cond", 1),
                  (main_hero_fallen)],
  [
      (get_player_agent_no, ":player_agent"),
      (agent_get_kill_count, "$g_arena_training_kills", ":player_agent", 1),#use this for conversation
      (assign, "$g_arena_training_won", 0),
      (try_begin),
        (neg|main_hero_fallen),
        (assign, "$g_arena_training_won", 1),#use this for conversation
      (try_end),
      (assign, "$g_mt_mode", abm_visit),
      (set_jump_mission, "mt_arena_melee_fight"),
      (party_get_slot, ":arena_scene", "$current_town", slot_town_arena),
      (modify_visitors_at_site, ":arena_scene"),
      (reset_visitors),
      (set_visitor, 35, "trp_veteran_fighter"),
      (set_visitor, 36, "trp_hired_blade"),
      (set_jump_entry, 50),
      (jump_to_scene, ":arena_scene"),
      ]),


  (0.2, 0, 0,
  [
      (eq, "$g_mt_mode", abm_training),
      (assign, ":num_active_fighters", 0),
      (try_for_agents, ":agent_no"),
        (agent_is_human, ":agent_no"),
        (agent_is_alive, ":agent_no"),
        (agent_get_team, ":team_no", ":agent_no"),
        (is_between, ":team_no", 0 ,7),
        (val_add, ":num_active_fighters", 1),
      (try_end),
      (lt, ":num_active_fighters", 7),
      (neg|main_hero_fallen),
      (store_mission_timer_a, ":cur_time"),
      (this_or_next|ge, ":cur_time", "$g_arena_training_next_spawn_time"),
      (this_or_next|lt, "$g_arena_training_num_agents_spawned", 6),
      (num_active_teams_le, 1),
      (lt, "$g_arena_training_num_agents_spawned", "$g_arena_training_max_opponents"),
      ],
    [
      (assign, ":added_troop", "$g_arena_training_num_agents_spawned"),
      (store_div,  ":added_troop", "$g_arena_training_num_agents_spawned", 6),
      (assign, ":added_troop_sequence", "$g_arena_training_num_agents_spawned"),
      (val_mod, ":added_troop_sequence", 6),
      (val_add, ":added_troop", ":added_troop_sequence"),
      (val_min, ":added_troop", 9),
      (val_add, ":added_troop", "trp_arena_training_fighter_1"),
      (assign, ":end_cond", 10000),
      (get_player_agent_no, ":player_agent"),
      (agent_get_position, pos5, ":player_agent"),
      (try_for_range, ":unused", 0, ":end_cond"),
        (store_random_in_range, ":random_entry_point", 32, 40),
        (neq, ":random_entry_point", "$g_player_entry_point"), # make sure we don't overwrite player
        (entry_point_get_position, pos1, ":random_entry_point"),
        (get_distance_between_positions, ":dist", pos5, pos1),
        (gt, ":dist", 1200), #must be at least 12 meters away from the player
        (assign, ":end_cond", 0),
      (try_end),
      (add_visitors_to_current_scene, ":random_entry_point", ":added_troop", 1),
      (store_add, ":new_spawned_count", "$g_arena_training_num_agents_spawned", 1),
      (store_mission_timer_a, ":cur_time"),
      (store_add, "$g_arena_training_next_spawn_time", ":cur_time", 14),
      (store_div, ":time_reduction", ":new_spawned_count", 3),
      (val_sub, "$g_arena_training_next_spawn_time", ":time_reduction"),
      ]),

  (0, 0, 0,
  [
      (eq, "$g_mt_mode", abm_training)
      ],
    [
      (assign, ":max_teams", 6),
      (val_max, ":max_teams", 1),
      (get_player_agent_no, ":player_agent"),
      (try_for_agents, ":agent_no"),
        (agent_is_human, ":agent_no"),
        (agent_is_alive, ":agent_no"),
        (agent_slot_eq, ":agent_no", slot_agent_arena_team_set, 0),
        (agent_get_team, ":team_no", ":agent_no"),
        (is_between, ":team_no", 0 ,7),
        (try_begin),
          (eq, ":agent_no", ":player_agent"),
          (agent_set_team, ":agent_no", 6), #player is always team 6.
        (else_try),
          (store_random_in_range, ":selected_team", 0, ":max_teams"),
          # find strongest team
          (try_for_range, ":t", 0, 6),
            (troop_set_slot, "trp_temp_array_a", ":t", 0),
          (try_end),
          (try_for_agents, ":eek:ther_agent_no"),
            (agent_is_human, ":eek:ther_agent_no"),
            (agent_is_alive, ":eek:ther_agent_no"),
            (neq, ":agent_no", ":player_agent"),
            (agent_slot_eq, ":eek:ther_agent_no", slot_agent_arena_team_set, 1),
            (agent_get_team, ":eek:ther_agent_team", ":eek:ther_agent_no"),
            (troop_get_slot, ":count", "trp_temp_array_a", ":eek:ther_agent_team"),
            (val_add, ":count", 1),
            (troop_set_slot, "trp_temp_array_a", ":eek:ther_agent_team", ":count"),
          (try_end),
          (assign, ":strongest_team", 0),
          (troop_get_slot, ":strongest_team_count", "trp_temp_array_a", 0),
          (try_for_range, ":t", 1, 6),
            (troop_slot_ge, "trp_temp_array_a", ":t", ":strongest_team_count"),
            (troop_get_slot, ":strongest_team_count", "trp_temp_array_a", ":t"),
            (assign, ":strongest_team", ":t"),
          (try_end),
          (store_random_in_range, ":rand", 5, 100),
          (try_begin),
            (lt, ":rand", "$g_arena_training_num_agents_spawned"),
            (assign, ":selected_team", ":strongest_team"),
          (try_end),
          (agent_set_team, ":agent_no", ":selected_team"),
        (try_end),
        (agent_set_slot, ":agent_no", slot_agent_arena_team_set, 1),
        (try_begin),
          (neq, ":agent_no", ":player_agent"),
          (val_add, "$g_arena_training_num_agents_spawned", 1),
        (try_end),
      (try_end),
      ]),
  ]

common_battle_add_artifact_exp = (
  ti_on_agent_hit, 0, 0, [],
  [
    (call_script, "script_kt_add_artifact_exp", 75),
  ])


mission_templates = [

After you've done that, use ctrl+f to search for every instance of common_battle_init_banner and when it's followed by a comma, make a new line under it and add "common_battle_add_artifact_exp,"

One example of this, before:

(
    "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),
                          (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, ti_once, [(main_hero_fallen)],
          [
              (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)]),

      common_battle_inventory,     
      common_battle_order_panel,
      common_battle_order_panel_tick,
     
    ],
  ),

After:

(
    "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,
      common_battle_add_artifact_exp,

      (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),
                          (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, ti_once, [(main_hero_fallen)],
          [
              (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)]),

      common_battle_inventory,     
      common_battle_order_panel,
      common_battle_order_panel_tick,
     
    ],
  ),

Hope that's clearer and fixes any problems. The first part is you just defining common_battle_add_artifact_exp as a certain trigger, then you're adding that trigger to all the mission templates used in battles. You could actually add the full code for the trigger in place of common_battle_add_artifact_exp, but it's easier and nicer to read to just add a variable name than add a block of code over and over again.
 
Thank You,

It really worked. It seems I needed a guide for dumbs to make it work :smile:

But there I have another problem. I compiled script and tested it. Script works every time anybody from my party hits enemy. So artifact gains experience not only when I hit, but when any hit occurs.

At this point my lack of skills make distinguishing anyone from player impossible, so I would apreciate help, again :smile:

I really didn't want take so much of Your time, but as you helped so much I don't want to give this up.

 
I am designing a naval battle system that requires different props to be spawned in depending on party slots and such. The boat spawning is working, but there are occasions where the troops spawn and instantly die to what looks like fall damage (same kneeling death animation you get if you ctrl+f4). This has happened with various scripting setups, but seems to happen when I move scene props (either to the bottom of the  during the spawn-in (ti_after_mission_start), and sometimes if the entry points are above the collision mesh of the ships.

What exactly causes this? There's no way I can do any of these scripts without moving scene props at the beginning, and at the same time I'd like to know how to avoid it.
 
MadGuarang said:
Script works every time anybody from my party hits enemy. So artifact gains experience not only when I hit, but when any hit occurs.

At this point my lack of skills make distinguishing anyone from player impossible, so I would apreciate help, again :smile:

Let me know if this works:

Code:
common_battle_add_artifact_exp = (
  ti_on_agent_hit, 0, 0, [],
  [
    (store_trigger_param, ":agent_no", 2),
    
    (try_begin),
      (get_player_agent_no, ":player_agent"),
      (eq, ":agent_no", ":player_agent"),
      
      (call_script, "script_kt_add_artifact_exp", 75),
    (try_end),
  ])

Each trigger has parameters, for ti_on_agent_hit, first parameter should be the id of the agent being hit and the second one should the id of the agent doing the hitting. This is using the second one and checking if it's equal to the player's agent id, then only calling the script if that's true.
 
jacobhinds said:
I had a similar issue when I was working on my flying system. I don't believe there's a way to disable only fall damage. You could set all agents as invulnerable for a very short time, so they don't die when falling, but the "take fall damage" animation is probably going to play regardless.
 
Bump: I'm getting alot of crash reports that I can't diagnose. I've looked at savegames and rgl's.Savegames are broken, but they show no issues in the rgl.
Is there something I can add to the module files or .ini to make sure that the cause of a crash is added to the rgllog?

These are very useful operations from WSE:
item_set_thrust_damage      = 3800 #(item_set_thrust_damage, <item_kind_no>, <value>), #Sets <item_kind_no>'s thrust damage to <value>
item_set_thrust_damage_type = 3801 #(item_set_thrust_damage_type, <item_kind_no>, <value>), #Sets <item_kind_no>'s thrust damage type to <value>
item_set_swing_damage      = 3802 #(item_set_swing_damage, <item_kind_no>, <value>), #Sets <item_kind_no>'s thrust damage to <value>
item_set_swing_damage_type  = 3803 #(item_set_swing_damage_type, <item_kind_no>, <value>), #Sets <item_kind_no>'s thrust damage type to <value>
item_set_head_armor        = 3804 #(item_set_head_armor, <item_kind_no>, <value>), #Sets <item_kind_no>'s head armor to <value>
item_set_body_armor        = 3805 #(item_set_body_armor, <item_kind_no>, <value>), #Sets <item_kind_no>'s body armor to <value>
item_set_leg_armor          = 3806 #(item_set_leg_armor, <item_kind_no>, <value>), #Sets <item_kind_no>'s leg armor to <value>
item_set_speed_rating      = 3807 #(item_set_speed_rating, <item_kind_no>, <value>), #Sets <item_kind_no>'s speed rating to <value>
item_set_missile_speed      = 3808 #(item_set_missile_speed, <item_kind_no>, <value>), #Sets <item_kind_no>'s missile speed to <value>
I have players that can't figure out how to setup WSE.
Is there a way to script these (especially item_set_thrust_damage_type and swingdamagetype) in a non-WSE just as we have scripted party_give_xp_and_gold?
 
Quote from: MadGuarang on Today at 12:53:53 PM
Script works every time anybody from my party hits enemy. So artifact gains experience not only when I hit, but when any hit occurs.

At this point my lack of skills make distinguishing anyone from player impossible, so I would apreciate help, again :smile:

Let me know if this works

Yeaa, it works, basicly :wink:
Now artifact gains exp evertime I hit somebody and thats great. But still, I can shoot somebody from flintlock for example and artifact (sword) would get his experience...
 
MadGuarang said:
Yeaa, it works, basicly :wink:
Now artifact gains exp evertime I hit somebody and thats great. But still, I can shoot somebody from flintlock for example and artifact (sword) would get his experience...

I think you should be able to get the item used with (store_trigger_param, ":item_no", 6). I'll leave it up to you to handle different cases from there.
 
Somebody said:
You can map it to a part of the original texture that doesn't have any transparency, but it might look bad. Try playing with the operation cur_item_add_mesh after the heraldic material has been applied, or cur_item_set_material on the sub-mesh to force it back to the texture you want.
I had tried to map it in the original texture but I had to make the cloak's part in the texture very smaller so it looked bad as you pointed as well.
Forgive my ignorance about operations. I searched cur_item_add_mesh and cur_item_set_materia in header_operations.py but I couldnt find them. Should I have created them myself? and Where shoud I add them, in tableau_materials.py under the heraldic_armor_a as (try_begin),--original cods--,(else_try),---the codes to add the cloak mesh---,(try_end), or in module_items.py in someway else ?
and Are they the ways of adding a mesh to one other mesh in the module_system instead of in OpenBrf?
 
Ok, I really don't know what to do. I am sorry, but this is just my 4th day till I've installed modules and that's why I act not only as a blind, but also deaf  :oops:

I checked header operations and I found some useful stuff and even tried to code it but it is too much for me.

agent_get_wielded_item apparently gives info about what I need = weapon reference agent is wielding, but I am unable to use it.
There is also item_slot_ge which also could give me info I need (every artifact has this line in another script:
(item_set_slot, "itm_sword_artifact_test_1", kt_slot_item_is_artifact, 1),
, so theoreticly I could check does wielded weapon has
kt_slot_item_is_artifact, 1
but my theory and practice of compiler are extremly two different things.

This is what I wrote :
common_battle_add_artifact_exp = (
  ti_on_agent_hit, 0, 0, [],
  [
    (store_trigger_param, ":agent_no", 2),
 
(try_begin),
    (get_player_agent_no, ":player_agent"),
    (eq, ":agent_no", ":player_agent"),
   
      (try_begin),
    (agent_get_wielded_item, ":item_w", ":agent_no", 0)    # (agent_get_wielded_item, <destination>, <agent_id>, <hand_no>),
                                                    # Retrieves the item reference that the agent is currently wielding in his right hand (hand_no = 0) 
 
    #(item_slot_ge, ":item_w", kt_slot_item_is_artifact, 1),   #  item_slot_ge  =  567  # (item_slot_ge, <item_id>, <slot_no>, <value>),
  (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
     
    (call_script, "script_kt_add_artifact_exp", 75),
(try_end),
    (try_end),
       
  ])

and this is what I got:
Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
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\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
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\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
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\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_mission_tmps.py", line 5, in <module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_game_menus.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\process_operations.py", line 21, in
<module>
    from module_mission_templates import *
  File "C:\Users\GAMES\Downloads\NATIVE POBD + FREELANCER + FIREARMS\NATIVE POBD
+ FREELANCER + FIREARMS\Module_system 1.166\module_mission_templates.py", line
1287, in <module>
    (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
TypeError: 'tuple' object is not callable
Exporting postfx_params...

______________________________

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

 
litdum said:
I had tried to map it in the original texture but I had to make the cloak's part in the texture very smaller so it looked bad as you pointed as well.
Forgive my ignorance about operations. I searched cur_item_add_mesh and cur_item_set_materia in header_operations.py but I couldnt find them. Should I have created them myself? and Where shoud I add them, in tableau_materials.py under the heraldic_armor_a as (try_begin),--original cods--,(else_try),---the codes to add the cloak mesh---,(try_end), or in module_items.py in someway else ?
and Are they the ways of adding a mesh to one other mesh in the module_system instead of in OpenBrf?
Update your module system
Code:
cur_item_add_mesh                      = 1964   # (cur_item_add_mesh, <mesh_name_string_no>, [<lod_begin>], [<lod_end>]), #only call inside ti_on_init_item in module_items # lod values are optional. lod_end is not included.
cur_item_set_material                  = 1978   # (cur_item_set_material, <string_no>, <sub_mesh_no>, [<lod_begin>], [<lod_end>]), #only call inside ti_on_init_item in module_items # lod values are optional. lod_end is not included.
 
It IS constant.
It is defined as: kt_slot_item_is_artifact      = 8  # is or isn't, no other values

I followed tutorial/osp on this site exactly https://forums.taleworlds.com/index.php/topic,8652.375.htmland everything is ok with the rest.

EDIT: and of course it was a comma! And everything works now! Many thanks, Baron. I still can't believe it works, but I compiled it, and tried. Artifact is gaining xp only when hit&wielded, when I shoot there is no xp gain. Great! Thanks again to everybody.

But I will be back for more  :twisted:

EDIT: below working code for calling script when player KILLS / WOUNDS enemy
common_battle_add_artifact_exp = (
  ti_on_agent_killed_or_wounded, 0, 0, [], 
  [
    (store_trigger_param, ":agent_no", 2),
 
(try_begin),
    (get_player_agent_no, ":player_agent"),
    (eq, ":agent_no", ":player_agent"), #first parameter should be the id of the agent being hit and the second one should the id of  the agent doing the hitting. This is using the second one and checking if it's equal to the player's agent id, then only calling the script if that's true.
   
      (try_begin),
    (agent_get_wielded_item, ":item_w", ":agent_no", 0),    # (agent_get_wielded_item, <destination>, <agent_id>, <hand_no>),
                                                    # Retrieves the item reference that the agent is currently wielding in his right hand (hand_no = 0) 
 
   
  (item_slot_eq, ":item_w", kt_slot_item_is_artifact, 1),
    (store_random_in_range, reg22, 1, 10), 
    (call_script, "script_kt_add_artifact_exp", reg22),
(try_end),
    (try_end),
       
  ])
 
erennuman_mb said:
It says an object is not callable. Maybe you can try commenting that trigger and mt, building module, and uncomment the trigger and mt.
It says "tuple object is not callable". Ergo the previous line lacks an ending comma and is regarded as a regular Python tuple instead of a... ModSys "statement" or whatever the compiler thinks they are.
 
Somebody said:
litdum said:
I had tried to map it in the original texture but I had to make the cloak's part in the texture very smaller so it looked bad as you pointed as well.
Forgive my ignorance about operations. I searched cur_item_add_mesh and cur_item_set_materia in header_operations.py but I couldnt find them. Should I have created them myself? and Where shoud I add them, in tableau_materials.py under the heraldic_armor_a as (try_begin),--original cods--,(else_try),---the codes to add the cloak mesh---,(try_end), or in module_items.py in someway else ?
and Are they the ways of adding a mesh to one other mesh in the module_system instead of in OpenBrf?
Update your module system
Code:
cur_item_add_mesh                      = 1964   # (cur_item_add_mesh, <mesh_name_string_no>, [<lod_begin>], [<lod_end>]), #only call inside ti_on_init_item in module_items # lod values are optional. lod_end is not included.
cur_item_set_material                  = 1978   # (cur_item_set_material, <string_no>, <sub_mesh_no>, [<lod_begin>], [<lod_end>]), #only call inside ti_on_init_item in module_items # lod values are optional. lod_end is not included.
I use waihti's Diplomacy source and for being able to keep my "module_" folders probably I need the recent Diplomacy source, which have the operations, presentations etc. for diplomacy mod. I ve searched it but couldnt find! Could you give me a link if you know? or Is there anyone who know a link for recent diplomacy source?
 
Status
Not open for further replies.
Back
Top Bottom