1711 lines
62 KiB
Plaintext
1711 lines
62 KiB
Plaintext
--[[ ----------------------------------------------------------------------------------------------
|
|
Ïëàòôîðìû: CoP 1.6.2
|
|
Îïèñàíèå : Íîãè îò 1-ãî ëèöà
|
|
Ïîääåðæêà: 2013 © Shoker Mod
|
|
Àâòîðû : Shoker, ÐèêîøåÒ
|
|
Äàòà : 31.08.2013ã
|
|
|
|
Ported from Shoker Weapon Mod 2.1, modified by Wang_Laoshi aka Ethereal to work with Anomaly mod. Thanks a lot to the original creators of this mod - Shoker, ÐèêîøåÒ and SWM Team in general.
|
|
--]] ----------------------------------------------------------------------------------------------
|
|
|
|
local disabled = false
|
|
local hidden = false
|
|
local hide_legs_low_crouch
|
|
local last_pos_x
|
|
local last_pos_z
|
|
local cdir
|
|
local pos_set
|
|
local lean_reset = false
|
|
local step_sound
|
|
local toggle_turn_step_sound
|
|
local turn_step_sound_volume
|
|
local use_hd_models
|
|
local demo_active
|
|
local freelook_hold
|
|
local freelook_toggle_on
|
|
local swm_current_outfit = {}
|
|
local sprint_to_jog_thresold = 1.8
|
|
local jog_to_walk_thresold = 1.4
|
|
local exo_flag = false
|
|
--local blood_cnt = 0
|
|
--local blood_cnt_max = 6
|
|
--local dirt_cnt = 0
|
|
--local dirt_cnt_max = 8
|
|
local idle_was_played = false
|
|
local ext_body_id
|
|
local chance = 0
|
|
idle_sound = ""
|
|
enable_idle_anims = true
|
|
idle_anim_min_cooldown = 3000
|
|
idle_anim_max_cooldown = 120000
|
|
idle_anim_name = ""
|
|
tmr_a = 0
|
|
idle_cooldown = 3000
|
|
idle_play_time = 2000
|
|
idle_anim_random = 0
|
|
idle_tm = 1499
|
|
last_idle_tm = 2003
|
|
can_play = false
|
|
idle_pause_rnd = 0
|
|
|
|
-- local models_path = "gamedata\\meshes\\sm\\actor_legs"
|
|
-- local models_path_hd = "meshes\\sm\\actor_legs\\hd"
|
|
|
|
--<!> ×òîáû êàìåðà ñëèøêîì ñèëüíî íå âõîäèëà â íîãè, íóæíî â system.ltx ïîïðàâèòü ìàêñ. óãëû ïîâîðîòà â actor_firsteye_cam è actor_ladder_cam
|
|
|
|
local HEIGHT = 0.0 --> Ñìåùåíèå ïîçèöèè íîã îò èãðîêà ïî Y
|
|
local HEIGHT_ladder = -0.1 --> Ñìåùåíèå ïîçèöèè íîã îò èãðîêà ïî Y
|
|
local HIDE_DISTANCE = 2 --> Ðàññòîÿíèå êàìåðû äî ãîëîâû, äàëüøå êîòîðîãî ñêðûâàåì íîãè
|
|
local RSPN_DISTANCE = 5 --> Ðàññòîÿíèå îò èãðîêà äî íîã, íà êîòîðîì ðåñïàâíèì íîãè
|
|
local DISTANCE_MOD_FWD = -0.65 --> Ñäâèã ìîäåëè îò èãðîêà âïåð¸ä\íàçàä â ìåòðàõ
|
|
local DISTANCE_MOD_FWD_NONCOMBAT = -0.5
|
|
local DISTANCE_MOD_RGT = 0.0 --> Ñäâèã ìîäåëè îò èãðîêà âëåâî\âïðàâî â ìåòðàõ
|
|
|
|
local LEGS_SECTION = "actor_legs" --> Ñåêöèÿ íîã
|
|
local DEFAULT_LEGS = _u.ltx(LEGS_SECTION, "visual", "str") --> Äåôîëòíàÿ ìîäåëü íîã
|
|
local DISABLED_FLAGS = { [7] = 64, [14] = 8192, [15] = 16384 } --> Êîäû çàáëîêèðîâàííûõ ôëàãîâ (÷òîáû íå äóáëèðîâàòü âñþ òàáëèöó ïî 2 ðàçà ðàäè íàêëîíîâ âëåâî\âïðàâî)
|
|
|
|
local SPEC_SHIFT = { --> Óíèêàëüíûå ñìåùåíèÿ äëÿ îòäåëüíûõ àíèìàöèé
|
|
["lancew_legs_ladder_idle"] = {fwd = -0.3, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_ladder_down"] = {fwd = -0.3, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_ladder_up"] = {fwd = -0.3, rgt = DISTANCE_MOD_RGT},
|
|
["leg_ladder_idle"] = {fwd = -0.15, rgt = DISTANCE_MOD_RGT},
|
|
["leg_ladder_up"] = {fwd = -0.15, rgt = DISTANCE_MOD_RGT},
|
|
["leg_ladder_down"] = {fwd = -0.15, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_sprint"] = {fwd = -0.65, rgt = DISTANCE_MOD_RGT},
|
|
-- ["lancew_legs_moving_fl"] = {fwd = -0.64, rgt = DISTANCE_MOD_RGT},
|
|
-- ["lancew_legs_moving_fr"] = {fwd = -0.54, rgt = DISTANCE_MOD_RGT},
|
|
}
|
|
|
|
local SPEC_SHIFT_PRONE = {
|
|
["lancew_legs_idle_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_jump_start_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_jump_idle_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_fl_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_fr_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_fr_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_b_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_bl_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_l_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
["lancew_legs_walk_r_sc"] = {fwd = -1.5, rgt = DISTANCE_MOD_RGT},
|
|
|
|
}
|
|
|
|
local SPEC_SHIFT_BY_VISUAL = {
|
|
["specops_outfit_legs_hd"] = {fwd = -0.8, rgt = DISTANCE_MOD_RGT}
|
|
}
|
|
|
|
local no_dirt_radius = {
|
|
--dead city
|
|
["cit_killers"] = 51,
|
|
["cit_killers_vs_bandits"] = 41,
|
|
--pripyat
|
|
["pri_monolith"] = 37,
|
|
["mlr_terrain"] = 35,
|
|
--pripyat outskirts
|
|
["pri_a18_smart_terrain"] = 27,
|
|
["pri_a16_mlr_copy"] = 15,
|
|
["pri_a16"] = 20,
|
|
["pri_a17"] = 20,
|
|
--mil warehouse
|
|
["mil_smart_terrain_7_10"] = 51,
|
|
["mil_smart_terrain_7_7"] = 71,
|
|
["mil_smart_terrain_7_12"] = 60,
|
|
["mil_smart_terrain_7_8"] = 56,
|
|
--yantar
|
|
["yan_smart_terrain_6_4"] = 51,
|
|
--agroprom
|
|
["agr_smart_terrain_1_6_near_1"] = 62,
|
|
["agr_smart_terrain_1_6_near_2"] = 74,
|
|
["agr_smart_terrain_1_6"] = 61,
|
|
["agr_smart_terrain_4_4_near_2"] = 25,
|
|
["agr_smart_terrain_4_4_near_3"] = 34,
|
|
["agr_smart_terrain_4_4_near_1"] = 31,
|
|
["agr_smart_terrain_4_4"] = 45,
|
|
--garbage
|
|
["gar_smart_terrain_3_5"] = 60,
|
|
["gar_smart_terrain_5_2"] = 36,
|
|
--dark valley
|
|
["val_smart_terrain_7_4"] = 41,
|
|
["val_smart_terrain_7_3"] = 55,
|
|
["val_smart_terrain_7_5"] = 39,
|
|
["val_smart_terrain_8_6"] = 25,
|
|
--darkscape
|
|
["ds2_domik_st"] = 51,
|
|
--escape
|
|
["esc_smart_terrain_5_7"] = 43,
|
|
["esc_smart_terrain_2_12"] = 67,
|
|
--marsh
|
|
["mar_smart_terrain_10_5"] = 51,
|
|
["mar_smart_terrain_3_3"] = 31,
|
|
["mar_smart_terrain_doc"] = 11,
|
|
["mar_smart_terrain_base"] = 36,
|
|
--zaton
|
|
["zat_stalker_base_smart"] = 27,
|
|
["zat_b18"] = 12,
|
|
["zat_a23_smart_terrain"] = 80,
|
|
["zat_b40_smart_terrain"] = 33,
|
|
-- jupiter
|
|
["jup_a6"] = 25,
|
|
["depo_terrain"] = 50,
|
|
["jup_b41"] = 17,
|
|
["jup_b208"] = 50,
|
|
-- bar
|
|
["bar_zastava"] = 51,
|
|
["bar_visitors"] = 60,
|
|
["bar_zastava_2"] = 60,
|
|
["bar_dolg_general"] = 70,
|
|
["bar_dolg_bunker"] = 70,
|
|
-- red forest
|
|
["red_smart_terrain_3_2"] = 70,
|
|
}
|
|
|
|
visual_armor_upg_supported = {
|
|
["novice_outfit_legs_hd"] = true,
|
|
["cs_novice_outfit_legs_hd"] = true,
|
|
["ecolog_outfit_blue_legs_hd"] = true,
|
|
["ecolog_outfit_green_legs_hd"] = true,
|
|
["ecolog_outfit_orange_legs_hd"] = true,
|
|
["ecolog_outfit_red_legs_hd"] = true,
|
|
["ecolog_outfit_white_legs_hd"] = true,
|
|
["ecolog_outfit_yello_legs_hd"] = true
|
|
}
|
|
|
|
function is_calm_state()
|
|
|
|
local item_in_hands = db.actor:active_item()
|
|
if (item_in_hands == nil or not IsWeapon(item_in_hands) or game.actor_weapon_lowered()) and (is_empty(xr_combat_ignore.fighting_with_actor_npcs)) then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
|
|
end
|
|
|
|
function is_slowed_down()
|
|
|
|
local run_speed = db.actor:get_actor_run_coef()
|
|
local runback_speed = db.actor:get_actor_runback_coef()
|
|
local sprint_speed = db.actor:get_actor_sprint_koef()
|
|
|
|
-- news_manager.send_tip(db.actor, "RUN " .. run_speed, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
-- news_manager.send_tip(db.actor, "RUNBACK " .. runback_speed, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
-- news_manager.send_tip(db.actor, "SPRINT " .. sprint_speed, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
|
|
if run_speed <= jog_to_walk_thresold or sprint_speed <= sprint_to_jog_thresold then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
|
|
end
|
|
|
|
local actor_flags = {} --> Ðàçîáðàíûé ïîáàéòíî ôëàã ñîñòîÿíèÿ òåëà èãðîêà
|
|
|
|
--[[
|
|
1 - âïåð¸ä (1)
|
|
2 - íàçàä (2)
|
|
3 - âëåâî (4)
|
|
4 - âïðàâî (8)
|
|
5 - ïðèñåäàíèå (16)
|
|
6 - êðàñòüñÿ (32)
|
|
7 - ïîâîðîðò ÒÅËÀ âáîê? (64) --> Íàïðàâëåíèå ïîâîðîòà íå õðàíèò
|
|
8 - ïðûæîê (ñòàðò) (128)
|
|
9 - ïðûæîê (ïîë¸ò) (256)
|
|
10 - ïðûæîê (ïðèçåìëåíèå) (512)
|
|
11 - (1024)
|
|
12 - ëåñòíèöà (2048)
|
|
13 - áåã (4096)
|
|
14 - íàêëîí âëåâî (8192)
|
|
15 - íàêëîí âïðàâî (16384)
|
|
16 - (32768)
|
|
]]
|
|
|
|
local AnimTable_SlowedDown = {
|
|
[1+4096] = "lancew_legs_moving", --> Áåã ->
|
|
[1+4+4096] = "lancew_legs_moving_fl", --> Áåã+âëåâî
|
|
[1+8+4096] = "lancew_legs_moving_fr", --> Áåã+âïðàâî
|
|
|
|
[1] = "leg_stand_walk_fwd", --> Âïåð¸ä
|
|
[1+4] = "leg_stand_walk_fwd_left", --> Âïåð¸ä+Âëåâî
|
|
[1+8] = "leg_stand_walk_fwd_right", --> Âïåð¸ä+Âïðàâî
|
|
[1+16] = "lancew_legs_moving_c", --> Âïåð¸ä (ctrl)
|
|
[1+4+16] = "lancew_legs_moving_fl_c", --> Âïåð¸ä+Âëåâî (ctrl)
|
|
[1+8+16] = "lancew_legs_moving_fr_c", --> Âïåð¸ä+Âïðàâî (ctrl)
|
|
|
|
[2] = "leg_stand_walk_back_shift", --> Íàçàä
|
|
[2+4] = "leg_stand_walk_back_left_shift", --> Íàçàä+Âëåâî
|
|
[2+8] = "leg_stand_walk_back_right_shift", --> Íàçàä+Âïðàâî
|
|
[2+16] = "lancew_legs_moving_b_c", --> Íàçàä (ctrl)
|
|
[2+4+16] = "lancew_legs_moving_bl_c", --> Íàçàä+Âëåâî (ctrl)
|
|
[2+8+16] = "lancew_legs_moving_br_c", --> Íàçàä+Âïðàâî (ctrl)
|
|
|
|
[4] = "leg_stand_walk_left_shift", --> Âëåâî
|
|
[4+16] = "lancew_legs_moving_l_c", --> Âëåâî (ctrl)
|
|
|
|
[8] = "leg_stand_walk_right_shift", --> Âïðàâî
|
|
[8+16] = "lancew_legs_moving_r_c", --> Âïðàâî (ctrl)
|
|
}
|
|
|
|
local AnimTable_NonCombat = {
|
|
[0] = "leg_stand_idle", --> Ñòîèì
|
|
[0+32] = "leg_stand_idle", --> Ñòîèì (shift)
|
|
|
|
[1+32] = "leg_stand_walk_fwd_shift", --> Âïåð¸ä (shift)
|
|
[1+4+32] = "leg_stand_walk_fwd_left_shift", --> Âïåð¸ä+Âëåâî (shift)
|
|
[1+8+32] = "leg_stand_walk_fwd_right_shift", --> Âïåð¸ä+Âïðàâî (shift)
|
|
|
|
[2+32] = "leg_stand_walk_back_shift", --> Íàçàä (shift)
|
|
[2+4+32] = "leg_stand_walk_back_left_shift", --> Íàçàä+Âëåâî (shift)
|
|
[2+8+32] = "leg_stand_walk_back_right_shift", --> Íàçàä+Âïðàâî (shift)
|
|
|
|
[8+32] = "leg_stand_walk_right_shift", --> Âïðàâî (shift)
|
|
[4+32] = "leg_stand_walk_left_shift", --> Âëåâî (shift)
|
|
|
|
[0+16] = "leg_crouch_idle", --> Ñòîèì (ctrl)
|
|
[1+16] = "leg_crouch_walk_fwd", --> Âïåð¸ä (ctrl)
|
|
[1+4+16] = "lancew_legs_moving_fl_c", --> Âïåð¸ä+Âëåâî (ctrl)
|
|
[1+8+16] = "lancew_legs_moving_fr_c", --> Âïåð¸ä+Âïðàâî (ctrl)
|
|
|
|
[2+16] = "leg_crouch_walk_back", --> Íàçàä (ctrl)
|
|
[2+4+16] = "lancew_legs_moving_bl_c", --> Íàçàä+Âëåâî (ctrl)
|
|
[2+8+16] = "lancew_legs_moving_br_c", --> Íàçàä+Âïðàâî (ctrl)
|
|
|
|
[4+16] = "leg_crouch_walk_left", --> Âëåâî (ctrl)
|
|
[8+16] = "leg_crouch_walk_right", --> Âïðàâî (ctrl)
|
|
}
|
|
|
|
local AnimTable_Basic = { --\\ Òàáëèöà ñîîòâåòñòâèÿ êîäîâ òåëà àíèìàöèÿì. [0] = "lancew_legs_idle", --> Ñòîèì
|
|
[0] = "lancew_legs_idle", --> Ñòîèì
|
|
[0+16] = "lancew_legs_idle_c", --> Ñòîèì (ctrl)
|
|
[0+32] = "lancew_legs_idle", --> Ñòîèì (shift)
|
|
[0+16+32] = "lancew_legs_idle_sc", --> Ñòîèì (ctrl+shift)
|
|
|
|
[1+4096] = "lancew_legs_sprint", --> Áåã
|
|
[1+4+4096] = "lancew_legs_moving_fl", --> Áåã+âëåâî
|
|
[1+8+4096] = "lancew_legs_moving_fr", --> Áåã+âïðàâî
|
|
|
|
[128] = "lancew_legs_jump_start", --> Ïðûæîê (Ñòàðò)
|
|
[256] = "lancew_legs_jump_idle", --> Ïðûæîê (Ïîë¸ò)
|
|
[512] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)
|
|
[128+16] = "lancew_legs_jump_start", --> Ïðûæîê (Ñòàðò)(ctrl)
|
|
[256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê (Ïîë¸ò)(ctrl)
|
|
[512+16] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(ctrl)
|
|
[128+32] = "lancew_legs_jump_start", --> Ïðûæîê (Ñòàðò)(shift)
|
|
[256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê (Ïîë¸ò)(shift)
|
|
[512+32] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(shift)
|
|
[128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê (Ñòàðò)(ctrl+shift)
|
|
[256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê (Ïîë¸ò)(ctrl+shift)
|
|
[512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[128+16] = "lancew_legs_jump_start", --> Ïðûæîê (Ñòàðò)(ctrl)
|
|
[256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê (Ïîë¸ò)(ctrl)
|
|
[512+16] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(ctrl)
|
|
[128+32] = "lancew_legs_jump_start", --> Ïðûæîê (Ñòàðò)(shift)
|
|
[256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê (Ïîë¸ò)(shift)
|
|
[512+32] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(shift)
|
|
[128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê (Ñòàðò)(ctrl+shift)
|
|
[256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê (Ïîë¸ò)(ctrl+shift)
|
|
[512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[1+128] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)
|
|
[1+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)
|
|
[1+512] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)
|
|
[1+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)(ctrl)
|
|
[1+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)(ctrl)
|
|
[1+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)(ctrl)
|
|
[1+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)(shift)
|
|
[1+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)(shift)
|
|
[1+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)(shift)
|
|
[1+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)(ctrl+shift)
|
|
[1+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)(ctrl+shift)
|
|
[1+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[2+128] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä (Ñòàðò)
|
|
[2+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Íàçàä (Ïîë¸ò)
|
|
[2+512] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)
|
|
[2+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä (Ñòàðò)(ctrl)
|
|
[2+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Íàçàä (Ïîë¸ò)(ctrl)
|
|
[2+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)(ctrl)
|
|
[2+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä (Ñòàðò)(shift)
|
|
[2+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Íàçàä (Ïîë¸ò)(shift)
|
|
[2+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)(shift)
|
|
[2+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Íàçàä (Ñòàðò)(ctrl+shift)
|
|
[2+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Íàçàä (Ïîë¸ò)(ctrl+shift)
|
|
[2+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[4+128] = "lancew_legs_jump_start", --> Ïðûæîê+Âëåâî (Ñòàðò)
|
|
[4+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Âëåâî (Ïîë¸ò)
|
|
[4+512] = "lancew_legs_jump_end", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)
|
|
[4+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Âëåâî (Ñòàðò)(ctrl)
|
|
[4+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âëåâî (Ïîë¸ò)(ctrl)
|
|
[4+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)(ctrl)
|
|
[4+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Âëåâî (Ñòàðò)(shift)
|
|
[4+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âëåâî (Ïîë¸ò)(shift)
|
|
[4+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)(shift)
|
|
[4+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Âëåâî (Ñòàðò)(ctrl+shift)
|
|
[4+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Âëåâî (Ïîë¸ò)(ctrl+shift)
|
|
[4+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[8+128] = "lancew_legs_jump_start", --> Ïðûæîê+Âïðàâî (Ñòàðò)
|
|
[8+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)
|
|
[8+512] = "lancew_legs_jump_end", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)
|
|
[8+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Âïðàâî (Ñòàðò)(ctrl)
|
|
[8+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)(ctrl)
|
|
[8+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)(ctrl)
|
|
[8+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Âïðàâî (Ñòàðò)(shift)
|
|
[8+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)(shift)
|
|
[8+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)(shift)
|
|
[8+128+16+32] = "lancew_legs_jump_start", --> Ïðûæîê+Âïðàâî (Ñòàðò)(ctrl+shift)
|
|
[8+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)(ctrl+shift)
|
|
[8+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[1+4+128] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)
|
|
[1+4+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)
|
|
[1+4+512] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)
|
|
[1+4+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)(ctrl)
|
|
[1+4+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)(ctrl)
|
|
[1+4+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)(ctrl)
|
|
[1+4+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)(shift)
|
|
[1+4+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)(shift)
|
|
[1+4+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)(shift)
|
|
[1+4+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)(ctrl+shift)
|
|
[1+4+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)(ctrl+shift)
|
|
[1+4+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[1+8+128] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)
|
|
[1+8+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)
|
|
[1+8+512] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)
|
|
[1+8+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)(ctrl)
|
|
[1+8+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)(ctrl)
|
|
[1+8+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)(ctrl)
|
|
[1+8+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)(shift)
|
|
[1+8+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)(shift)
|
|
[1+8+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)(shift)
|
|
[1+8+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)(ctrl+shift)
|
|
[1+8+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)(ctrl+shift)
|
|
[1+8+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[2+4+128] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)
|
|
[2+4+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)
|
|
[2+4+512] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)
|
|
[2+4+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)(ctrl)
|
|
[2+4+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)(ctrl)
|
|
[2+4+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)(ctrl)
|
|
[2+4+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)(shift)
|
|
[2+4+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)(shift)
|
|
[2+4+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)(shift)
|
|
[2+4+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)(ctrl+shift)
|
|
[2+4+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)(ctrl+shift)
|
|
[2+4+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[2+8+128] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)
|
|
[2+8+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)
|
|
[2+8+512] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)
|
|
[2+8+128+16] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)(ctrl)
|
|
[2+8+256+16] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)(ctrl)
|
|
[2+8+512+16] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)(ctrl)
|
|
[2+8+128+32] = "lancew_legs_jump_start", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)(shift)
|
|
[2+8+256+32] = "lancew_legs_jump_idle_c", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)(shift)
|
|
[2+8+512+32] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)(shift)
|
|
[2+8+128+16+32] = "lancew_legs_jump_start_sc", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)(ctrl+shift)
|
|
[2+8+256+16+32] = "lancew_legs_jump_idle_sc", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)(ctrl+shift)
|
|
[2+8+512+16+32] = "lancew_legs_jump_end", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
[4096+128] = "lancew_legs_jump_start", --> Ïðûæîê+Áåã (Ñòàðò)
|
|
[4096+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Áåã (Ïîë¸ò)
|
|
[4096+512] = "lancew_legs_jump_end", --> Ïðûæîê+Áåã (Ïðèçåìëåíèå)
|
|
[1+4096+128] = "lancew_legs_jump_start", --> Ïðûæîê+Áåã (Ñòàðò)
|
|
[1+4096+256] = "lancew_legs_jump_idle", --> Ïðûæîê+Áåã (Ïîë¸ò)
|
|
[1+4096+512] = "lancew_legs_jump_end", --> Ïðûæîê+Áåã (Ïðèçåìëåíèå)
|
|
|
|
[1] = "lancew_legs_moving", --> Âïåð¸ä
|
|
[1+4] = "lancew_legs_moving_fl", --> Âïåð¸ä+Âëåâî
|
|
[1+8] = "lancew_legs_moving_fr", --> Âïåð¸ä+Âïðàâî
|
|
[1+16] = "lancew_legs_moving_c", --> Âïåð¸ä (ctrl)
|
|
[1+4+16] = "lancew_legs_moving_fl_c", --> Âïåð¸ä+Âëåâî (ctrl)
|
|
[1+8+16] = "lancew_legs_moving_fr_c", --> Âïåð¸ä+Âïðàâî (ctrl)
|
|
[1+32] = "lancew_legs_walk", --> Âïåð¸ä (shift)
|
|
[1+4+32] = "lancew_legs_walk_l", --> Âïåð¸ä+Âëåâî (shift)
|
|
[1+8+32] = "lancew_legs_walk_r", --> Âïåð¸ä+Âïðàâî (shift)
|
|
[1+16+32] = "lancew_legs_walk_sc", --> Âïåð¸ä (ctrl+shift)
|
|
[1+4+16+32] = "lancew_legs_walk_fl_sc", --> Âïåð¸ä+Âëåâî (ctrl+shift)
|
|
[1+8+16+32] = "lancew_legs_walk_fr_sc", --> Âïåð¸ä+Âïðàâî (ctrl+shift)
|
|
|
|
[2] = "lancew_legs_moving_b", --> Íàçàä
|
|
[2+4] = "lancew_legs_moving_bl", --> Íàçàä+Âëåâî
|
|
[2+8] = "lancew_legs_moving_br", --> Íàçàä+Âïðàâî
|
|
[2+16] = "lancew_legs_moving_b_c", --> Íàçàä (ctrl)
|
|
[2+4+16] = "lancew_legs_moving_bl_c", --> Íàçàä+Âëåâî (ctrl)
|
|
[2+8+16] = "lancew_legs_moving_br_c", --> Íàçàä+Âïðàâî (ctrl)
|
|
[2+32] = "lancew_legs_walk_b", --> Íàçàä (shift)
|
|
[2+4+32] = "lancew_legs_walk_bl", --> Íàçàä+Âëåâî (shift)
|
|
[2+8+32] = "lancew_legs_walk_br", --> Íàçàä+Âïðàâî (shift)
|
|
[2+16+32] = "lancew_legs_walk_b_sc", --> Íàçàä (ctrl+shift)
|
|
[2+4+16+32] = "lancew_legs_walk_bl_sc", --> Íàçàä+Âëåâî (ctrl+shift)
|
|
[2+8+16+32] = "lancew_legs_walk_br_sc", --> Íàçàä+Âïðàâî (ctrl+shift)
|
|
|
|
[4] = "lancew_legs_moving_l", --> Âëåâî
|
|
[4+16] = "lancew_legs_moving_l_c", --> Âëåâî (ctrl)
|
|
[4+32] = "lancew_legs_walk_l", --> Âëåâî (shift)
|
|
[4+16+32] = "lancew_legs_walk_l_sc", --> Âëåâî (ctrl+shift)
|
|
|
|
[8] = "lancew_legs_moving_r", --> Âïðàâî
|
|
[8+16] = "lancew_legs_moving_r_c", --> Âïðàâî (ctrl)
|
|
[8+32] = "lancew_legs_walk_r", --> Âïðàâî (shift)
|
|
[8+16+32] = "lancew_legs_walk_r_sc", --> Âïðàâî (ctrl+shift)
|
|
|
|
[2048] = "leg_ladder_idle", --> Áîëòàåìñÿ íà ëåñòíèöå
|
|
[2048+1] = "leg_ladder_up", --> Äâèãàåìñÿ ïî ëåñòíèöå ââåðõ
|
|
[2048+2] = "leg_ladder_up", --> Äâèãàåìñÿ ïî ëåñòíèöå âíèç
|
|
[2048+32] = "leg_ladder_idle", --> Áîëòàåìñÿ íà ëåñòíèöå
|
|
[2048+1+32] = "leg_ladder_up", --> Äâèãàåìñÿ ïî ëåñòíèöå ââåðõ
|
|
[2048+2+32] = "leg_ladder_up", --> Äâèãàåìñÿ ïî ëåñòíèöå âíèç
|
|
}
|
|
|
|
-- TEST!!!
|
|
local AnimTable_BasicTEST = { --\\ Òàáëèöà ñîîòâåòñòâèÿ êîäîâ òåëà àíèìàöèÿì. [0] = "leg_stand_idle", --> Ñòîèì
|
|
|
|
-- Idles
|
|
|
|
[0] = "leg_stand_idle", --> Ñòîèì
|
|
[0+16] = "leg_crouch_idle", --> Ñòîèì (ctrl)
|
|
[0+32] = "leg_stand_idle", --> Ñòîèì (shift)
|
|
--[0+16+32] = "leg_stand_idle", --> Ñòîèì (ctrl+shift)
|
|
|
|
-- Stand Run
|
|
|
|
[1+4096] = "leg_stand_run_fwd", --> Áåã
|
|
[1+4+4096] = "leg_stand_run_left", --> Áåã+âëåâî
|
|
[1+8+4096] = "leg_stand_run_right", --> Áåã+âïðàâî
|
|
|
|
-- Jump
|
|
|
|
[128] = "leg_stand_jump_begin", --> Ïðûæîê (Ñòàðò)
|
|
[256] = "leg_stand_jump_idle", --> Ïðûæîê (Ïîë¸ò)
|
|
[512] = "leg_stand_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)
|
|
|
|
-- Jump (Ctrl)
|
|
|
|
[128+16] = "leg_stand_jump_begin", --> Ïðûæîê (Ñòàðò)(ctrl)
|
|
[256+16] = "leg_stand_jump_idle", --> Ïðûæîê (Ïîë¸ò)(ctrl)
|
|
[512+16] = "leg_stand_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump (Shift)
|
|
|
|
[128+32] = "leg_stand_jump_begin", --> Ïðûæîê (Ñòàðò)(shift)
|
|
[256+32] = "leg_stand_jump_idle", --> Ïðûæîê (Ïîë¸ò)(shift)
|
|
[512+32] = "leg_stand_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump (Ctrl+Shift)
|
|
|
|
[128+16+32] = "leg_stand_jump_begin", --> Ïðûæîê (Ñòàðò)(ctrl+shift)
|
|
[256+16+32] = "leg_stand_jump_idle", --> Ïðûæîê (Ïîë¸ò)(ctrl+shift)
|
|
[512+16+32] = "leg_stand_jump_end", --> Ïðûæîê (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Forward
|
|
|
|
[1+128] = "leg_stand_jump_fwd_begin", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)
|
|
[1+256] = "leg_stand_jump_fwd_idle", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)
|
|
[1+512] = "leg_stand_jump_fwd_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Forward (Ctrl)
|
|
|
|
[1+128+16] = "leg_stand_jump_fwd_begin", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)(ctrl)
|
|
[1+256+16] = "leg_stand_jump_fwd_idle", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)(ctrl)
|
|
[1+512+16] = "leg_stand_jump_fwd_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Forward (Shift)
|
|
|
|
[1+128+32] = "leg_stand_jump_fwd_begin", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)(shift)
|
|
[1+256+32] = "leg_stand_jump_fwd_idle", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)(shift)
|
|
[1+512+32] = "leg_stand_jump_fwd_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Forward (Ctrl+Shift)
|
|
|
|
[1+128+16+32] = "leg_stand_jump_fwd_begin", --> Ïðûæîê+Âïåð¸ä (Ñòàðò)(ctrl+shift)
|
|
[1+256+16+32] = "leg_stand_jump_fwd_idle", --> Ïðûæîê+Âïåð¸ä (Ïîë¸ò)(ctrl+shift)
|
|
[1+512+16+32] = "leg_stand_jump_fwd_end", --> Ïðûæîê+Âïåð¸ä (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Back
|
|
|
|
[2+128] = "leg_stand_jump_back_begin", --> Ïðûæîê+Íàçàä (Ñòàðò)
|
|
[2+256] = "leg_stand_jump_back_idle", --> Ïðûæîê+Íàçàä (Ïîë¸ò)
|
|
[2+512] = "leg_stand_jump_end", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Back (Ctrl)
|
|
|
|
[2+128+16] = "leg_stand_jump_back_begin", --> Ïðûæîê+Íàçàä (Ñòàðò)(ctrl)
|
|
[2+256+16] = "leg_stand_jump_back_idle", --> Ïðûæîê+Íàçàä (Ïîë¸ò)(ctrl)
|
|
[2+512+16] = "leg_stand_jump_end", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Back (Shift)
|
|
|
|
[2+128+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä (Ñòàðò)(shift)
|
|
[2+256+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä (Ïîë¸ò)(shift)
|
|
[2+512+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Back (Ctrl+Shift)
|
|
|
|
[2+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä (Ñòàðò)(ctrl+shift)
|
|
[2+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä (Ïîë¸ò)(ctrl+shift)
|
|
[2+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Left
|
|
|
|
[4+128] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ñòàðò)
|
|
[4+256] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïîë¸ò)
|
|
[4+512] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Left (Ctrl)
|
|
|
|
[4+128+16] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ñòàðò)(ctrl)
|
|
[4+256+16] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïîë¸ò)(ctrl)
|
|
[4+512+16] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Left (Shift)
|
|
|
|
[4+128+32] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ñòàðò)(shift)
|
|
[4+256+32] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïîë¸ò)(shift)
|
|
[4+512+32] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Left (Ctrl+Shift)
|
|
|
|
[4+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ñòàðò)(ctrl+shift)
|
|
[4+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïîë¸ò)(ctrl+shift)
|
|
[4+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Âëåâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Right
|
|
|
|
[8+128] = "leg_stand_walk_right", --> Ïðûæîê+Âïðàâî (Ñòàðò)
|
|
[8+256] = "leg_stand_jump_right_idle", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)
|
|
[8+512] = "leg_stand_jump_right_end", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Right (Ctrl)
|
|
|
|
[8+128+16] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ñòàðò)(ctrl)
|
|
[8+256+16] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)(ctrl)
|
|
[8+512+16] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Right (Shift)
|
|
|
|
[8+128+32] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ñòàðò)(shift)
|
|
[8+256+32] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)(shift)
|
|
[8+512+32] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Right (Ctrl+Shift)
|
|
|
|
[8+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ñòàðò)(ctrl+shift)
|
|
[8+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ïîë¸ò)(ctrl+shift)
|
|
[8+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïðàâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Forward+Left
|
|
|
|
[1+4+128] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)
|
|
[1+4+256] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)
|
|
[1+4+512] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Forward+Left (Ctrl)
|
|
|
|
[1+4+128+16] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)(ctrl)
|
|
[1+4+256+16] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)(ctrl)
|
|
[1+4+512+16] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Forward+Left (Shift)
|
|
|
|
[1+4+128+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)(shift)
|
|
[1+4+256+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)(shift)
|
|
[1+4+512+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Forward+Left (Ctrl+Shift)
|
|
|
|
[1+4+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ñòàðò)(ctrl+shift)
|
|
[1+4+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïîë¸ò)(ctrl+shift)
|
|
[1+4+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âëåâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Forward+Right
|
|
|
|
[1+8+128] = "leg_stand_walk_right", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)
|
|
[1+8+256] = "leg_stand_jump_right_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)
|
|
[1+8+512] = "leg_stand_jump_right_end", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Forward+Right (Ctrl)
|
|
|
|
[1+8+128+16] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)(ctrl)
|
|
[1+8+256+16] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)(ctrl)
|
|
[1+8+512+16] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Forward+Right (Shift)
|
|
|
|
[1+8+128+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)(shift)
|
|
[1+8+256+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)(shift)
|
|
[1+8+512+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Forward+Right (Ctrl+Shift)
|
|
|
|
[1+8+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ñòàðò)(ctrl+shift)
|
|
[1+8+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïîë¸ò)(ctrl+shift)
|
|
[1+8+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Âïåð¸ä+Âïðàâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Back+Left
|
|
|
|
[2+4+128] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)
|
|
[2+4+256] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)
|
|
[2+4+512] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Back+Left (Ctrl)
|
|
|
|
[2+4+128+16] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)(ctrl)
|
|
[2+4+256+16] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)(ctrl)
|
|
[2+4+512+16] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Back+Left (Shift)
|
|
|
|
[2+4+128+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)(shift)
|
|
[2+4+256+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)(shift)
|
|
[2+4+512+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Back+Left (Ctrl+Shift)
|
|
|
|
[2+4+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ñòàðò)(ctrl+shift)
|
|
[2+4+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïîë¸ò)(ctrl+shift)
|
|
[2+4+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âëåâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Back+Right
|
|
|
|
[2+8+128] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)
|
|
[2+8+256] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)
|
|
[2+8+512] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)
|
|
|
|
-- Jump Back+Right (Ctrl)
|
|
|
|
[2+8+128+16] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)(ctrl)
|
|
[2+8+256+16] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)(ctrl)
|
|
[2+8+512+16] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)(ctrl)
|
|
|
|
-- Jump Back+Right (Shift)
|
|
|
|
[2+8+128+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)(shift)
|
|
[2+8+256+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)(shift)
|
|
[2+8+512+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)(shift)
|
|
|
|
-- Jump Back+Right (Ctrl+Shift)
|
|
|
|
[2+8+128+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ñòàðò)(ctrl+shift)
|
|
[2+8+256+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïîë¸ò)(ctrl+shift)
|
|
[2+8+512+16+32] = "leg_stand_idle", --> Ïðûæîê+Íàçàä+Âïðàâî (Ïðèçåìëåíèå)(ctrl+shift)
|
|
|
|
-- Jump Run
|
|
|
|
[4096+128] = "leg_stand_run_fwd", --> Ïðûæîê+Áåã (Ñòàðò)
|
|
[4096+256] = "leg_stand_jump_fwd_idle", --> Ïðûæîê+Áåã (Ïîë¸ò)
|
|
[4096+512] = "leg_stand_jump_fwd_end", --> Ïðûæîê+Áåã (Ïðèçåìëåíèå)
|
|
[1+4096+128] = "leg_stand_run_fwd", --> Ïðûæîê+Áåã (Ñòàðò)
|
|
[1+4096+256] = "leg_stand_jump_fwd_idle", --> Ïðûæîê+Áåã (Ïîë¸ò)
|
|
[1+4096+512] = "leg_stand_jump_fwd_end", --> Ïðûæîê+Áåã (Ïðèçåìëåíèå)
|
|
|
|
-- Walk
|
|
|
|
[1] = "leg_stand_walk_fwd", --> Âïåð¸ä
|
|
[1+4] = "leg_stand_walk_fwd_left", --> Âïåð¸ä+Âëåâî
|
|
[1+8] = "leg_stand_walk_fwd_right", --> Âïåð¸ä+Âïðàâî
|
|
|
|
-- Crouch (Ctrl)
|
|
|
|
[1+16] = "leg_crouch_walk_fwd", --> Âïåð¸ä (ctrl)
|
|
[1+4+16] = "leg_stand_idle", --> Âïåð¸ä+Âëåâî (ctrl)
|
|
[1+8+16] = "leg_stand_idle", --> Âïåð¸ä+Âïðàâî (ctrl)
|
|
|
|
-- Walk (Shift)
|
|
|
|
[1+32] = "leg_stand_walk_fwd_shift", --> Âïåð¸ä (shift)
|
|
[1+4+32] = "leg_stand_walk_fwd_left_shift", --> Âïåð¸ä+Âëåâî (shift)
|
|
[1+8+32] = "leg_stand_walk_fwd_right_shift", --> Âïåð¸ä+Âïðàâî (shift)
|
|
|
|
-- Walk (Ctrl+Shift)
|
|
|
|
--[1+16+32] = "leg_stand_idle", --> Âïåð¸ä (ctrl+shift)
|
|
--[1+4+16+32] = "leg_stand_idle", --> Âïåð¸ä+Âëåâî (ctrl+shift)
|
|
--[1+8+16+32] = "leg_stand_idle", --> Âïåð¸ä+Âïðàâî (ctrl+shift)
|
|
|
|
-- Back
|
|
|
|
[2] = "leg_stand_walk_back", --> Íàçàä
|
|
[2+4] = "leg_stand_walk_back_left", --> Íàçàä+Âëåâî
|
|
[2+8] = "leg_stand_walk_back_right", --> Íàçàä+Âïðàâî
|
|
|
|
-- Back (Ctrl)
|
|
|
|
[2+16] = "leg_crouch_walk_back", --> Íàçàä (ctrl)
|
|
[2+4+16] = "leg_stand_idle", --> Íàçàä+Âëåâî (ctrl)
|
|
[2+8+16] = "leg_stand_idle", --> Íàçàä+Âïðàâî (ctrl)
|
|
|
|
-- Back (Shift)
|
|
|
|
[2+32] = "leg_stand_walk_back_shift", --> Íàçàä (shift)
|
|
[2+4+32] = "leg_stand_walk_back_left_shift", --> Íàçàä+Âëåâî (shift)
|
|
[2+8+32] = "leg_stand_walk_back_right_shift", --> Íàçàä+Âïðàâî (shift)
|
|
|
|
-- Back (Ctrl+Shift)
|
|
|
|
--[2+16+32] = "leg_stand_idle", --> Íàçàä (ctrl+shift)
|
|
--[2+4+16+32] = "leg_stand_idle", --> Íàçàä+Âëåâî (ctrl+shift)
|
|
--[2+8+16+32] = "leg_stand_idle", --> Íàçàä+Âïðàâî (ctrl+shift)
|
|
|
|
-- Left
|
|
|
|
[4] = "leg_stand_walk_left", --> Âëåâî
|
|
[4+16] = "leg_crouch_walk_left", --> Âëåâî (ctrl)
|
|
[4+32] = "leg_stand_walk_left_shift", --> Âëåâî (shift)
|
|
--[4+16+32] = "leg_stand_idle", --> Âëåâî (ctrl+shift)
|
|
|
|
-- Right
|
|
|
|
[8] = "leg_stand_walk_right", --> Âïðàâî
|
|
[8+16] = "leg_crouch_walk_right", --> Âïðàâî (ctrl)
|
|
[8+32] = "leg_stand_walk_right_shift", --> Âïðàâî (shift)
|
|
--[8+16+32] = "leg_stand_idle", --> Âïðàâî (ctrl+shift)
|
|
|
|
-- Ledder
|
|
|
|
[2048] = "leg_ladder_idle", --> Áîëòàåìñÿ íà ëåñòíèöå
|
|
[2048+1] = "leg_ladder_up", --> Äâèãàåìñÿ ïî ëåñòíèöå ââåðõ
|
|
[2048+2] = "leg_ladder_down", --> Äâèãàåìñÿ ïî ëåñòíèöå âíèç
|
|
}
|
|
|
|
function hid_sw()
|
|
hidden = false
|
|
return true
|
|
end
|
|
|
|
materials = {"wood", "earth", "metal", "water", "tin", "grass", "gravel", "asphalt"}
|
|
dirty_materials = {["earth"] = 5, ["water"] = 10, ["grass"] = 5, ["gravel"] = 10}
|
|
current_mat = "default"
|
|
|
|
function get_material(mat)
|
|
|
|
local sf = string.find
|
|
local current = tostring(mat)
|
|
|
|
for n, val in next, materials do
|
|
if sf(current, val) then
|
|
current_mat = val
|
|
break
|
|
else
|
|
current_mat = "default"
|
|
end
|
|
end
|
|
|
|
--if enable_dirt then
|
|
--chance = dirty_materials[current_mat]
|
|
-- if chance and math.random(1,100) <= chance and dirt_cnt < dirt_cnt_max and not actor_in_clear_zone() then
|
|
-- place_decal("dirt_marks", math.random(-5,5), 0.2, 0.3)
|
|
-- end
|
|
--if dirt_cnt < dirt_cnt_max and not actor_in_clear_zone() then
|
|
--place_decal("dirt_marks", math.random(-5,5), 0.2, 0.3)
|
|
--end
|
|
--end
|
|
|
|
end
|
|
|
|
function get_dirty_by_step(current_mat)
|
|
|
|
if not enable_dirt then return end
|
|
local chance = dirty_materials[current_mat]
|
|
-- for k,v in pairs(dirty_materials) do
|
|
-- if current_mat[dirty_materials] then
|
|
-- chance = dirty_materials[v]
|
|
-- end
|
|
-- end
|
|
|
|
if chance and math.random() < chance and not actor_in_clear_zone() then
|
|
place_decal("dirt_marks", math.random(-5,5), 0.2, 0.3)
|
|
end
|
|
|
|
news_manager.send_tip(db.actor, current_mat, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
news_manager.send_tip(db.actor, chance, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
|
|
end
|
|
|
|
function play_step_sound()
|
|
|
|
local item = db.actor:item_in_slot(7)
|
|
if exo_servo_sounds then
|
|
exo_flag = item and SYS_GetParam(0, item:section(), "repair_type") == "outfit_exo"
|
|
end
|
|
|
|
local function play()
|
|
step_sound = sound_object("material\\actor\\step\\" .. current_mat .. "_" .. math.random(1,4))
|
|
step_sound:play(db.actor, 0, sound_object.s2d)
|
|
step_sound.volume = turn_step_sound_volume
|
|
return true
|
|
end
|
|
|
|
local function play_add()
|
|
step_sound = sound_object("gear_rustle\\tac_gear_" .. math.random(1,8))
|
|
step_sound:play(db.actor, 0, sound_object.s2d)
|
|
step_sound.volume = turn_step_sound_volume + 0.2
|
|
return true
|
|
end
|
|
|
|
local function play_add_exo()
|
|
if not exo_servo_sounds or not exo_servo_sounds_mcm or not toggle_turn_step_sound_exo then return end
|
|
step_sound = sound_object("exo-servo\\light_servo_exo_walk" .. math.random(2))
|
|
step_sound:play(db.actor, 0, sound_object.s2d)
|
|
step_sound.volume = exo_servo_sounds_mcm.get_config("volume_walk") or 0.1
|
|
return true
|
|
end
|
|
|
|
if not freelook_hold then
|
|
-- if not (IsMoveState("mcCrouch") and IsMoveState("mcAccel")) then
|
|
-- play()
|
|
-- CreateTimeEvent("2ndstep", "2ndstep", 0.5, play)
|
|
-- end
|
|
play_add()
|
|
if exo_flag then
|
|
play_add_exo()
|
|
CreateTimeEvent("2ndstep_exo", "2ndstep_exo", 0.5, play_add_exo)
|
|
end
|
|
end
|
|
|
|
if IsMoveState("mcAnyMove") then
|
|
RemoveTimeEvent("2ndstep", "2ndstep")
|
|
RemoveTimeEvent("2ndstep_exo", "2ndstep_exo")
|
|
return
|
|
end
|
|
|
|
end
|
|
|
|
function on_key_press(key)
|
|
|
|
if key ~= bind_to_dik(key_bindings.kFREELOOK) then return end
|
|
|
|
if freelook_toggle_on and key == bind_to_dik(key_bindings.kFREELOOK) then
|
|
if not freelook_hold then
|
|
freelook_hold = true
|
|
else
|
|
freelook_hold = false
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
function on_key_hold(key)
|
|
|
|
if key ~= bind_to_dik(key_bindings.kFREELOOK) then return end
|
|
|
|
if key == bind_to_dik(key_bindings.kFREELOOK) and not freelook_toggle_on then
|
|
freelook_hold = true
|
|
end
|
|
|
|
end
|
|
|
|
function on_key_release(key)
|
|
|
|
if key ~= bind_to_dik(key_bindings.kFREELOOK) then return end
|
|
|
|
if key == bind_to_dik(key_bindings.kFREELOOK) and not freelook_toggle_on then
|
|
freelook_hold = false
|
|
end
|
|
|
|
end
|
|
|
|
--\\ Àïäåéò èãðîêà
|
|
function actor_update()
|
|
|
|
--actor_menu.set_msg(1, LEGS_SECTION, 3)
|
|
|
|
--\\ Ïîëó÷àåì ôëàã òåêóùåãî ñîñòîÿíèÿ òåëà Ãà èç ïàìÿòè è ðàçáèðàåì åãî
|
|
local ActorSobj = alife():object(db.actor:id())
|
|
--local body_flag = swm_legs.get_actor_body_flag()
|
|
local body_flag = level.actor_moving_state()
|
|
|
|
-- local alco = IsMoveState('mcTurn')
|
|
-- actor_menu.set_msg(1,alco,3)
|
|
|
|
local iBite = 1
|
|
|
|
for i=1, 16 do
|
|
if body_flag ~= nil then
|
|
actor_flags[i] = ( bit_and(body_flag, iBite) ~= 0 )
|
|
iBite = iBite * 2
|
|
else
|
|
actor_flags[i] = false
|
|
end
|
|
end
|
|
|
|
--\\ Ïðîâåðÿåì ÷òî íóæíî ñïàâíèòü íîãè
|
|
if se_legs.LegsTbl[level.name()] == nil and CanShowLegs() then
|
|
alife():create(LEGS_SECTION, db.actor:position(), 1, db.actor:game_vertex_id())
|
|
end
|
|
|
|
end
|
|
|
|
--\\ Ïðîâåðÿåì ÷òî ìû ìîæåì ñïàâíèòü è ïîêàçûâàòü íîãè
|
|
|
|
function CanShowLegs()
|
|
--* Ïðîâåðÿåì ÷òî ìû íå óëåòåëè äàëåêî, è ÷òî ìû íå íà ëåñòíèöå
|
|
local abp = db.actor:bone_position("bip01_head")
|
|
if device().cam_pos:distance_to_sqr(abp) > (HIDE_DISTANCE*HIDE_DISTANCE) or not db.actor:alive() or hidden == true or disabled == true or level.get_active_cam() ~= 0 then
|
|
return false
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
function actor_on_first_update()
|
|
end
|
|
|
|
function delete()
|
|
|
|
for i = 1, 65534 do
|
|
local obj = alife_object(i)
|
|
if obj then
|
|
local sec = obj:section_name()
|
|
local id = obj.id
|
|
if obj:clsid() == clsid.legs_s then
|
|
printf("legs object %s with id %s released",sec,id)
|
|
alife_release(obj)
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
function smooth_lean()
|
|
|
|
if IsMoveState('mcRLookout') then
|
|
if dir_rgt_mod > -0.15 and dir_rgt_mod <= 0 then
|
|
dir_rgt_mod = dir_rgt_mod + 0.01
|
|
end
|
|
elseif IsMoveState('mcLLookout') then
|
|
if dir_rgt_mod < 0.15 and dir_rgt_mod <= 0 then
|
|
dir_rgt_mod = dir_rgt_mod - 0.01
|
|
end
|
|
end
|
|
|
|
actor_menu.set_msg(1, dir_rgt_mod, 3)
|
|
|
|
end
|
|
|
|
function notify_missing_model(model_name)
|
|
if not enable_debug_warnings then return end
|
|
if model_name ~= nil and model_name ~= "" then
|
|
news_manager.send_tip(db.actor, game.translate_string('st_visbody_no_model_msg') .. model_name, nil, "ui\\ui_icon_news_trx_dolg", 15000)
|
|
news_manager.send_tip(db.actor, game.translate_string('st_visbody_no_model_msg_2'), nil, "ui\\ui_icon_news_trx_dolg", 15000)
|
|
else
|
|
news_manager.send_tip(db.actor, game.translate_string('st_visbody_empty_model_msg'), nil, "ui\\ui_icon_news_trx_dolg", 15000)
|
|
end
|
|
end
|
|
|
|
function notify_missing_section(sec_name)
|
|
if not enable_debug_warnings then return end
|
|
if sec_name ~= nil and sec_name ~= "" then
|
|
news_manager.send_tip(db.actor, game.translate_string('st_visbody_no_sec_msg') .. sec_name, nil, "ui\\ui_icon_news_trx_dolg", 15000)
|
|
else
|
|
news_manager.send_tip(db.actor, game.translate_string('st_visbody_empty_sec_msg'), nil, "ui\\ui_icon_news_trx_dolg", 15000)
|
|
end
|
|
end
|
|
|
|
function actor_item_to_slot(item)
|
|
|
|
model_name = ""
|
|
model_name_armorupg = ""
|
|
local body_obj = level.object_by_id(ext_body_id)
|
|
local fs = getFS()
|
|
|
|
if IsOutfit(item) then
|
|
|
|
swm_current_outfit[item:id()] = true
|
|
local sec = item:section()
|
|
|
|
-- a few safety layers just in case to avoid crashes
|
|
if not use_hd_models then -- vanilla models
|
|
if _u.ltxExist(sec .. "_legs", "visual") then -- body section exists?
|
|
model_name = SYS_GetParam(0, sec .. "_legs", "visual") .. '.ogf'
|
|
else
|
|
model_name = "sm\\actor_legs\\no_outfit.ogf" -- default if no section
|
|
end
|
|
else -- hd models
|
|
if visual_upg_enabled and check_outfit_upgrade("prop_armor") and visual_armor_upg_supported[sec .. "_legs_hd"] then
|
|
if _u.ltxExist(sec .. "_legs_hd_armorupg", "visual") then -- body armorupg section exists?
|
|
model_name_armorupg = SYS_GetParam(0, sec .. "_legs_hd_armorupg", "visual") .. '.ogf'
|
|
--model_name_armorupg = model_name
|
|
else
|
|
model_name = SYS_GetParam(0, sec .. "_legs_hd", "visual") .. '.ogf'
|
|
end
|
|
else
|
|
if _u.ltxExist(sec .. "_legs_hd", "visual") then -- no armorupg, but usual hd one?
|
|
model_name = SYS_GetParam(0, sec .. "_legs_hd", "visual") .. '.ogf'
|
|
else
|
|
model_name = "sm\\actor_legs\\no_outfit_hd.ogf" -- default hd if no section
|
|
end
|
|
end
|
|
end
|
|
|
|
if not use_hd_models then -- vanilla models
|
|
if _u.ltxExist(sec .. "_legs", "visual") then -- body section exists?
|
|
if fs:exist("$game_meshes$",model_name) then -- ok, but is the model file there?
|
|
LEGS_SECTION = sec .. "_legs"
|
|
else
|
|
notify_missing_model(model_name)
|
|
LEGS_SECTION = "actor_legs" -- default if no model
|
|
end
|
|
else
|
|
LEGS_SECTION = "actor_legs" -- default if no section
|
|
end
|
|
else -- hd models
|
|
if check_outfit_upgrade("prop_armor") and visual_armor_upg_supported[sec .. "_legs_hd"] then -- visual armor upg supported and has section?
|
|
if fs:exist("$game_meshes$",model_name_armorupg) then
|
|
LEGS_SECTION = sec .. "_legs_hd" .. "_armorupg"
|
|
else -- armorupg not found
|
|
if fs:exist("$game_meshes$",model_name) then
|
|
LEGS_SECTION = sec .. "_legs_hd"
|
|
else
|
|
notify_missing_model(model_name)
|
|
LEGS_SECTION = "actor_legs_hd"
|
|
end
|
|
end
|
|
elseif _u.ltxExist(sec .. "_legs_hd", "visual") then -- no visual upg
|
|
if fs:exist("$game_meshes$",model_name) then
|
|
LEGS_SECTION = sec .. "_legs_hd"
|
|
else
|
|
notify_missing_model(model_name)
|
|
LEGS_SECTION = "actor_legs_hd"
|
|
end
|
|
elseif _u.ltxExist(sec .. "_legs", "visual") then
|
|
if fs:exist("$game_meshes$",model_name) then
|
|
LEGS_SECTION = sec .. "_legs"
|
|
else
|
|
notify_missing_model(model_name)
|
|
LEGS_SECTION = "actor_legs_hd"
|
|
end
|
|
else
|
|
LEGS_SECTION = "actor_legs_hd"
|
|
end
|
|
end
|
|
|
|
--[[if visual_armor_upg_supported[LEGS_SECTION] and body_obj then
|
|
if check_outfit_upgrade("prop_armor") then
|
|
body_obj:set_bone_visible("armorupg",true)
|
|
end
|
|
end]]--
|
|
|
|
if string.find(GAME_VERSION,"1.5.1") then
|
|
hidden = true
|
|
CreateTimeEvent("rest1","rest1", 0.05, hid_sw)
|
|
end
|
|
--blood_cnt = 0
|
|
--dirt_cnt = 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
function reset_legs_model()
|
|
|
|
if not use_hd_models then
|
|
LEGS_SECTION = "actor_legs"
|
|
else
|
|
LEGS_SECTION = "actor_legs_hd"
|
|
end
|
|
if string.find(GAME_VERSION,"1.5.1") then
|
|
hidden = true
|
|
CreateTimeEvent("rest2","rest2", 0.05, hid_sw)
|
|
end
|
|
return true
|
|
|
|
end
|
|
|
|
function actor_item_to_ruck(item)
|
|
|
|
if swm_current_outfit[item:id()] == true and IsOutfit(item) then
|
|
swm_current_outfit[item:id()] = nil
|
|
reset_legs_model()
|
|
--blood_cnt = 0
|
|
--dirt_cnt = 0
|
|
end
|
|
|
|
end
|
|
|
|
function load_settings(MCM)
|
|
|
|
freelook_toggle_on = get_console():get_bool("g_freelook_toggle")
|
|
|
|
local suit = db.actor:item_in_slot(7)
|
|
|
|
DISTANCE_MOD_FWD = swm_legs_mcm.get_config("legs_offset")
|
|
DISTANCE_MOD_RGT = swm_legs_mcm.get_config("legs_offset_side")
|
|
DISTANCE_MOD_FWD_NONCOMBAT = swm_legs_mcm.get_config("legs_offset_noncombat")
|
|
hide_legs_low_crouch = swm_legs_mcm.get_config("hide_legs_low_crouch")
|
|
toggle_turn_step_sound = swm_legs_mcm.get_config("toggle_turn_step_sound")
|
|
toggle_turn_step_sound_exo = swm_legs_mcm.get_config("toggle_turn_step_sound_exo") turn_step_sound_volume = swm_legs_mcm.get_config("turn_step_sound_volume")
|
|
use_hd_models = swm_legs_mcm.get_config("use_hd_models")
|
|
enable_idle_anims = swm_legs_mcm.get_config("enable_idle_anims")
|
|
idle_anim_min_cooldown = swm_legs_mcm.get_config("idle_anim_min_cooldown") * 1000
|
|
idle_anim_max_cooldown = swm_legs_mcm.get_config("idle_anim_max_cooldown") * 1000
|
|
use_combat_state = swm_legs_mcm.get_config("use_combat_state") or true
|
|
use_special_noncombat_shift = swm_legs_mcm.get_config("use_special_noncombat_shift")
|
|
use_slow_down_state = swm_legs_mcm.get_config("use_slow_down_state")
|
|
--enable_dirt = swm_legs_mcm.get_config("enable_dirt")
|
|
--enable_blood = swm_legs_mcm.get_config("enable_blood")
|
|
visual_upg_enabled = swm_legs_mcm.get_config("visual_upg_enabled")
|
|
enable_debug_warnings = swm_legs_mcm.get_config("enable_debug_warnings")
|
|
disabled = swm_legs_mcm.get_config("disabled")
|
|
|
|
if suit then
|
|
actor_item_to_slot(suit)
|
|
end
|
|
idle_pause_rnd = math.random(idle_anim_min_cooldown, idle_anim_max_cooldown)
|
|
if disabled then
|
|
delete()
|
|
end
|
|
|
|
end
|
|
|
|
--\\ Áèíäåð íîã
|
|
function bind( obj )
|
|
local new_binder = legs_binder(obj)
|
|
obj:bind_object( new_binder )
|
|
end
|
|
|
|
local ray_pos = {}
|
|
function ray()
|
|
|
|
local pick = ray_pick()
|
|
local pos = db.actor:bone_position("bip01_pelvis")
|
|
local dir = device().cam_dir
|
|
pick:set_position(pos)
|
|
pick:set_direction(dir)
|
|
pick:set_flags(0)
|
|
pick:set_range(200)
|
|
pick:query()
|
|
local dir_f = pick:set_direction(dir)
|
|
return dir_f
|
|
|
|
end
|
|
|
|
-- use only these for body: bip01_l_calf,bip01_l_foot,bip01_l_thigh,bip01_l_toe0,bip01_pelvis,bip01_r_calf,bip01_r_foot,bip01_r_thigh,bip01_r_toe0,bip01_spine,body,wpn_body
|
|
local bone_list = {
|
|
[1] = "bip01_l_calf",
|
|
[2] = "bip01_r_calf",
|
|
[3] = "bip01_l_toe0",
|
|
[4] = "bip01_r_toe0",
|
|
[5] = "bip01_l_thigh",
|
|
[6] = "bip01_r_thigh",
|
|
[7] = "bip01_pelvis",
|
|
}
|
|
|
|
function place_decal(decal_sec,y_pos_mod,size_skel,size)
|
|
|
|
local body_obj = level.object_by_id(ext_body_id)
|
|
if body_obj then
|
|
local fx_pos = body_obj:bone_position(bone_list[math.random(1,7)])
|
|
fx_pos.y = fx_pos.y + y_pos_mod
|
|
local blood_trace = vector():set(0,-1,0)
|
|
wallmarks_manager():place_skeleton(body_obj, decal_sec, fx_pos, blood_trace, size_skel,-1)
|
|
--actor_menu.set_msg(1,"placed",3)
|
|
--wallmarks_manager():place(blood_trace, fx_pos, 0.5, size, decal_sec, body_obj,-1)
|
|
else
|
|
-- actor_menu.set_msg(1, "SHIT_YOURSELF", 3)
|
|
end
|
|
|
|
end
|
|
|
|
function actor_on_before_hit(s_hit)
|
|
|
|
if enable_blood then
|
|
if s_hit.type == hit.fire_wound or s_hit.type == hit.fire_wound or s_hit.type == hit.wound then
|
|
if blood_cnt < blood_cnt_max then
|
|
if s_hit.power >= 0.2 and s_hit.power <= 0.4 then
|
|
place_decal("bloody_marks", -1, 0.05, 0.1)
|
|
elseif s_hit.power > 0.4 then
|
|
place_decal("bloody_marks", -1, 0.2, 0.3)
|
|
end
|
|
blood_cnt = blood_cnt + 1
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
function actor_in_clear_zone()
|
|
local id = smart_terrain.nearest_to_actor_smart.id
|
|
local smart = id and alife_object(id)
|
|
local dist = smart_terrain.nearest_to_actor_smart.dist
|
|
|
|
if (smart) and (no_dirt_radius[smart:name()]) and (dist <= no_dirt_radius[smart:name()]) then
|
|
return true
|
|
end
|
|
return false
|
|
end
|
|
|
|
function get_anim_type(body_flag)
|
|
if use_combat_state and is_calm_state() and AnimTable_NonCombat[body_flag] then
|
|
anim_name = AnimTable_NonCombat[body_flag] or "leg_stand_idle"
|
|
elseif use_slow_down_state and is_slowed_down() and AnimTable_SlowedDown[body_flag] then
|
|
anim_name = AnimTable_SlowedDown[body_flag] or "lancew_legs_idle"
|
|
else
|
|
anim_name = AnimTable_Basic[body_flag] or "lancew_legs_idle"
|
|
end
|
|
return anim_name
|
|
end
|
|
|
|
local idl_tmr
|
|
can_play = false
|
|
|
|
idles_time = {
|
|
["legs_stand_1"] = 900,
|
|
["legs_stand_2"] = 1900,
|
|
["legs_stand_3"] = 1200
|
|
}
|
|
|
|
function play_idle_snd()
|
|
idle_sound = sound_object("gear_rustle\\tac_gear_" .. math.random(1,8))
|
|
idle_sound:play(db.actor, 0, sound_object.s2d)
|
|
idle_sound.volume = 0.15
|
|
end
|
|
|
|
function set_idle()
|
|
anim_name = "legs_stand_" .. idle_anim_random
|
|
idle_tm = idles_time[anim_name] or 2000
|
|
end
|
|
|
|
local stand_tmr = 10000 --unused
|
|
function stand_timer()
|
|
local tg = time_global()
|
|
if (stand_tmr and tg < stand_tmr) and angle_down > -0.65 then return end
|
|
stand_tmr = tg + 2000
|
|
end
|
|
|
|
function startidle()
|
|
local tg = time_global()
|
|
can_play = true
|
|
idle_anim_random = math.random(1,3)
|
|
set_idle()
|
|
play_idle_snd()
|
|
tmr_a = tg + idle_tm
|
|
RemoveTimeEvent("ff","ff")
|
|
end
|
|
|
|
function can_play_idle()
|
|
--actor_menu.set_msg(1,can_play,3)
|
|
if not enable_idle_anims then return end
|
|
local tg = time_global()
|
|
|
|
if (tmr_a and tg > tmr_a) and can_play then
|
|
can_play = false
|
|
tmr_a = tg + idle_pause_rnd
|
|
elseif tg > tmr_a and idle_allowed then
|
|
CreateTimeEvent("ff","ff",idle_pause_rnd/1000,startidle)
|
|
end
|
|
if not idle_allowed then
|
|
can_play = false
|
|
RemoveTimeEvent("ff","ff")
|
|
end
|
|
end
|
|
|
|
function testshit()
|
|
news_manager.send_tip(db.actor, time_global(), nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
news_manager.send_tip(db.actor, "tmr_a " .. tmr_a, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
news_manager.send_tip(db.actor, "idle_pause_rnd " .. idle_pause_rnd, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
end
|
|
|
|
function check_outfit_upgrade(prop_to_check)
|
|
local outfit = db.actor:item_in_slot(7)
|
|
if outfit and visual_upg_enabled then
|
|
local outfit_id = outfit:id()
|
|
local installed_upgr = utils_item.get_upgrades_installed(outfit,outfit_id,true)
|
|
for key,upgrade in pairs(installed_upgr) do
|
|
if SYS_GetParam(0, key, "property") == prop_to_check then
|
|
return true
|
|
end
|
|
end
|
|
return false
|
|
end
|
|
end
|
|
|
|
local tmr_upg
|
|
function check_outfit_upgrade_timer()
|
|
local outfit = db.actor:item_in_slot(7)
|
|
if not visual_upg_enabled then return end
|
|
local tg = time_global()
|
|
if (tmr_upg and tg < tmr_upg) then return end
|
|
tmr_upg = tg + 1000
|
|
check_outfit_upgrade(prop_armor)
|
|
actor_item_to_slot(outfit)
|
|
end
|
|
|
|
function check_armor_upgrade_dumbversion()
|
|
local outfit = db.actor:item_in_slot(7)
|
|
if outfit and outfit:has_upgrade("up_firsta_novice_1") then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
local dirt_tmr
|
|
function dirty_over_time()
|
|
|
|
if not enable_dirt then return end
|
|
local tg = time_global()
|
|
if (dirt_tmr and dirt_tmr < tg) then return end
|
|
dirt_tmr = tg + 5000
|
|
|
|
local chance = 0
|
|
if IsMoveState('mcCrouch') or IsMoveState('mcSprint') then
|
|
chance = 10
|
|
if current_mat[dirty_materials] then
|
|
chance = 25
|
|
end
|
|
else
|
|
chance = 5
|
|
if current_mat[dirty_materials] then
|
|
chance = 15
|
|
end
|
|
end
|
|
|
|
if not actor_in_clear_zone() and IsMoveState('mcAnyMove') then
|
|
if dirt_cnt < dirt_cnt_max and math.random() < chance then
|
|
place_decal("dirt_marks", math.random(-5.0,5.0,0.2), 0.2, 0.3)
|
|
dirt_cnt = dirt_cnt + 1
|
|
end
|
|
else
|
|
dirt_cnt = 0
|
|
end
|
|
|
|
news_manager.send_tip(db.actor, current_mat, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
news_manager.send_tip(db.actor, chance, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
end
|
|
|
|
function set_specific_body_model(visual)
|
|
local body_obj = level.object_by_id(ext_body_id)
|
|
if body_obj and getFS():exist("$game_meshes$",visual) then body_obj:set_visual_name(visual) end
|
|
end
|
|
|
|
class "legs_binder" ( object_binder )
|
|
|
|
function legs_binder:__init( obj ) super( obj )
|
|
self.id = self.object:id()
|
|
self.object :set_fastcall(self.fastcall, self)
|
|
self.VisualUpdateCnt = 0
|
|
self.current_visual = nil --> Òåêóùèé âèçóàë
|
|
self.current_anim = nil --> Òåêóùàÿ àíèìàöèÿ
|
|
self.lastActorPos = nil
|
|
self.posTimer = 0
|
|
self.lastTurnTime = 0 --> Âðåìÿ, êîãäà ïîñëåäíèé ðàç áûëà âêë÷þåíà àíèìàöèÿ ïîâîðîòà
|
|
self.turnAnim = "lancew_legs_turn_left"
|
|
end
|
|
|
|
--\\ Áûñòðûé àïäåéò ïîçèöèè è äèðåêöèè íîã
|
|
function legs_binder:fastcall()
|
|
|
|
local tg = time_global()
|
|
if self.object then ext_body_id = self.object:id() end
|
|
xr_logic.mob_capture(self.object, true)
|
|
self.object.health = 1
|
|
|
|
--\\ Ïðîâåðÿåì â êàêîé áðîíå èãðîê
|
|
--* Äåëàåì íîãè â çàâèñèìîñòè îò îäåòîé áðîíè
|
|
-- (1.5.2 only)
|
|
legs_visual = SYS_GetParam(0, LEGS_SECTION, "visual")
|
|
--actor_menu.set_msg(1,legs_visual,3)
|
|
if legs_visual ~= self.current_visual then
|
|
self.current_visual = legs_visual
|
|
self.object:set_visual_name(legs_visual)
|
|
self.VisualUpdateCnt = 5
|
|
self.current_anim = nil
|
|
end
|
|
|
|
--\\ Óñòàíàâëèâàåì ïîçèöèþ òåëà
|
|
pos = device().cam_pos
|
|
cdir = device().cam_dir
|
|
angle_down = cdir.y
|
|
distance_H2B = device().cam_pos:distance_to(db.actor:position())
|
|
|
|
--\\ Ïîëó÷àåì ôëàã òåêóùåãî ñîñòîÿíèÿ òåëà Ãà èç ïàìÿòè è ðàçáèðàåì åãî
|
|
--local body_flag = swm_legs.get_actor_body_flag()
|
|
body_flag = level.actor_moving_state()
|
|
|
|
--\\ Âû÷èòàåì èç ôëàãà ñîñòîÿíèÿ èãðîêà íåíóæíûå íàì ôëàãè
|
|
for key, numb in pairs(DISABLED_FLAGS) do
|
|
if actor_flags[key] == true then
|
|
body_flag = body_flag - numb
|
|
end
|
|
end
|
|
|
|
--\\ Ïîëó÷àåì òåêóùóþ àíèìàöèþ
|
|
anim_name = get_anim_type(body_flag) or "lancew_legs_idle"
|
|
idle_allowed = enable_idle_anims and (body_flag == 0 or body_flag == 32) and is_calm_state() and angle_down <= -0.65
|
|
if idle_allowed and can_play then set_idle() end
|
|
|
|
if self.posTimer < time_global() and distance_H2B < 1.7 then -->  ïàäåíèè ìîäåëü èãðîêà óõîäèò âïåð¸ä êàìåðû
|
|
pos.y = db.actor:position().y
|
|
self.posTimer = 0
|
|
else
|
|
local shift = 1.5
|
|
if actor_flags[5] then --> ctrl
|
|
if actor_flags[6] then --> shift
|
|
shift = 0.95
|
|
else
|
|
shift = 1.23
|
|
end
|
|
end
|
|
|
|
pos.y = pos.y - shift
|
|
|
|
if self.posTimer == 0 then
|
|
self.posTimer = time_global() + 1000
|
|
end
|
|
end
|
|
|
|
if IsMoveState('mcClimb') then
|
|
pos.y = pos.y + HEIGHT_ladder
|
|
else
|
|
pos.y = pos.y + HEIGHT
|
|
end
|
|
|
|
--pos = vector():set(0,0,0)
|
|
--dir_fwd = vector():setHP(device().cam_dir:getH(), 0)
|
|
--dir_fwd = vector():setHP(device().cam_top:getH(), 0)
|
|
|
|
if angle_down <= -0.65 then
|
|
if (IsMoveState('mcTurn') and not IsMoveState('mcClimb')) or (IsMoveState('mcLLookout') or IsMoveState('mcRLookout')) then
|
|
dir_fwd = vector():setHP(device().cam_top:getH(), 0)
|
|
else
|
|
dir_fwd = db.actor:direction()
|
|
end
|
|
else
|
|
dir_fwd = vector():setHP(device().cam_dir:getH(), 0)
|
|
end
|
|
|
|
-- pos = utils_obj.safe_bone_pos(self.object,"bip01_pelvis")
|
|
|
|
dir_rgt = vector():setHP(device().cam_right:getH(), 0)
|
|
if use_special_noncombat_shift and is_calm_state() then
|
|
dir_fwd_mod = DISTANCE_MOD_FWD_NONCOMBAT
|
|
else
|
|
dir_fwd_mod = DISTANCE_MOD_FWD
|
|
end
|
|
dir_rgt_mod = DISTANCE_MOD_RGT
|
|
|
|
local movestate = level.actor_moving_state()
|
|
local shift_tbl = SPEC_SHIFT[anim_name]
|
|
local shift_visual_tbl = SPEC_SHIFT_BY_VISUAL[LEGS_SECTION]
|
|
local shift_prone_tbl = SPEC_SHIFT_PRONE[anim_name]
|
|
|
|
if shift_tbl then
|
|
if shift_tbl.fwd then
|
|
dir_fwd_mod = shift_tbl.fwd
|
|
end
|
|
if shift_tbl.rgt then
|
|
dir_rgt_mod = shift_tbl.rgt
|
|
end
|
|
end
|
|
|
|
if shift_visual_tbl and swm_visible_body_azetrix_addon_dummy then
|
|
if shift_visual_tbl.fwd then
|
|
dir_fwd_mod = shift_visual_tbl.fwd
|
|
end
|
|
if shift_visual_tbl.rgt then
|
|
dir_rgt_mod = shift_visual_tbl.rgt
|
|
end
|
|
end
|
|
|
|
if shift_prone_tbl and hide_legs_low_crouch and (IsMoveState('mcAccel') and IsMoveState('mcCrouch')) then
|
|
if shift_prone_tbl.fwd then
|
|
dir_fwd_mod = shift_prone_tbl.fwd
|
|
end
|
|
if shift_prone_tbl.rgt then
|
|
dir_rgt_mod = shift_prone_tbl.rgt
|
|
end
|
|
end
|
|
|
|
if not IsMoveState('mcClimb') then
|
|
if IsMoveState('mcRLookout') then
|
|
dir_rgt_mod = dir_rgt_mod - 0.2
|
|
elseif IsMoveState('mcLLookout') then
|
|
dir_rgt_mod = dir_rgt_mod + 0.15
|
|
end
|
|
end
|
|
|
|
--actor_menu.set_msg(1, dir_rgt_mod, 3)
|
|
pos = pos:add(dir_fwd:mul(dir_fwd_mod))
|
|
pos = pos:add(dir_rgt:mul(dir_rgt_mod))
|
|
-- pos = pos:add(dir_fwd)
|
|
-- pos = pos:add(dir_rgt)
|
|
self.object:set_npc_position(pos)
|
|
|
|
--\\ Ïðîâåðÿåì ÷òî êàìåðà íå óëåòåëà äàëåêî îò ãîëîâû
|
|
local bHided = false
|
|
|
|
if CanShowLegs() == false then
|
|
--self.object:force_visibility_state(0) --> Âûëåòàëî, åñëè äàëåêî îò ÃÃ óëåòåòü
|
|
bHided = true
|
|
|
|
local sobj = alife():object(self.id)
|
|
if sobj then
|
|
alife():release(sobj, true)
|
|
end
|
|
|
|
se_legs.LegsTbl[level.name()] = nil
|
|
delete()
|
|
return
|
|
else
|
|
--self.object:force_visibility_state(2)
|
|
end
|
|
|
|
---\\ Ïðîâåðÿåì ÷òî ÃÃ íå óëåòåë äàëåêî îò íîã
|
|
if self.lastActorPos ~= nil then
|
|
if bHided == false and db.actor:position():distance_to_sqr(self.lastActorPos) > (RSPN_DISTANCE * RSPN_DISTANCE) then
|
|
self:respawn()
|
|
return true
|
|
end
|
|
end
|
|
|
|
--\\ Óñòàíàâëèâàåì âçãëÿä
|
|
if not IsMoveState('mcAnyMove') and not IsMoveState('mcClimb') then
|
|
if self.lastTurnTime >= time_global() then
|
|
anim_name = self.turnAnim
|
|
else
|
|
local AngleBetween = _u.calc_Y(db.actor:direction():getH(), self.object:direction():getH())
|
|
local turn_threshold = 0.2
|
|
--actor_menu.set_msg(1, AngleBetween, 3)
|
|
|
|
if not (IsMoveState('mcLLookout') or IsMoveState('mcRLookout')) then
|
|
if angle_down < -0.65 then
|
|
turn_threshold = 0.08
|
|
end
|
|
else
|
|
turn_threshold = 0.2
|
|
end
|
|
-- if angle_down > -0.65 and not (IsMoveState('mcLLookout') or IsMoveState('mcRLookout')) then
|
|
-- turn_threshold = 0.35
|
|
-- end
|
|
--actor_menu.set_msg(1,turn_threshold,3)
|
|
|
|
if math.abs(AngleBetween) > turn_threshold then
|
|
if time_global() - self.lastTurnTime >= 500 then
|
|
self.lastTurnTime = time_global() + 500
|
|
|
|
if AngleBetween <= 0.0 and IsMoveState('mcTurn') then
|
|
self.turnAnim = "lancew_legs_turn_right"
|
|
if toggle_turn_step_sound then
|
|
play_step_sound()
|
|
end
|
|
if IsMoveState("mcAnyMove") then
|
|
RemoveTimeEvent("2ndstep", "2ndstep")
|
|
RemoveTimeEvent("2ndstep_exo", "2ndstep_exo")
|
|
return
|
|
end
|
|
else
|
|
if IsMoveState('mcTurn') then
|
|
self.turnAnim = "lancew_legs_turn_left"
|
|
if toggle_turn_step_sound then
|
|
play_step_sound()
|
|
end
|
|
if IsMoveState("mcAnyMove") then
|
|
RemoveTimeEvent("2ndstep", "2ndstep")
|
|
RemoveTimeEvent("2ndstep_exo", "2ndstep_exo")
|
|
return
|
|
end
|
|
end
|
|
end
|
|
|
|
anim_name = self.turnAnim
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- local tDir = utils_obj.safe_bone_pos(self.object,"bip01_pelvis")
|
|
local tDir
|
|
if angle_down <= -0.65 then
|
|
if (IsMoveState('mcTurn') and not IsMoveState('mcClimb')) or (IsMoveState('mcLLookout') or IsMoveState('mcRLookout')) then
|
|
tDir = vector():setHP(device().cam_top:getH(), 0)
|
|
-- actor_menu.set_msg(1, "TOP", 3)
|
|
else
|
|
tDir = db.actor:direction()
|
|
-- actor_menu.set_msg(1, "ACT_DIR", 3)
|
|
end
|
|
else
|
|
tDir = vector():setHP(device().cam_dir:getH(), 0)
|
|
-- actor_menu.set_msg(1, "CAM_DIR", 3)
|
|
end
|
|
|
|
local look_dir = look()
|
|
look_dir:type(2)
|
|
look_dir:direct(tDir)
|
|
action(self.object, look_dir, cond(cond.look_end))
|
|
|
|
--actor_menu.set_msg(1, angle_down, 3)
|
|
-- local cp1 = tDir.x
|
|
-- local cp2 = tDir.y
|
|
-- local cp3 = tDir.z
|
|
-- news_manager.send_tip(db.actor, "tDir " .. cp1, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
-- news_manager.send_tip(db.actor, "tDir " .. cp2, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
-- news_manager.send_tip(db.actor, "tDir " .. cp3, nil, "ui\\ui_icon_news_trx_dolg", 6000)
|
|
|
|
--\\ Ïðîèãðûâàåì àíèìêó
|
|
if not bHided then
|
|
if self.VisualUpdateCnt <= 0 then
|
|
self:play_anim(anim_name)
|
|
else
|
|
self.VisualUpdateCnt = self.VisualUpdateCnt - 1
|
|
end
|
|
else
|
|
self.object:clear_animations()
|
|
self.VisualUpdateCnt = 5
|
|
end
|
|
|
|
--actor_menu.set_msg(1,self.VisualUpdateCnt,3)
|
|
--self.lastActorPos = db.actor:position()
|
|
|
|
end
|
|
|
|
function legs_binder:respawn()
|
|
local sobj = alife():object(self.id)
|
|
if sobj then
|
|
alife():release(sobj, true)
|
|
se_legs.LegsTbl[level.name()] = nil
|
|
end
|
|
|
|
if not disabled then
|
|
alife():create(LEGS_SECTION, db.actor:position(), 1, db.actor:game_vertex_id())
|
|
end
|
|
return true
|
|
end
|
|
|
|
function legs_binder:play_anim(anim_name)
|
|
if self.current_anim ~= anim_name then
|
|
self.object:play_cycle(anim_name, true)
|
|
self.current_anim = anim_name
|
|
end
|
|
end
|
|
|
|
function on_game_start()
|
|
RegisterScriptCallback("actor_item_to_slot", actor_item_to_slot)
|
|
RegisterScriptCallback("actor_item_to_ruck", actor_item_to_ruck)
|
|
RegisterScriptCallback("actor_on_item_drop", actor_item_to_ruck)
|
|
RegisterScriptCallback("on_option_change", load_settings)
|
|
RegisterScriptCallback("actor_on_first_update", load_settings)
|
|
RegisterScriptCallback("actor_on_footstep", get_material)
|
|
--RegisterScriptCallback("actor_on_footstep", get_dirty_by_step)
|
|
RegisterScriptCallback("actor_on_update", actor_update)
|
|
--RegisterScriptCallback("actor_on_update", check_outfit_upgrade_timer)
|
|
--RegisterScriptCallback("actor_on_update", play_idle_anim)
|
|
RegisterScriptCallback("actor_on_update", can_play_idle)
|
|
--RegisterScriptCallback("actor_on_update", stand_timer)
|
|
--RegisterScriptCallback("actor_on_update", testshit)
|
|
--RegisterScriptCallback("actor_on_update", dirty_over_time)
|
|
RegisterScriptCallback("on_key_press", on_key_press)
|
|
RegisterScriptCallback("on_key_hold", on_key_hold)
|
|
RegisterScriptCallback("on_key_release", on_key_release)
|
|
--RegisterScriptCallback("actor_on_before_hit", actor_on_before_hit)
|
|
--RegisterScriptCallback("actor_on_update", smooth_lean)
|
|
--RegisterScriptCallback("actor_on_first_update", actor_on_first_update)
|
|
end
|