Same here hence the crappy coding on my part.
That is the case like I have said a few posts ago hence why I have added "(eq, ":item_id", itp_type_pistol)," in
(is_between, ":item_id", "itm_flintlock_pistol_brown", "itm_torch"),
(assign, ":flashpan_pos_x", 2),
(assign, ":flashpan_pos_y", 13),
(assign, ":muzzle_pos_x", 28),
(assign, ":muzzle_pos_y", 34),
(eq, ":item_id", itp_type_pistol),
(else_try),
There's no reason for that limit though, it's an unnecessary condition check.
Don't worry I noticed it and have already fixed it
("firearm_sound_at_x_distance",
[
(store_script_param_1, ":item_type"),
(mission_cam_get_position, pos60),
(get_distance_between_positions_in_meters, ":distance", pos60, pos2),
(assign, ":sound_id", -1),
(try_begin),
(eq, ":item_type", itp_type_crossbow),
(try_begin),
(le, ":distance", 50),
(assign, ":sound_id", "snd_release_musket"),
(else_try),
(le, ":distance", 200),
(assign, ":sound_id", "snd_release_musket_medium"),
(else_try),
(le, ":distance", 1000),
(assign, ":sound_id", "snd_release_musket_far"),
(try_end),
(else_try),
(eq, ":item_type", itp_type_pistol),
(try_begin),
(le, ":distance", 50),
(assign, ":sound_id", "snd_release_pistol"),
(else_try),
(le, ":distance", 200),
(assign, ":sound_id", "snd_release_pistol_medium"),
(else_try),
(le, ":distance", 1000),
(assign, ":sound_id", "snd_release_pistol_far"),
(try_end),
(try_end),
(try_begin),
(gt, ":sound_id", -1),
(play_sound_at_position, ":sound_id", pos2),
(try_end),
]),
Well why not try them out you know?
One can simply just edit the audio file to have 3 seconds of silence before the shot is heard which can be done using Audacity or similar programs.
["practice_javelin", "Practice Javelins", [("javelin",0),("javelins_quiver", ixmesh_carry),("javelins_quiver", ixmesh_inventory)], itp_type_thrown |itp_primary|itp_next_item_as_melee, itcf_throw_javelin|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 0, weight(5) | spd_rtng(91) | shoot_speed(28) | thrust_damage(27, blunt) | max_ammo(50) | weapon_length(75), imodbits_thrown],
["practice_javelin_melee", "practice_javelin_melee", [("javelin",0),("javelins_quiver", ixmesh_carry)], itp_type_polearm|itp_primary|itp_penalty_with_shield|itp_wooden_parry , itc_staff, 0, weight(1)|difficulty(0)|spd_rtng(91) |swing_damage(12, blunt)| thrust_damage(14, blunt)|weapon_length(75),imodbits_polearm ],
_Sebastian_ said:
RecursiveHarmony said:
(copy_position, pos60, pos2),
(call_script, "script_firearm_sound_at_x_distance", itp_type_pistol, "snd_release_crossbow"),
(copy_position, pos60, pos2),
(call_script, "script_firearm_sound_at_x_distance", itp_type_pistol),#was "snd_release_crossbow"
_Sebastian_ said:
# script_firearm_sound_at_x_distance
# input:
# type (pistol or musket),
# sound_id
# pos2 (muzzle),
# pos60(mission_camera_position)
# output: none
("firearm_sound_at_x_distance",
[
(store_script_param, ":item_type", 1),
(store_script_param, ":sound_id", 2),
(try_begin),
#(is_between, ":sound_id", 0, "snd_sounds_end"),
(mission_cam_get_position, pos60),
(get_distance_between_positions_in_meters, ":distance", pos60, pos2),
(is_between, ":item_type", itp_type_crossbow, itp_type_musket),
(assign, ":sound_id", -1),
(try_begin),
(eq, ":item_type", itp_type_crossbow),
(is_between, ":distance", 0, 50),
#(try_for_range, ":distance", 0, 50),
(le, ":distance", 50),
(assign, ":sound_id", "snd_release_musket"),
(else_try),
(eq, ":item_type", itp_type_crossbow),
(is_between, ":distance", 50, 200),
#(try_for_range, ":distance", 50, 200),
(le, ":distance", 200),
(assign, ":sound_id", "snd_release_musket_medium"),
(else_try),
(eq, ":item_type", itp_type_crossbow),
(is_between, ":distance", 200, 1000),
#(try_for_range, ":distance", 200, 1000),
(le, ":distance", 1000),
(assign, ":sound_id", "snd_release_musket_far"),
(else_try),
(eq, ":item_type", itp_type_pistol),
(is_between, ":distance", 0, 50),
(le, ":distance", 50),
(assign, ":sound_id", "snd_release_pistol"),
(else_try),
(eq, ":item_type", itp_type_pistol),
(is_between, ":distance", 50, 200),
#(try_for_range, ":distance", 50, 200),
(le, ":distance", 200),
(assign, ":sound_id", "snd_release_pistol_medium"),
(else_try),
(eq, ":item_type", itp_type_pistol),
(is_between, ":distance", 200, 1000),
(le, ":distance", 1000),
(assign, ":sound_id", "snd_release_pistol_far"),
(try_end),
(gt, ":sound_id", -1),
(play_sound_at_position, ":sound_id", pos2),
(try_end),
]),
_Sebastian_ said:
# script_game_missile_launch
# Input: arg1 = shooter_agent_id, arg2 = weapon_item_id, pos1 = weapon_item_position
# Output: none
("game_missile_launch",
[
(store_script_param, ":item_id", 2),
(try_begin),
(gt, ":item_id", -1),
(item_get_type, ":item_type", ":item_id"),
(try_begin),
(neg|multiplayer_is_dedicated_server),#only client side
(try_begin),
(is_between, ":item_type", itp_type_crossbow, itp_type_musket),
(assign, ":flashpan_pos_x", 0),
(assign, ":flashpan_pos_y", 0),
(assign, ":flashpan_pos_z", 0),
(assign, ":muzzle_pos_x", 0),
(assign, ":muzzle_pos_y", 0),
(assign, ":muzzle_pos_z", 0),
(try_begin),
(is_between, ":item_id", "itm_arquebus", "itm_cross_foot_musket_1b_melee"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 12),
(assign, ":muzzle_pos_x", 1.7),
(assign, ":muzzle_pos_y", 115),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(this_or_next|eq, ":item_id", "itm_tutorial_crossbow"),
(eq, ":item_id", "itm_practice_crossbow"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 12),
(assign, ":muzzle_pos_x", 1.7),
(assign, ":muzzle_pos_y", 115),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(is_between, ":item_id", "itm_flintlock_pistol_brown", "itm_torch"),
(assign, ":flashpan_pos_x", 2),
(assign, ":flashpan_pos_y", 13),
(assign, ":muzzle_pos_x", 28),
(assign, ":muzzle_pos_y", 34),
(eq, ":item_id", itp_type_pistol),
(else_try),
(is_between, ":item_id", "itm_mamluk_old_matchlock", "itm_flintlock_pistol_brown"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 14),
(assign, ":muzzle_pos_x", 1.2),
(assign, ":muzzle_pos_y", 118),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(is_between, ":item_id", "itm_flintlock_carbine_red", "itm_swadian_carbine_1"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 13),
(assign, ":muzzle_pos_x", 1.2),
(assign, ":muzzle_pos_y", 100),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(is_between, ":item_id", "itm_nord_carbine_1", "itm_mamluk_old_matchlock"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 14),
(assign, ":muzzle_pos_x", 1.3),
(assign, ":muzzle_pos_y", 105),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(is_between, ":item_id", "itm_swadian_carbine_1", "itm_cross_carbine_1"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 15),
(assign, ":muzzle_pos_x", 1.8),
(assign, ":muzzle_pos_y", 110),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(is_between, ":item_id", "itm_cross_carbine_1", "itm_nord_carbine_1"),
(assign, ":flashpan_pos_x", -4),
(assign, ":flashpan_pos_y", 12),
(assign, ":muzzle_pos_x", 1.4),
(assign, ":muzzle_pos_y", 110),
(eq, ":item_id", itp_type_crossbow),
(else_try),
(eq, ":item_id", "itm_wheellock_carbine"),
(assign, ":flashpan_pos_x", -3),
(assign, ":flashpan_pos_y", 13),
(assign, ":muzzle_pos_x", 0),
(assign, ":muzzle_pos_y", 83),
(eq, ":item_id", itp_type_crossbow),
(try_end),
#(call_script, "script_oim_on_musket_on_attack", itp_type_musket, 0, 83, -3, -69), #actual positions 0, 83, -3, 14
#(try_begin),
#(eq, ":item_type", itp_type_crossbow),
#(val_sub, ":muzzle_pos_x", 8),#this is needed, because the particles dont appear at the correct position
#(val_sub, ":flashpan_pos_x", 8),#this is needed, because the particles dont appear at the correct position
#(val_sub, ":muzzle_pos_z", 3),#this is needed, because the particles dont appear at the correct position
#(val_sub, ":flashpan_pos_z", 3),#this is needed, because the particles dont appear at the correct position
#(try_end),
(set_fixed_point_multiplier, 100),
(copy_position, pos2, pos1),
(position_move_x, pos1, ":flashpan_pos_x"),
(position_move_y, pos1, ":flashpan_pos_y"),
(position_move_z, pos1, ":flashpan_pos_z"),
(position_move_x, pos2, ":muzzle_pos_x"),
(position_move_y, pos2, ":muzzle_pos_y"),
(position_move_z, pos2, ":muzzle_pos_z"),
(particle_system_burst_no_sync, "psys_oim_musket_powder_a", pos1, 8),#was 1
(particle_system_burst_no_sync, "psys_oim_pistol_powder_b", pos1, 15),#was 10
(assign, ":sound_id", -1),#NW code
(try_begin),#pistol/musket
(eq, ":item_type", itp_type_pistol),
#(position_rotate_z, pos1, -45),
#(position_rotate_z, pos2, -45),
(particle_system_burst_no_sync, "psys_oim_pistol_smoke", pos2, 8),
(particle_system_burst_no_sync, "psys_oim_pistol_fire", pos2, 8),
(particle_system_burst_no_sync, "psys_oim_pistol_flash", pos2, 8),
(assign, ":sound_id", "snd_release_pistol"),
#(copy_position, pos60, pos2),
#(call_script, "script_firearm_sound_at_x_distance", itp_type_pistol, "snd_release_musket"),
(else_try),
(eq, ":item_type", itp_type_crossbow),
(particle_system_burst_no_sync, "psys_oim_musket_smoke", pos2, 8),
(particle_system_burst_no_sync, "psys_oim_musket_fire", pos2, 8),
(particle_system_burst_no_sync, "psys_oim_musket_flash", pos2, 8),
(assign, ":sound_id", "snd_release_musket"),
#(copy_position, pos60, pos2),
#(call_script, "script_firearm_sound_at_x_distance", itp_type_crossbow, "snd_release_musket"),
(try_end),
(gt, ":sound_id", -1),#NW code
(play_sound_at_position, ":sound_id", pos2),#NW code
#(copy_position, pos60, pos2),
#(call_script, "script_firearm_sound_at_x_distance", itp_type_crossbow, "snd_release_musket"),
#(call_script, "script_firearm_sound_at_x_distance", itp_type_pistol, "snd_release_pistol"),
#(call_script, "script_multiplayer_server_play_sound_at_position", "snd_release_musket"),
(try_end),
(try_end),
]),
# script_firearm_sound_at_x_distance
# input:
# type (pistol or musket),
# sound_id
# pos2 (muzzle),
# pos60(mission_camera_position)
# output: none
("firearm_sound_at_x_distance",
[
(store_script_param, ":item_type", 1),
(store_script_param, ":sound_id", 2),
(try_begin),
#(is_between, ":sound_id", 0, "snd_sounds_end"),
(mission_cam_get_position, pos60),
(get_distance_between_positions_in_meters, ":distance", pos60, pos2),
(is_between, ":item_type", itp_type_crossbow, itp_type_musket),
(assign, ":sound_id", -1),
(try_begin),
#(eq, ":item_type", itp_type_crossbow),
#(try_for_range, ":distance", 0, 50),
#(le, ":distance", 50),
#(assign, ":sound_id", "snd_release_musket"),
#(else_try),
(eq, ":item_type", itp_type_crossbow),
(try_for_range, ":distance", 50, 1000),
(le, ":distance", 200),
(assign, ":sound_id", "snd_release_musket_medium"),
(le, ":distance", 1000),
(assign, ":sound_id", "snd_release_musket_far"),
(else_try),
(eq, ":item_type", itp_type_pistol),
(try_for_range, ":distance", 50, 1000),
(le, ":distance", 200),
(assign, ":sound_id", "snd_release_pistol_medium"),
(le, ":distance", 1000),
(assign, ":sound_id", "snd_release_pistol_far"),
(try_end),
(gt, ":sound_id", -1),
(play_sound_at_position, ":sound_id", pos2),
(try_end),
]),
gsanders said:
Arthur_Pendragon said: