Added, Updated and Removed Mods; Removed Backups

This commit is contained in:
2024-04-05 05:57:24 -04:00
parent 5caee9fba5
commit 6f19f2c70f
1209 changed files with 27057 additions and 41484 deletions
@@ -16,14 +16,14 @@ ef_weapon_type = 8
hand_dependence = 1
single_handed = 0
icons_texture = ui\ui_icon_mk14
icons_texture = ui\ui_icon_m14
inv_grid_height = 2
inv_grid_width = 6
inv_grid_x = 0
inv_grid_y = 0
inv_grid_y = 2
inv_name = st_wpn_mk14
inv_name_short = st_wpn_mk14
description = st_wpn_mk14_descr
description = st_wpn_mk14_descr_new
kind = w_rifle
inv_weight = 5.10
@@ -83,7 +83,7 @@ scope_zoom_factor = 0
silencer_name = wpn_sil_nato
silencer_status = 2
silencer_x = 268
silencer_x = 262
silencer_y = 9
silencer_light_color = 0.6, 0.5, 0.3
silencer_light_range = 0.01
@@ -164,7 +164,7 @@ kill_msg_height = 28
snd_bore = weapons\librarian_m14\bored
snd_draw = weapons\librarian_m14\draw
snd_reload_misfire = weapons\librarian_m14\unjam
snd_reload_misfire = $no_sound
snd_reload = $no_sound
snd_reload_empty = $no_sound
snd_switch_mode = weapons\librarian_m14\switch
@@ -176,6 +176,9 @@ scripted_snd_reload_empty_variant1 = weapons\librarian_m14\reload_empty1
scripted_snd_reload_empty_variant2 = weapons\librarian_m14\reload_empty2
scripted_snd_reload_empty_variant3 = weapons\librarian_m14\reload_empty3
scripted_snd_reload_misfire = weapons\librarian_m14\unjam
scripted_snd_reload_misfire_empty = weapons\librarian_m14\unjam_empty
[wpn_mk14_hud]:hud_base
item_visual = anomaly_weapons\wpn_m14\wpn_mk14_hud.ogf
@@ -209,51 +212,64 @@ gl_hud_offset_rot_16x9 = 0, 0, 0
lean_hud_offset_pos = 0, 0, 0
lean_hud_offset_rot = 0, 0, 0
anm_bore = mk14_hand_bored, mk14_idle
anm_hide = mk14_hand_holster, mk14_idle
anm_idle = mk14_hand_idle, mk14_idle
anm_idle_aim = mk14_hand_idle_aim, mk14_idle
anm_idle_aim_moving = mk14_hand_moving, mk14_idle, 0.75
anm_idle_aim_moving_crouch = mk14_hand_moving, mk14_idle, 0.7
anm_idle_moving = mk14_hand_moving, mk14_idle
anm_idle_sprint = mk14_hand_sprint, mk14_idle, 1.1
anm_shots = mk14_hand_shoot, mk14_shoot
anm_shots_aim = mk14_hand_shoot_aim, mk14_shoot
anm_reload = mk14_reload
anm_reload_variant1 = mk14_reload1
anm_reload_empty = mk14_reload_empty
anm_reload_empty_variant1 = mk14_reload_empty1
anm_reload_empty_variant2 = mk14_reload_empty2
anm_reload_empty_variant3 = mk14_reload_empty3
anm_show = mk14_hand_draw, mk14_idle
anm_switch_mode = mk14_hand_switch, mk14_idle
anm_bore = emk14_hand_bored, emk14_idle
anm_hide = emk14_hand_holster, emk14_idle
anm_idle = emk14_hand_idle, emk14_idle
anm_idle_aim = emk14_hand_idle_aim, emk14_idle
anm_idle_aim_moving = emk14_hand_moving, emk14_idle, 0.75
anm_idle_aim_moving_crouch = emk14_hand_moving, emk14_idle, 0.7
anm_idle_moving = emk14_hand_moving, emk14_idle
anm_idle_sprint = emk14_hand_sprint, emk14_idle, 1.1
anm_shots = emk14_hand_shoot, emk14_shoot
anm_shots_aim = emk14_hand_shoot_aim, emk14_shoot
anm_reload = emk14_reload
anm_reload_variant1 = emk14_reload1
anm_reload_empty = emk14_reload_empty
anm_reload_empty_variant1 = emk14_reload_empty1
anm_reload_empty_variant2 = emk14_reload_empty2
anm_reload_empty_variant3 = emk14_reload_empty3
anm_show = emk14_hand_draw, emk14_idle
anm_switch_mode = emk14_hand_switch, emk14_idle
;==============================COK========================================
anm_bore_empty = mk14_hand_bored, mk14_idle_empty
anm_hide_empty = mk14_hand_holster, mk14_idle_empty
anm_idle_empty = mk14_hand_idle, mk14_idle_empty
anm_idle_moving_empty = mk14_hand_moving, mk14_idle_empty
anm_idle_moving_crouch_empty = mk14_hand_moving, mk14_idle_empty, 0.75
anm_idle_aim_empty = mk14_hand_idle_aim, mk14_idle_empty
anm_idle_aim_moving_empty = mk14_hand_moving, mk14_idle_empty, 0.75
anm_idle_aim_moving_crouch_empty = mk14_hand_moving, mk14_idle_empty, 0.75
anm_idle_sprint_empty = mk14_hand_sprint, mk14_idle_empty, 1.1
anm_shot_l = mk14_hand_shoot, mk14_shoot_last
anm_shots_aim_l = mk14_hand_shoot_aim, mk14_shoot_last
anm_show_empty = mk14_hand_draw, mk14_idle_empty
anm_switch_mode_empty = mk14_hand_switch, mk14_idle_empty
anm_bore_empty = emk14_hand_bored, emk14_idle_empty
anm_hide_empty = emk14_hand_holster, emk14_idle_empty
anm_idle_empty = emk14_hand_idle, emk14_idle_empty
anm_idle_moving_empty = emk14_hand_moving, emk14_idle_empty
anm_idle_moving_crouch_empty = emk14_hand_moving, emk14_idle_empty, 0.75
anm_idle_aim_empty = emk14_hand_idle_aim, emk14_idle_empty
anm_idle_aim_moving_empty = emk14_hand_moving, emk14_idle_empty, 0.75
anm_idle_aim_moving_crouch_empty = emk14_hand_moving, emk14_idle_empty, 0.75
anm_idle_sprint_empty = emk14_hand_sprint, emk14_idle_empty, 1.1
anm_shot_l = emk14_hand_shoot, emk14_shoot_last
anm_shots_aim_l = emk14_hand_shoot_aim, emk14_shoot_last
anm_show_empty = emk14_hand_draw, emk14_idle_empty
anm_switch_mode_empty = emk14_hand_switch, emk14_idle_empty
;==============================TAE========================================
anm_bore_jammed = mk14_hand_jam_inspect, mk14_idle_jam
anm_hide_jammed = mk14_hand_holster, mk14_idle_jam
anm_idle_jammed = mk14_hand_idle, mk14_idle_jam
anm_idle_aim_jammed = mk14_hand_idle_aim, mk14_idle_jam
anm_idle_aim_moving_jammed = mk14_hand_moving, mk14_idle_jam, 0.75
anm_idle_aim_moving_crouch_jammed = mk14_hand_moving, mk14_idle_jam, 0.75
anm_idle_moving_jammed = mk14_hand_moving, mk14_idle_jam, 0.75
anm_idle_moving_crouch_jammed = mk14_hand_moving, mk14_idle_jam, 0.75
anm_idle_sprint_jammed = mk14_hand_sprint, mk14_idle_jam, 1.1
anm_reload_misfire = mk14_hand_unjam, mk14_unjam
anm_show_jammed = mk14_hand_draw, mk14_idle_jam
anm_switch_mode_jammed = mk14_hand_switch, mk14_idle_jam
anm_bore_jammed = emk14_hand_jam_inspect, emk14_idle_jam
anm_hide_jammed = emk14_hand_holster, emk14_idle_jam
anm_idle_jammed = emk14_hand_idle, emk14_idle_jam
anm_idle_aim_jammed = emk14_hand_idle_aim, emk14_idle_jam
anm_idle_aim_moving_jammed = emk14_hand_moving, emk14_idle_jam, 0.75
anm_idle_aim_moving_crouch_jammed = emk14_hand_moving, emk14_idle_jam, 0.75
anm_idle_moving_jammed = emk14_hand_moving, emk14_idle_jam, 0.75
anm_idle_moving_crouch_jammed = emk14_hand_moving, emk14_idle_jam, 0.75
anm_idle_sprint_jammed = emk14_hand_sprint, emk14_idle_jam, 1.1
anm_reload_misfire = emk14_hand_unjam, emk14_unjam
anm_show_jammed = emk14_hand_draw, emk14_idle_jam
anm_switch_mode_jammed = emk14_hand_switch, emk14_idle_jam
;==============================TOD========================================
anm_idle_empty_jammed = emk14_hand_idle, emk14_idle_jam
anm_show_empty_jammed = emk14_hand_draw, emk14_idle_jam
anm_hide_empty_jammed = emk14_hand_holster, emk14_idle_jam
anm_idle_aim_empty_jammed = emk14_hand_idle_aim, emk14_idle_jam
anm_idle_sprint_empty_jammed = emk14_hand_sprint, emk14_idle_jam, 1.2
anm_idle_moving_empty_jammed = emk14_hand_moving, emk14_idle_jam
anm_idle_moving_crouch_empty_jammed = emk14_hand_moving, emk14_idle_jam, 0.7
anm_bore_empty_jammed = emk14_hand_bored, emk14_idle_jam
anm_reload_misfire_empty = emk14_hand_unjam, emk14_unjam_empty
anm_shot_l_jammed = emk14_hand_shoot, emk14_shoot_last
anm_shots_jammed = emk14_hand_shoot, emk14_shoot
@@ -287,9 +303,9 @@ item_visual = anomaly_weapons\wpn_m14\wpn_mk14_barsk
aim_hud_offset_pos = -0.090608, 0.009595, -0.122659
aim_hud_offset_pos_16x9 = -0.090608, 0.009595, -0.122659
anm_bore = mk14_hand_bored_scope, mk14_idle
anm_bore_empty = mk14_hand_bored_scope, mk14_idle_empty
anm_bore_jammed = mk14_hand_jam_inspect, mk14_idle_jam
anm_bore = emk14_hand_bored_scope, emk14_idle
anm_bore_empty = emk14_hand_bored_scope, emk14_idle_empty
anm_bore_jammed = emk14_hand_jam_inspect, emk14_idle_jam
;------------------------------------------------------------------------------------------------
[wpn_mk14_acog]:wpn_mk14
@@ -320,9 +336,9 @@ item_visual = anomaly_weapons\wpn_m14\wpn_mk14_acog
aim_hud_offset_pos = -0.090874, 0.009595, -0.132691
aim_hud_offset_pos_16x9 = -0.090874, 0.009595, -0.132691
anm_bore = mk14_hand_bored_scope, mk14_idle
anm_bore_empty = mk14_hand_bored_scope, mk14_idle_empty
anm_bore_jammed = mk14_hand_jam_inspect, mk14_idle_jam
anm_bore = emk14_hand_bored_scope, emk14_idle
anm_bore_empty = emk14_hand_bored_scope, emk14_idle_empty
anm_bore_jammed = emk14_hand_jam_inspect, emk14_idle_jam
;------------------------------------------------------------------------------------------------
[wpn_mk14_c-more]:wpn_mk14
@@ -343,9 +359,9 @@ item_visual = anomaly_weapons\wpn_m14\wpn_mk14_c-mo
aim_hud_offset_pos = -0.091308, 0.007393, -0.122659
aim_hud_offset_pos_16x9 = -0.091308, 0.007393, -0.122659
anm_bore = mk14_hand_bored_scope, mk14_idle
anm_bore_empty = mk14_hand_bored_scope, mk14_idle_empty
anm_bore_jammed = mk14_hand_jam_inspect, mk14_idle_jam
anm_bore = emk14_hand_bored_scope, emk14_idle
anm_bore_empty = emk14_hand_bored_scope, emk14_idle_empty
anm_bore_jammed = emk14_hand_jam_inspect, emk14_idle_jam
;------------------------------------------------------------------------------------------------
[wpn_mk14_eot]:wpn_mk14
@@ -367,9 +383,9 @@ item_visual = anomaly_weapons\wpn_m14\wpn_mk14_eot_
aim_hud_offset_pos = -0.090873, 0.001267, -0.122659
aim_hud_offset_pos_16x9 = -0.090873, 0.001267, -0.122659
anm_bore = mk14_hand_bored_scope, mk14_idle
anm_bore_empty = mk14_hand_bored_scope, mk14_idle_empty
anm_bore_jammed = mk14_hand_jam_inspect, mk14_idle_jam
anm_bore = emk14_hand_bored_scope, emk14_idle
anm_bore_empty = emk14_hand_bored_scope, emk14_idle_empty
anm_bore_jammed = emk14_hand_jam_inspect, emk14_idle_jam
;-------------------------------------------M14-----------------------------------------------------
[wpn_m14]:wpn_mk14
@@ -409,48 +425,61 @@ aim_hud_offset_pos_16x9 = -0.091143, 0.028869, -0.100535
aim_hud_offset_rot = 0, 0, 0
aim_hud_offset_rot_16x9 = 0, 0, 0
anm_bore = m14_hand_bored, m14_idle
anm_hide = m14_hand_holster, m14_idle
anm_idle = m14_hand_idle, m14_idle
anm_idle_aim = m14_hand_idle_aim, m14_idle
anm_idle_aim_moving = m14_hand_moving, m14_idle, 0.75
anm_idle_aim_moving_crouch = m14_hand_moving, m14_idle, 0.7
anm_idle_moving = m14_hand_moving, m14_idle
anm_idle_sprint = m14_hand_sprint, m14_idle, 1.1
anm_shots = m14_hand_shoot, m14_shoot
anm_shots_aim = m14_hand_shoot_aim, m14_shoot
anm_reload = m14_reload
anm_reload_variant1 = m14_reload1
anm_reload_empty = m14_reload_empty
anm_reload_empty_variant1 = m14_reload_empty1
anm_reload_empty_variant2 = m14_reload_empty2
anm_reload_empty_variant3 = m14_reload_empty3
anm_show = m14_hand_draw, m14_idle
anm_switch_mode = m14_hand_switch, m14_idle
anm_bore = em14_hand_bored, em14_idle
anm_hide = em14_hand_holster, em14_idle
anm_idle = em14_hand_idle, em14_idle
anm_idle_aim = em14_hand_idle_aim, em14_idle
anm_idle_aim_moving = em14_hand_moving, em14_idle, 0.75
anm_idle_aim_moving_crouch = em14_hand_moving, em14_idle, 0.7
anm_idle_moving = em14_hand_moving, em14_idle
anm_idle_sprint = em14_hand_sprint, em14_idle, 1.1
anm_shots = em14_hand_shoot, em14_shoot
anm_shots_aim = em14_hand_shoot_aim, em14_shoot
anm_reload = em14_reload
anm_reload_variant1 = em14_reload1
anm_reload_empty = em14_reload_empty
anm_reload_empty_variant1 = em14_reload_empty1
anm_reload_empty_variant2 = em14_reload_empty2
anm_reload_empty_variant3 = em14_reload_empty3
anm_show = em14_hand_draw, em14_idle
anm_switch_mode = em14_hand_switch, em14_idle
;==============================COK========================================
anm_bore_empty = m14_hand_bored, m14_idle_empty
anm_hide_empty = m14_hand_holster, m14_idle_empty
anm_idle_empty = m14_hand_idle, m14_idle_empty
anm_idle_moving_empty = m14_hand_moving, m14_idle_empty
anm_idle_moving_crouch_empty = m14_hand_moving, m14_idle_empty, 0.75
anm_idle_aim_empty = m14_hand_idle_aim, m14_idle_empty
anm_idle_aim_moving_empty = m14_hand_moving, m14_idle_empty, 0.75
anm_idle_aim_moving_crouch_empty = m14_hand_moving, m14_idle_empty, 0.75
anm_idle_sprint_empty = m14_hand_sprint, m14_idle_empty, 1.1
anm_shot_l = m14_hand_shoot, m14_shoot_last
anm_shots_aim_l = m14_hand_shoot_aim, m14_shoot_last
anm_show_empty = m14_hand_draw, m14_idle_empty
anm_switch_mode_empty = m14_hand_switch, m14_idle_empty
anm_bore_empty = em14_hand_bored, em14_idle_empty
anm_hide_empty = em14_hand_holster, em14_idle_empty
anm_idle_empty = em14_hand_idle, em14_idle_empty
anm_idle_moving_empty = em14_hand_moving, em14_idle_empty
anm_idle_moving_crouch_empty = em14_hand_moving, em14_idle_empty, 0.75
anm_idle_aim_empty = em14_hand_idle_aim, em14_idle_empty
anm_idle_aim_moving_empty = em14_hand_moving, em14_idle_empty, 0.75
anm_idle_aim_moving_crouch_empty = em14_hand_moving, em14_idle_empty, 0.75
anm_idle_sprint_empty = em14_hand_sprint, em14_idle_empty, 1.1
anm_shot_l = em14_hand_shoot, em14_shoot_last
anm_shots_aim_l = em14_hand_shoot_aim, em14_shoot_last
anm_show_empty = em14_hand_draw, em14_idle_empty
anm_switch_mode_empty = em14_hand_switch, em14_idle_empty
;==============================TAE========================================
anm_bore_jammed = m14_hand_jam_inspect, m14_idle_jam
anm_hide_jammed = m14_hand_holster, m14_idle_jam
anm_idle_jammed = m14_hand_idle, m14_idle_jam
anm_idle_aim_jammed = m14_hand_idle_aim, m14_idle_jam
anm_idle_aim_moving_jammed = m14_hand_moving, m14_idle_jam, 0.75
anm_idle_aim_moving_crouch_jammed = m14_hand_moving, m14_idle_jam, 0.75
anm_idle_moving_jammed = m14_hand_moving, m14_idle_jam, 0.75
anm_idle_moving_crouch_jammed = m14_hand_moving, m14_idle_jam, 0.75
anm_idle_sprint_jammed = m14_hand_sprint, m14_idle_jam, 1.1
anm_reload_misfire = m14_hand_unjam, m14_unjam
anm_show_jammed = m14_hand_draw, m14_idle_jam
anm_switch_mode_jammed = m14_hand_switch, m14_idle_jam
anm_bore_jammed = em14_hand_jam_inspect, em14_idle_jam
anm_hide_jammed = em14_hand_holster, em14_idle_jam
anm_idle_jammed = em14_hand_idle, em14_idle_jam
anm_idle_aim_jammed = em14_hand_idle_aim, em14_idle_jam
anm_idle_aim_moving_jammed = em14_hand_moving, em14_idle_jam, 0.75
anm_idle_aim_moving_crouch_jammed = em14_hand_moving, em14_idle_jam, 0.75
anm_idle_moving_jammed = em14_hand_moving, em14_idle_jam, 0.75
anm_idle_moving_crouch_jammed = em14_hand_moving, em14_idle_jam, 0.75
anm_idle_sprint_jammed = em14_hand_sprint, em14_idle_jam, 1.1
anm_reload_misfire = em14_hand_unjam, em14_unjam
anm_reload_misfire_empty = em14_hand_unjam, em14_unjam_empty
anm_show_jammed = em14_hand_draw, em14_idle_jam
anm_switch_mode_jammed = em14_hand_switch, em14_idle_jam
;==============================TOD========================================
anm_idle_empty_jammed = em14_hand_idle, em14_idle_jam
anm_show_empty_jammed = em14_hand_draw, em14_idle_jam
anm_hide_empty_jammed = em14_hand_holster, em14_idle_jam
anm_idle_aim_empty_jammed = em14_hand_idle_aim, em14_idle_jam
anm_idle_sprint_empty_jammed = em14_hand_sprint, em14_idle_jam, 1.2
anm_idle_moving_empty_jammed = em14_hand_moving, em14_idle_jam
anm_idle_moving_crouch_empty_jammed = em14_hand_moving, em14_idle_jam, 0.7
anm_bore_empty_jammed = em14_hand_bored, em14_idle_jam
anm_reload_misfire_empty = em14_hand_unjam, em14_unjam_empty
anm_shot_l_jammed = em14_hand_shoot, em14_shoot_last
anm_shots_jammed = em14_hand_shoot, em14_shoot
@@ -1,8 +1,23 @@
<?xml version="1.0" encoding="windows-1251"?>
<!--
Weapons
-->
<string_table>
<string id="st_wpn_m14">
<text>M14</text>
</string>
<string id="st_wpn_m14_descr">
<text>The M14 is a legendary semi-automatic battle rifle that has earned its place as a revered relic within the treacherous and enigmatic confines of the Zone. Its distinctive silhouette, combining elements of classic design with modern engineering, has made it a sought-after prize for Stalkers braving the dangers of this post-apocalyptic realm.</text>
<text>The M14 is a legendary semi-automatic battle rifle that has earned its place as a revered relic within the treacherous and enigmatic confines of the Zone. Its distinctive silhouette, combining elements of classic design with modern engineering, has made it a sought-after prize for Stalkers braving the dangers of this post-apocalyptic realm.\n \n
%c[ui_gray_2]ATTACHMENTS: \n
%c[d_purple] • %c[ui_gray_2] 5.56x45 compatible suppressor\n \n</text>
</string>
<string id="st_wpn_mk14_descr_new">
<text>United States Navy Mark 14 Enhanced Battle Rifle (Mk 14 Enhanced Battle Rifle, "improved combat rifle") - American Marksman rifle, created by special operations of the US Navy based on the M14 rifle. Used by a number of special units of the Navy, including SEAL.\n \n
%c[ui_gray_2]ATTACHMENTS: \n
%c[d_purple] • %c[ui_gray_2] 5.56x45 compatible suppressor\n
%c[d_purple] • %c[ui_gray_2] ACOG, Barska ES AC10632, C-more Railway Tactical, EOTech scopes\n \n</text>
</string>
</string_table>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="windows-1251"?>
<!--
Weapons
-->
<string_table>
<string id="st_wpn_m14">
<text>M14</text>
</string>
<string id="st_wpn_m14_descr">
<text>M14 - это легендарная полуавтоматическая боевая винтовка, которая заслужила свое место как почитаемый реликт в опасных и загадочных пределах Зоны. Ее характерный силуэт, сочетающий элементы классического дизайна с современной инженерией, сделал его желанным призом для Сталкеров, рискующих опасностями этого постапокалиптического мира.\n \n
%c[ui_gray_2]ATTACHMENTS: \n
%c[d_purple] • %c[ui_gray_2] глушитель НАТО\n \n</text>
</string>
<string id="st_wpn_mk14_descr_new">
<text>United States Navy Mark 14 Enhanced Battle Rifle (Mk 14 Enhanced Battle Rifle, «улучшенная боевая винтовка») - это американская марксманская винтовка, созданная силами специальных операций ВМФ США на основе винтовки М14. Используется рядом спецподразделений ВМФ, в том числе SEAL.\n \n
%c[ui_gray_2]ATTACHMENTS: \n
%c[d_purple] • %c[ui_gray_2] глушитель НАТО\n
%c[d_purple] • %c[ui_gray_2] прицелы ACOG, Barska ES AC10632, C-more Railway Tactical, «EOTech»\n \n</text>
</string>
</string_table>
@@ -1,39 +0,0 @@
function is_valid_wpn(wpn)
local section = wpn:section()
local has_tristate_reload = ini_sys:r_string_ex(section,"tri_state_reload")
-- Ignore weapons that are not jammed / at max ammo capacity
local casted_wpn = wpn:cast_Weapon()
if (not casted_wpn) or (not casted_wpn:IsMisfire() and casted_wpn:GetAmmoElapsed() == casted_wpn:GetAmmoMagSize()) then
return false
end
if has_tristate_reload then
if animation_common.has_animation(section, "anm_open_aim") then
return true
else
return false
end
else
if animation_common.has_animation(section, "anm_reload_aim") then
return true
else
return false
end
end
end
function on_before_key_press(key, bind, dis, flags)
if bind ~= key_bindings.kWPN_RELOAD then return end
local wpn = db.actor:item_in_slot(db.actor:active_slot())
if not wpn then return end
if not is_valid_wpn(wpn) then return end
wpn:switch_state(7)
flags.ret_value = false
end
function on_game_start()
if magazines then return end
RegisterScriptCallback("on_before_key_press", on_before_key_press)
end
@@ -1,125 +0,0 @@
-- Might want to extend this to track flags based on IDs since detectors have animations too
-- Likely overkill unless someone implements custom anims for them
FLAGS = {}
local active_flags = {}
-- Export: Flags
function get_flag(flag)
return active_flags[flag]
end
function set_flag(flag)
active_flags[flag] = true
end
function remove_flag(flag)
active_flags[flag] = nil
end
function add_flag(flag)
-- Exit early if it already exists
if FLAGS[flag] then return end
FLAGS[flag] = #FLAGS
end
local anim_mutators = {}
-- Export: Animation Mutators
function add_anim_mutator(functor, priority)
-- Add mutator func to list of mutators
table.insert(anim_mutators, {functor=functor, priority=priority})
-- Sort anim_mutators again
table.sort(anim_mutators, function(a,b) return a.priority < b.priority end)
end
function has_animation(section, anm)
local hud_section = ini_sys:r_string_ex(section,"hud") or section
return SYS_GetParam(0, hud_section, anm)
end
function mutate_anim(anm_table, anm_suffix, section)
local new_anm = anm_table.anm_name .. anm_suffix
if has_animation(section, new_anm) then
anm_table.anm_name = new_anm
return true
end
return false
end
-- Sounds
local sound_object_by_sec_by_path = {}
function get_safe_sound_object(path, sec)
assert(path, "path to sound file was nil")
assert(sec, "item section was nil")
if sound_object_by_sec_by_path[sec] == nil then
sound_object_by_sec_by_path[sec] = {}
end
local snd_obj = sound_object(path)
sound_object_by_sec_by_path[sec][path] = snd_obj
return snd_obj
end
function stop_all_sound_object(sec)
-- printf("stop_all_sound_object(sec): %s", sec)
for section, list in pairs(sound_object_by_sec_by_path) do
for path, v in pairs(list) do
if section == sec and v:playing() then
-- printf("sec: %s| Stopping: %s", sec, path)
v:stop()
end
end
sound_object_by_sec_by_path[sec] = nil
end
end
function get_sound_from_anm(anm_name) -- TODO: allow sound volume to be defined in config
return anm_name:gsub("anm_", "scripted_snd_")
end
-- Probably worth adding an ordered list of functions with conditions that can mutate anm_table
-- and use this script as source of truth for about-to-be-played animations since callback order is random between scripts
function actor_on_hud_animation_play(anm_table, item)
if not item then return end
stop_all_sound_object(item:section())
local section = item:section()
-- Execute each mutator functor in turn, ordered by priority
for i, mutator in ipairs(anim_mutators) do
local stop = mutator.functor(anm_table, item)
if stop then break end
end
-- Animation (No Mutation): Clear all flags if holstering weapon
if anm_table.anm_name == "anm_hide" or anm_table.anm_name == "anm_hide_empty" then
active_flags = {}
end
-- Sound: Check if weapon has a valid scripted sound in config
local anm_name = anm_table.anm_name
local snd_name = get_sound_from_anm(anm_name)
local snd_value = SYS_GetParam(0, section, snd_name)
if not snd_value then return end
local snd_values = str_explode(snd_value,",")
local snd_path = snd_values[1]
local never_cancel = snd_values[2]
-- Play sound
local snd_obj = get_safe_sound_object( snd_path, item:section() )
if not snd_obj then return end
if never_cancel then
snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0, 1.0)
else
snd_obj:play(db.actor, 0, sound_object.s2d)
end
end
function on_game_start()
RegisterScriptCallback("actor_on_hud_animation_play",actor_on_hud_animation_play)
end
@@ -1,169 +0,0 @@
local common = animation_common
valid_anims = {}
local mutate_anim = animation_common.mutate_anim
function animation_common.mutate_anim(anm_table, anm_suffix, section)
table.insert(valid_anims, anm_suffix)
return mutate_anim(anm_table, anm_suffix, section)
end
transitions = {
}
function add_strict_transition(hud_section, start_anm, end_anm, transition_anm)
if not (hud_section and start_anm and end_anm and transition_anm) then
printf("[ERROR] aol_anim_transitions: Could not add new transition (a parameter was nil)")
return
end
-- Make sure transitions is properly set as a table of tables
transitions[hud_section] = transitions[hud_section] or {}
transitions[hud_section][start_anm] = transitions[hud_section][start_anm] or {}
transitions[hud_section][start_anm][end_anm] = transition_anm
end
pattern_transitions = {
}
function add_pattern_transition(hud_section, start_anm, end_anm, transition_anm, priority)
priority = priority or 25565
if not (hud_section and start_anm and end_anm and transition_anm) then
printf("[ERROR] aol_anim_transitions: Could not add new transition (a parameter was nil)")
return
end
pattern_transitions[hud_section] = pattern_transitions[hud_section] or {}
table.insert(pattern_transitions[hud_section], {
["start_anm"] = start_anm,
["end_anm"] = end_anm,
["transition_anm"] = transition_anm,
["priority"] = priority
})
end
local ini_items = ini_file("system.ltx")
local function itr(section)
local is_hud_section = section:match('_hud$')
if is_hud_section then
local line_count = ini_items:line_count(section)
for i=0,line_count-1 do
local result, id, value = ini_items:r_line_ex(section,i,"","")
local is_strict_transition = id:match("^ts_strict_")
if is_strict_transition then
local anm_names = str_explode(value,",")
add_strict_transition(section, anm_names[1], anm_names[2], anm_names[3])
end
local is_pattern_transition = id:match("^ts_pattern_")
if is_pattern_transition then
local anm_names = str_explode(value,",")
add_pattern_transition(section, anm_names[1], anm_names[2], anm_names[3], anm_names[4])
end
end
end
return false
end
ini_items:section_for_each(itr)
table.sort(pattern_transitions, function(a,b) return a["priority"] < b["priority"] end)
local previous_anms = {}
function set_strict_transition(anm_table, hud_section)
-- Make sure item has transitions
local item_transitions = transitions[hud_section]
if not (item_transitions) then
-- previous_anms[hud_section] = anm_table.anm_name
return false
end
-- Make sure there is a previous anm to check
local start_anm = previous_anms[hud_section]
if not start_anm then
-- previous_anms[hud_section] = anm_table.anm_name
return false
end
-- Get transition anm from table
local end_anm = anm_table.anm_name
local transition_anm = item_transitions[start_anm] and item_transitions[start_anm][end_anm]
if not (transition_anm) then
-- previous_anms[hud_section] = anm_table.anm_name
return false
end
-- Re-add valid suffixes from previous mutations
for i, anm_suffix in ipairs(valid_anims) do
if animation_common.has_animation(hud_section, transition_anm .. anm_suffix) then
transition_anm = transition_anm .. anm_suffix
end
end
anm_table.anm_name = transition_anm
return true
end
function set_pattern_transition(anm_table, hud_section)
-- Make sure item has transitions
local item_transitions = pattern_transitions[hud_section]
if not item_transitions then
return false
end
-- Make sure there is a previous anm to check
local start_anm = previous_anms[hud_section]
if not start_anm then
-- previous_anms[hud_section] = anm_table.anm_name
return false
end
local end_anm = anm_table.anm_name
for _, transition in ipairs(item_transitions) do
local transition_anm = transition["transition_anm"]
-- Re-add valid suffixes from previous mutations
for i, anm_suffix in ipairs(valid_anims) do
if animation_common.has_animation(hud_section, transition_anm .. anm_suffix) then
transition_anm = transition_anm .. anm_suffix
end
end
if end_anm:match(transition["end_anm"]) and
start_anm:match(transition["start_anm"]) and
start_anm ~= transition_anm and
end_anm ~= transition_anm and
start_anm ~= end_anm then
anm_table.anm_name = transition_anm
return true
end
end
return false
end
function anm_transitions(anm_table, item)
-- printf("ITEM: " .. item:section() .. " | ANM: " .. anm_table.anm_name)
local hud_section = SYS_GetParam(0, item:section(), "hud", nil)
if not hud_section then
return
end
local has_strict_transition = set_strict_transition(anm_table, hud_section)
if not has_strict_transition then
set_pattern_transition(anm_table, hud_section)
end
-- Track now playing animation
previous_anms[hud_section] = anm_table.anm_name
-- Clear valid anims
valid_anims = {}
-- printf("ITEM: " .. item:section() .. " | ANM: " .. anm_table.anm_name)
end
function on_game_start()
common.add_anim_mutator(anm_transitions, 999)
end
@@ -1,47 +0,0 @@
-- The idea is to stop the walk2sprint animation if the player stops sprinting during the animation
-- Use my transition animations script as 'truth' for currently playing animation
-- Likely to break if multiple scripts are using actor_on_hud_animation_play, but should be good enough for transition animations specifically
local current_animation = ""
local stop_animation = false
-- Slightly cleaner string equivalence check which should ignore variants like _empty or _jammed
function isAnimationEqualTo(anim_name)
if current_animation:match(anim_name) then
return true
end
return false
end
aol_anim_transitions_anm_transitions = aol_anim_transitions.anm_transitions
function aol_anim_transitions.anm_transitions(anm_table, item)
local prev_name = anm_table.anm_name
aol_anim_transitions_anm_transitions(anm_table, item)
-- Restore original animation (probably idle) if previous animation was cancelled
-- This should prevent sprint2walk from playing if its counterpart walk2sprint was cancelled
if stop_animation then
stop_animation = false
if (isAnimationEqualTo("anm_walk2sprint") or isAnimationEqualTo("anm_sprint2walk")) then
anm_table.anm_name = prev_name
end
end
current_animation = anm_table.anm_name
end
-- Detect if the player is not sprinting during the walk2sprint animation
-- Firebreath: added the elseif in because sometimes the player stops sprint animation
-- when interrupted by small obstacles like stairs
function actor_on_movement_changed(num)
if stop_animation then return end
if (not IsMoveState("mcSprint") and isAnimationEqualTo("anm_walk2sprint")) then
stop_animation = true
game.stop_hud_motion()
elseif (IsMoveState("mcSprint") and isAnimationEqualTo("anm_sprint2walk")) then
stop_animation = true
game.stop_hud_motion()
end
end
function on_game_start()
RegisterScriptCallback("actor_on_movement_changed",actor_on_movement_changed)
end
@@ -1,58 +0,0 @@
common = animation_common
function block_shotgun_reload(anm_table, item)
-- Ignore weapons without unjam animation
if not common.has_animation(item:section(), "anm_reload_misfire") then
return
end
-- Exit early
if not (IsShotgun(item)
and anm_table.anm_name == "anm_open"
and item:cast_Weapon():IsMisfire()) then
return
end
-- Cancel shotgun reload
anm_table.anm_name = "$cancel"
-- Play unjam animation and sound
CreateTimeEvent("shotgun_unjam_fix", "start_unjam", 0.001, function(wpn)
wpn:play_hud_motion("anm_reload_misfire", true, 0, 1, 0)
-- Allow sound cancel if animation is interrupted
local sound_path = SYS_GetParam(0, wpn:section(), "snd_reload_misfire")
if sound_path then
local sound = common.get_safe_sound_object(sound_path, wpn:section())
sound:play(db.actor, 0, sound_object.s2d)
end
common.set_flag("SHOTGUN_UNJAM")
return true
end, item)
-- Stop checks for variants
return true
end
common.add_anim_mutator(block_shotgun_reload, -9999)
function actor_on_hud_animation_end(item,section,motion,state,slot)
-- Clear jam when unjam anim ends
if common.get_flag("SHOTGUN_UNJAM") then
item:cast_Weapon():SetMisfire(false)
common.remove_flag("SHOTGUN_UNJAM")
end
end
-- Stop unjam spam
function on_before_key_press(dik, bind, dis, flags)
if bind == key_bindings.kWPN_RELOAD
and common.get_flag("SHOTGUN_UNJAM") then
flags.ret_value = false
end
end
function on_game_start()
RegisterScriptCallback("actor_on_hud_animation_end",actor_on_hud_animation_end)
RegisterScriptCallback("on_before_key_press",on_before_key_press)
end
@@ -1,12 +0,0 @@
local common = animation_common
-- Animation: Append with '_ammoX' if weapon has X amount of ammo left
local function anm_ammo(anm_table, item)
local section = item:section()
local ammo_amount = item:get_ammo_in_magazine()
local suffix = "_ammo" .. ammo_amount
common.mutate_anim(anm_table, suffix, section)
end
common.add_anim_mutator(anm_ammo, 3.5)
@@ -1,126 +0,0 @@
local common = animation_common
-- Flags
common.add_flag("SHOTGUN_PUMP")
-------------------------------------------------
-- Animation Mutators
-------------------------------------------------
-- Animation: Append animation name with '_empty' if weapon is empty and has valid anim for it
local function anm_empty(anm_table, item)
local section = item:section()
if IsWeapon(item) and item.get_ammo_in_magazine then
local ammo = item:get_ammo_in_magazine()
-- check if weapon is empty
if ammo == 0 then
-- check if anim is defined in config
common.mutate_anim(anm_table, "_empty", section)
common.set_flag("SHOTGUN_PUMP")
end
end
end
common.add_anim_mutator(anm_empty, 1)
-- Animation: Append with '_g' if weapon has a grenade launcher and can fire a grenade
-- Append with '_w_gl' if weapon has a grenade launcher, but is not in GL mode (can fire bullets)
-- Append with '_alt' if weapon does not have a GL, but is in alt aim mode
local function anm_alt_modes(anm_table, item)
local section = item:section()
local alt = item:weapon_in_grenade_mode()
local has_gl = utils_item.has_attached_gl(item)
if alt and has_gl then
common.mutate_anim(anm_table, "_g", section)
elseif has_gl then
common.mutate_anim(anm_table, "_w_gl", section)
elseif alt then
common.mutate_anim(anm_table, "_alt", section)
end
end
common.add_anim_mutator(anm_alt_modes, 1.1)
-- Animation: Append with '_aim' is player is aiming down sights
local function anm_ads(anm_table, item)
local section = item:section()
local wpn = item:cast_Weapon()
if not wpn then return end
if wpn:IsZoomed() then
common.mutate_anim(anm_table, "_aim", section)
end
end
common.add_anim_mutator(anm_ads, 1.3)
-- Animation: Append with '_jammed' if weapon misfires (vanilla) or fails to eject (WPO)
-- Append with '_superjammed' if magazine needs to be removed before unjam (WPO)
local function anm_jammed(anm_table, item)
local section = item:section()
local jam_type = nil
-- Check for WPO jams
if arti_jamming then
local jam_status = arti_jamming.get_jam_status(item:id())
if jam_status == arti_jamming.JamType.FailureToEject then
jam_type = "_jammed"
elseif jam_status == arti_jamming.JamType.DoubleFeed then
jam_type = "_superjammed"
end
end
-- Check for vanilla jams (vanilla jams appear in anm_shots before WPO catches them)
if not jam_type then
local wpn = item:cast_Weapon()
if not wpn then return end
jam_type = item:cast_Weapon():IsMisfire() and "_jammed" or nil
end
if jam_type then
local success = common.mutate_anim(anm_table, jam_type, section)
-- Fallback to '_jammed' if '_superjammed' does not exist
if not success and jam_type == "_superjammed" then
common.mutate_anim(anm_table, jam_type, section)
end
end
end
common.add_anim_mutator(anm_jammed, 2)
-- Animation: Prepend with _pump if performing empty reload
local function anm_pump(anm_table, item)
local section = item:section()
if common.get_flag("SHOTGUN_PUMP") then
if anm_table.anm_name == "anm_close" then
common.mutate_anim(anm_table, "_pump", section)
-- Clear flag
common.remove_flag("SHOTGUN_PUMP")
end
end
end
common.add_anim_mutator(anm_pump, 3)
-- Animation: Randomly select between variants of the same animation
local function anm_variants(anm_table, item)
local section = item:section()
local variants = {anm_table.anm_name}
local i = 2
while (true) do
local anm_variant = anm_table.anm_name .. "_variant" .. (i-1)
if common.has_animation(section, anm_variant) then
variants[i] = "_variant" .. (i-1)
else
break
end
i = i + 1
end
if #variants > 1 then
local rand_i = random_number(1, #variants)
common.mutate_anim(anm_table, variants[rand_i], section)
end
end
common.add_anim_mutator(anm_variants, 4)
-------------------------------------------------
-- Callbacks
-------------------------------------------------
function on_game_start()
end
@@ -1,10 +0,0 @@
-- Clear jam mid animation with motion marks
function actor_on_hud_animation_mark(state, mark)
if mark == "clear_jam" then
db.actor:active_item():cast_Weapon():SetMisfire(false)
end
end
function on_game_start()
RegisterScriptCallback("actor_on_hud_animation_mark",actor_on_hud_animation_mark)
end
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -1,11 +1,11 @@
[General]
gameName=stalkeranomaly
modid=0
version=d2024.3.12.0
version=d2024.4.3.0
newestVersion=
category="5,"
nexusFileStatus=1
installationFile=M14_Reanimation1.3.zip
installationFile=M14_Reanimation1.4.1.2.zip
repository=Nexus
ignoredVersion=
comments=