V.E.Q.O. 159 Опубликовано 5 Мая 2016 По amk_anoms.script или что там править: Самый простой способ уменьшить количество рандомных аномалий, это выставить свои значения в строке: local anoms_difficulty_koef={[0]=0.75,[1]=1.0,[2]=1.25,[3]=1.5}Например:[0]=0.1,[1]=0.3,[2]=0.75,[3]=1.0} Если решили убрать с определённой локации, то комментим название, (к примеру: -- l05_bar) в game_vertexes, level_vertexes, local level_arts и т.д. Просто уменьшить количество аномалий на локе в local level_anoms не прокатит, будет вылет. Вот правленый скрипт, с отключенными рандомными аномалиями на всех локациях: -- -*- mode: lua; coding: windows-1251-dos -*- --[[-------------------------- variable and table --------------------------]] local table_sort=table.sort local math_random=math.random local string_find=string.find local anoms_classes = { [ clsid.zone_bfuzz_s ] = true, [ clsid.zone_electra_s ] = true, [ clsid.zone_galant_s ] = true, [ clsid.zone_ice_s ] = true, [ clsid.zone_mbald_s ] = true, [ clsid.zone_mincer_s ] = true, [clsid.zone_zharka_s]=true } local anoms_difficulty_koef={ [0]=0, [1]=0, [2]=0, [3]=0 } local anoms_sections={ buzz={"buzz",{shtype=0,radius=1.0,center={0,0,0}}}, electra={"witches_galantine",{shtype=0,radius=1,center={0,0,0}}}, fountain={"fountain",{shtype=0,radius=1.0,center={0,0,0}}}, gravi={"gravi_zone",{shtype=0,radius=2,center={0,0,0}}}, mincer={"mincer",{shtype=0,radius=2,center={0,0,0}}}, mosquito_bald={"mosquito_bald",{shtype=0,radius=2,center={0,0,0}}}, sakbuzz={"sakbuzz",{shtype=0,radius=0.1,center={0,0,0}}}, smallrain={"smallrain",{shtype=0,radius=0.1,center={0,0,0}}}, sphere={"sphere",{shtype=0,radius=2.8,center={0,0,0}}}, zavesa={"zavesa",{shtype=0,radius=1,center={0,0,0}}}, zharka_static={"zharka_static",{shtype=1,v1={1,0,0},v2={0,5,0},v3={0,0,1},offset={0,0,0}}} } local anti_spawn_zones={} local arts_sections={ acumm = "art_acumm", balb_1="af_medusa", balb_2="af_cristall_flower", balb_3="af_night_star", buzz_1="af_ameba_slime", buzz_2="af_ameba_slug", buzz_3="af_ameba_mica", dummy_1="af_dummy_spring", dummy_2="af_dummy_dummy", dummy_3="af_dummy_battery", dummy_4="af_dummy_pellicle", dummy_5="af_fuzz_kolobok", dummy_6="af_dummy_glassbeads", electra_1="af_electra_sparkler", electra_2="af_electra_flash", electra_3="af_electra_moonlight", gravi_1="af_vyvert", gravi_2="af_gravi", gravi_3="af_gold_fish", mincer_1="af_blood", mincer_2="af_mincer_meat", mincer_3="af_soul", rusty_1="af_rusty_thorn", rusty_2="af_rusty_kristall", rusty_3="af_rusty_sea-urchin", voron_1="af_eye_voron", zharka_1="af_drops", zharka_2="af_fireball", zharka_3="af_cristall", -- небольшой спавн модификатов af_cry_1="af_cry_1", af_cry_2="af_cry_2", af_cry_3="af_cry_3", af_babka_1="af_babka_1", af_babka_2="af_babka_2", af_babka_3="af_babka_3", af_babka_4="af_babka_4", af_dik_1="af_dik_1", af_dik_2="af_dik_2", af_dik_3="af_dik_3", af_dik_4="af_dik_4", af_spirit_1="af_spirit_1", af_spirit_2="af_spirit_2", af_spirit_3="af_spirit_3", af_spirit_4="af_spirit_4", af_armor_1="af_armor_1", af_armor_2="af_armor_2", af_armor_3="af_armor_3", af_armor_4="af_armor_4", af_pudd_1="af_pudd_1", af_pudd_2="af_pudd_2", af_pudd_3="af_pudd_3", af_pudd_4="af_pudd_4", af_kol_1="af_kol_1", af_kol_2="af_kol_2", af_kol_3="af_kol_3", af_kol_4="af_kol_4", af_buliz="af_buliz" } -- Здесь перечислены все интервалы game_vertex для каждого -- уровня. Можно не запуская игру смотреть, на каком уровне спавнится -- объект game_vertexes = { -- l01_escape = {0,251}, -- l02_garbage = {252,415}, -- l03_agroprom = {416,702}, -- l03u_agr_underground = {703,810}, -- l04_darkvalley = {811,1108}, -- l04u_labx18 = {1109,1167}, -- l05_bar = {1168,1307}, -- l06_rostok = {1308,1437}, -- l08_yantar = {1438,1528}, -- l08u_brainlab = {1529,1544}, -- l07_military = {1545,1861}, -- l10_radar = {1862,2116}, -- l11_pripyat = {2117,2272}, -- l12_stancia = {2273,2401}, -- l12u_sarcofag = {2402,2466}, -- l12u_control_monolith = {2467,2516}, -- l12_stancia_2 = {2517,2660}, -- l10u_bunker = {2661,2791}, -- atp_for_test22 = {2792,2861}, -- peshera = {2862,2880}, -- puzir = {2881,2885}, -- aver = {2886,2908}, -- av_peshera = {2909,2987}, -- limansk = {2988,3027}, -- hospital = {3028,3075}, -- generators = {3076,3152}, -- warlab = {3153,3223}, -- red_forest = {3224,3323}, -- lost_village = {3324,3336}, -- marsh = {3337,3581}, -- dead_city = {3582,3659}, -- zaton = {3660,3699}, -- jupiter = {3700,3747}, -- pripyat = {3748,3770}, -- jupiter_underground = {3771,3829}, -- labx8 = {3830,3850}, } level_vertexes={ -- l01_escape = 595499, -- l02_garbage = 382663, -- l03_agroprom = 437421, -- l03u_agr_underground = 4810, -- l04_darkvalley = 390125, -- l04u_labx18 = 7565, -- l05_bar = 99539, -- l06_rostok = 67713, -- l07_military = 418268, -- l08_yantar = 141471, -- l08u_brainlab = 7724, -- l10_radar = 227189, -- l10u_bunker = 8723, -- l11_pripyat = 261219, -- l12_stancia = 477923, -- l12_stancia_2 = 264576, -- l12u_control_monolith = 3971, -- l12u_sarcofag = 10620, -- puzir = 377572, -- aver = 1790762, -- marsh = 528961, -- limansk = 61524, -- hospital = 7865, -- red_forest = 166431, -- lost_village = 49127, -- generators = 752337, -- atp_for_test22 = 1049687, -- dead_city = 551769, -- zaton = 1851251, -- jupiter = 1486320, -- pripyat = 487255, -- av_peshera = 172361, -- peshera = 32109, -- warlab = 7747, -- jupiter_underground = 40830, -- labx8 = 5799, } level_anoms={ -- l01_escape={50,75,400,{electra=12, zavesa=2, smallrain=6, fountain=7, gravi=0, mincer=0, buzz=0, sakbuzz=2, mosquito_bald=0, sphere=4}}, -- l02_garbage={50,75,400,{mosquito_bald=12, mincer=2, smallrain=5, zavesa=3, electra=15, gravi=10, buzz=12, sakbuzz=3, sphere=3, fountain=2}}, -- l03_agroprom={10,14,100,{mosquito_bald=12, mincer=3, smallrain=4, fountain=2, zavesa=2, electra=0, buzz=12, gravi=10, sakbuzz=3, sphere=3}}, -- l04_darkvalley={11,15,100,{mincer=3, mosquito_bald=12, fountain=2, zavesa=3, smallrain=5, electra=0, buzz=10, zharka_static=8, gravi=8, sakbuzz=5, sphere=4}}, -- l05_bar={35,45,150,{mosquito_bald=8, mincer=2, zavesa=3, fountain=1, smallrain=4, electra=1, buzz=5, gravi=8, sakbuzz=2, zharka_static=4, sphere=2}}, -- l06_rostok={10,50,300,{mincer=3, mosquito_bald=7, smallrain=2, electra=2, zavesa=2, zharka_static=25, gravi=0, sakbuzz=3, buzz=10, sphere=2, fountain=1}}, -- l08_yantar={80,110,400,{mosquito_bald=8, mincer=8, fountain=1, smallrain=4, zavesa=3, electra=2, buzz=8, zharka_static=5, gravi=8, sakbuzz=3, sphere=3}}, -- l07_military={11,15,100,{mincer=4 , mosquito_bald=15, fountain=2, smallrain=4, zavesa=3, electra=12, zharka_static=8, gravi=0, sakbuzz=3, buzz=10, sphere=4}}, -- l10_radar={12,14,100,{mincer=6, mosquito_bald=11, fountain=10, smallrain=6, electra=2, zavesa=3, buzz=10, zharka_static=12, gravi=10, sakbuzz=5, sphere=4}}, -- l11_pripyat={11,15,90,{mincer=10, mosquito_bald=10, zavesa=3, fountain=1, smallrain=1, electra=10, zharka_static=8, gravi=10, buzz=10, sakbuzz=2, sphere=3}}, -- l12_stancia={70,90,700,{mincer=2, mosquito_bald=10, smallrain=6, electra=0, fountain=1, zavesa=3, buzz=10, zharka_static=7, gravi=8, sakbuzz=4, sphere=4}}, -- puzir={150,170,450,{mincer=12, mosquito_bald=15, smallrain=6, zavesa=3, electra=14, buzz=12, zharka_static=5, gravi=14, sakbuzz=3, sphere=4, fountain=1}}, -- aver={18,19,75,{mincer=14, mosquito_bald=12, smallrain=5, electra=0, zavesa=4, buzz=15, zharka_static=5, gravi=15, sakbuzz=4, sphere=5, fountain=1}}, -- marsh={10,20,100,{mincer=8, mosquito_bald=12, smallrain=9, electra=0, zavesa=4, buzz=15, zharka_static=5, gravi=15, sakbuzz=4, sphere=5, fountain=1}}, -- limansk={5,6,30,{mosquito_bald=10, mincer=12, smallrain=2, fountain=16, zavesa=2, electra=0, gravi=10, buzz=10, sakbuzz=2, zharka_static=8, sphere=3}}, -- hospital={10,20,100,{mincer=8, mosquito_bald=8, zavesa=2, fountain=1, electra=7, buzz=8, gravi=5, sakbuzz=2, zharka_static=5, sphere=2}}, -- red_forest={11,15,40,{mincer=8, mosquito_bald=10, zavesa=4, fountain=2, smallrain=6, electra=3, zharka_static=8, gravi=10, buzz=10, sakbuzz=4, sphere=5}}, -- lost_village={8,10,25,{mincer=8, mosquito_bald=8, zavesa=3, fountain=1, smallrain=1, electra=10, zharka_static=5, gravi=5, buzz=5, sakbuzz=2, sphere=3}}, -- generators={0,0,0,{mincer=15, mosquito_bald=11, fountain=1, zavesa=5, smallrain=2, electra=15, zharka_static=5, gravi=10, buzz=16, sakbuzz=6, sphere=4}}, -- atp_for_test22={16,18,40,{mincer=13, mosquito_bald=10, fountain=2, smallrain=2, zavesa=4, electra=15, zharka_static=10, gravi=10, buzz=20, sakbuzz=4, sphere=4}}, -- dead_city={11,15,90,{mincer=10, mosquito_bald=10, zavesa=3, fountain=2, smallrain=2, electra=10, zharka_static=8, gravi=10, buzz=10, sakbuzz=1, sphere=4}}, -- zaton={18,19,100,{electra=25, zavesa=6, smallrain=3, fountain=5, gravi=15, mincer=15, buzz=15, sakbuzz=8, mosquito_bald=15, sphere=12, zharka_static=8}}, -- jupiter={18,19,100,{electra=25, zavesa=4, smallrain=3, fountain=4, gravi=20, mincer=15, buzz=25, sakbuzz=5, mosquito_bald=20, sphere=12}}, -- pripyat={14,16,100,{electra=15, zavesa=4, smallrain=1, fountain=3, gravi=18, mincer=15, buzz=15, sakbuzz=4, mosquito_bald=18, sphere=10}} } local level_arts={ -- l01_escape={2,4,{balb_1=22, balb_2=2, gravi_1=22, gravi_2=5, mincer_1=25, electra_1=9, electra_2=1, rusty_1=5, acumm=2, af_buliz=1, af_cry_1=1, af_babka_1=1, af_spirit_1=1, af_armor_1=1, af_pudd_1=1, af_kol_1=1}}, -- l02_garbage={2,4,{balb_1=18, balb_2=5, gravi_1=24, gravi_2=5, mincer_1=19, mincer_2=5, electra_1=10, rusty_1=5, acumm=2, af_buliz=1, af_cry_1=1, af_babka_1=1, af_spirit_1=1, af_armor_1=1, af_pudd_1=1, af_kol_1=1}}, -- l03_agroprom={2,4,{balb_1=11, balb_2=5, gravi_1=11, gravi_2=5, mincer_1=8, mincer_2=5, electra_1=8, electra_2=5, zharka_1=8, zharka_2=5, buzz_1=10, rusty_1=5, acumm=2, af_buliz=1, af_cry_1=1, af_babka_1=1, af_babka_2=1, af_spirit_1=1, af_spirit_2=1, af_armor_1=1, af_armor_2=1, af_pudd_1=1, af_pudd_2=1, af_kol_1=1, af_kol_2=1}}, -- l04_darkvalley={2,4,{balb_1=1, balb_2=8, gravi_1=5, gravi_2=7, mincer_1=5, mincer_2=9, electra_1=5, electra_2=8, zharka_1=9, zharka_2=9, buzz_1=9, buzz_2=3, rusty_1=5, rusty_2=2, voron_1=1, acumm=2, af_buliz=1, af_cry_1=1, af_babka_1=1, af_babka_2=1, af_spirit_1=1, af_spirit_2=1, af_armor_1=1, af_armor_2=1, af_pudd_1=1, af_pudd_2=1, af_kol_1=1, af_kol_2=1}}, -- l05_bar={2,4,{balb_1=15, balb_2=7, gravi_1=15, mincer_1=17, electra_1=10, buzz_1=5, buzz_2=3, rusty_1=5, rusty_2=3, dummy_1=1, dummy_2=1, dummy_4=1, dummy_5=1, acumm=4, af_buliz=1, af_cry_1=1, af_babka_1=1, af_babka_2=1, af_spirit_1=1, af_spirit_2=1, af_armor_1=1, af_armor_2=1, af_pudd_1=1, af_pudd_2=1, af_kol_1=1, af_kol_2=1}}, -- l06_rostok={2,4,{balb_2=2, balb_3=2, mincer_2=2, mincer_3=2, electra_1=8, electra_2=8, zharka_1=14, zharka_2=8, zharka_3=5, buzz_1=5, rusty_1=10, rusty_2=8, rusty_3=5, dummy_2=1, dummy_3=1, dummy_4=1, acumm=2, af_buliz=1, af_cry_1=1, af_cry_2=0.5, af_babka_1=1, af_babka_2=1, af_babka_3=0.5, af_dik_1=0.5, af_dik_2=0.5, af_spirit_1=1, af_spirit_2=1, af_spirit_3=0.5, af_armor_1=1, af_armor_2=1, af_armor_3=0.5, af_pudd_1=1, af_pudd_2=1, af_pudd_3=0.5, af_kol_1=1, af_kol_2=1, af_kol_3=0.5}}, -- l08_yantar={2,4,{balb_1=1, balb_2=3, balb_3=2, gravi_1=7, gravi_2=5, gravi_3=3, mincer_1=5, mincer_2=4, mincer_3=2, electra_1=7, electra_2=5, electra_3=2, zharka_1=6, zharka_2=4, zharka_3=2, buzz_1=7, buzz_2=5, buzz_3=1, rusty_1=7, rusty_2=3, rusty_3=2, af_buliz=1, af_cry_1=1, af_cry_2=0.5, af_babka_1=1, af_babka_2=1, af_babka_3=0.5, af_dik_1=0.5, af_dik_2=0.5, af_spirit_1=1, af_spirit_2=1, af_spirit_3=0.5, af_armor_1=1, af_armor_2=1, af_armor_3=0.5, af_pudd_1=1, af_pudd_2=1, af_pudd_3=0.5, af_kol_1=1, af_kol_2=1, af_kol_3=0.5}}, -- l07_military={2,4,{balb_1=2, balb_2=4, balb_3=2, gravi_1=3, gravi_2=5, gravi_3=3, mincer_1=5, mincer_2=4, mincer_3=4, electra_1=7, electra_2=4, electra_3=2, zharka_1=4, zharka_2=5, zharka_3=3, buzz_1=7, buzz_2=2, rusty_1=7, rusty_2=4, rusty_3=2, dummy_2=1, dummy_3=1, dummy_5=1, acumm=2, af_buliz=1, af_cry_1=1, af_cry_2=0.5, af_babka_1=1, af_babka_2=1, af_babka_3=0.5, af_dik_1=0.5, af_dik_2=0.5, af_spirit_1=1, af_spirit_2=1, af_spirit_3=0.5, af_armor_1=1, af_armor_2=1, af_armor_3=0.5, af_pudd_1=1, af_pudd_2=1, af_pudd_3=0.5, af_kol_1=1, af_kol_2=1, af_kol_3=0.5}}, -- l10_radar={2,4,{balb_1=3, balb_2=5, balb_3=4, gravi_1=4, gravi_2=3, gravi_3=3, mincer_1=5, mincer_2=5, mincer_3=4, electra_1=4, electra_2=4, electra_3=3, zharka_1=4, zharka_2=4, zharka_3=4, buzz_1=5, buzz_2=5, rusty_1=5, rusty_2=5, rusty_3=4, af_buliz=1, af_cry_2=1, af_cry_3=0.5, af_babka_2=1, af_babka_3=1, af_babka_4=0.5, af_dik_1=1, af_dik_2=0.5, af_dik_3=0.5, af_spirit_2=1, af_spirit_3=1, af_spirit_4=0.5, af_armor_2=1, af_armor_3=1, af_armor_4=0.5, af_pudd_2=1, af_pudd_3=1, af_pudd_4=0.5, af_kol_2=1, af_kol_3=1, af_kol_4=0.5}}, -- l11_pripyat={2,4,{balb_1=2, balb_2=2, balb_3=2, gravi_1=3, gravi_2=3, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=2, electra_2=4, electra_3=3, zharka_1=4, zharka_2=3, zharka_3=3, buzz_1=4, buzz_2=4, buzz_3=3, rusty_1=7, rusty_2=4, rusty_3=4, dummy_1=1, dummy_2=2, dummy_3=1, dummy_4=1, dummy_5=1, acumm=2, af_buliz=1, af_cry_2=1, af_cry_3=1, af_babka_2=1, af_babka_3=1, af_babka_4=1, af_dik_1=1, af_dik_2=1, af_dik_3=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=1, af_armor_2=1, af_armor_3=1, af_armor_4=1, af_pudd_2=1, af_pudd_3=1, af_pudd_4=1, af_kol_2=1, af_kol_3=1, af_kol_4=1}}, -- l12_stancia={2,4,{balb_1=1, balb_2=1, balb_3=1, gravi_1=3, gravi_2=3, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=4, electra_2=4, electra_3=3, zharka_1=4, zharka_2=4, zharka_3=3, buzz_1=3, buzz_2=4, buzz_3=3, rusty_1=4, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, dummy_5=1, acumm=2, af_buliz=1, af_cry_2=1, af_cry_3=2, af_babka_2=1, af_babka_3=1, af_babka_4=2, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=2, af_armor_2=1, af_armor_3=1, af_armor_4=2, af_pudd_2=1, af_pudd_3=1, af_pudd_4=2, af_kol_2=1, af_kol_3=1, af_kol_4=2}}, -- puzir={4,6,{balb_1=3, balb_2=3, gravi_1=5, gravi_2=5, mincer_1=7, mincer_2=5, electra_1=10, electra_2=5, zharka_1=9, zharka_2=5, buzz_1=10, buzz_2=8, buzz_3=5, rusty_1=5, rusty_2=2, af_buliz=1, af_cry_1=1, af_cry_2=1, af_babka_1=1, af_babka_2=1, af_spirit_1=1, af_spirit_2=1, af_armor_1=1, af_armor_2=1, af_pudd_1=1, af_pudd_2=1, af_kol_1=1, af_kol_2=1}}, -- aver={2,4,{balb_1=2, balb_2=3, balb_3=3, gravi_1=6, gravi_2=4, gravi_3=3, mincer_1=3, mincer_2=4, mincer_3=1, electra_1=5, electra_2=5, electra_3=2, zharka_1=4, zharka_2=4, zharka_3=1, buzz_1=6, buzz_2=6, buzz_3=4, rusty_1=5, rusty_2=4, rusty_3=4, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, dummy_5=1, acumm=2, af_buliz=1, af_cry_2=1, af_babka_2=1, af_babka_3=1, af_dik_2=1, af_dik_3=1, af_spirit_2=1, af_spirit_3=1, af_armor_2=1, af_armor_3=1, af_pudd_2=1, af_pudd_3=1, af_kol_2=1, af_kol_3=1}}, -- marsh={2,4,{balb_1=2, balb_2=3, balb_3=3, gravi_1=5, gravi_2=4, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=5, electra_2=4, electra_3=3, zharka_1=5, zharka_2=4, zharka_3=3, buzz_1=7, buzz_2=4, buzz_3=3, rusty_1=5, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, voron_1=1, af_buliz=1, af_cry_2=1, af_babka_2=1, af_babka_3=1, af_dik_2=1, af_dik_3=1, af_spirit_2=1, af_spirit_3=1, af_armor_2=1, af_armor_3=1, af_pudd_2=1, af_pudd_3=1, af_kol_2=1, af_kol_3=1}}, -- limansk={1,2,{balb_1=2, balb_2=4, balb_3=5, gravi_1=4, gravi_2=4, gravi_3=4, mincer_1=4, mincer_2=4, mincer_3=4, electra_1=4, electra_2=4, electra_3=4, zharka_1=4, zharka_2=4, zharka_3=4, buzz_1=4, buzz_2=4, rusty_1=4, rusty_2=4, rusty_3=4, af_buliz=1, af_cry_2=1, af_cry_3=1, af_babka_2=1, af_babka_3=1, af_babka_4=1, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=1, af_armor_2=1, af_armor_3=1, af_armor_4=1, af_pudd_2=1, af_pudd_3=1, af_pudd_4=1, af_kol_2=1, af_kol_3=1, af_kol_4=1}}, -- hospital={1,2,{balb_1=2, balb_2=2, balb_3=3, gravi_1=3, gravi_2=4, gravi_3=3, mincer_1=3, mincer_2=4, mincer_3=3, electra_1=7, electra_2=4, electra_3=3, zharka_1=4, zharka_2=4, zharka_3=3, buzz_1=4, buzz_2=4, buzz_3=3, rusty_1=4, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, dummy_5=1, af_buliz=1, af_cry_2=1, af_cry_3=1, af_babka_2=1, af_babka_3=1, af_babka_4=1, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=1, af_armor_2=1, af_armor_3=1, af_armor_4=1, af_pudd_2=1, af_pudd_3=1, af_pudd_4=1, af_kol_2=1, af_kol_3=1, af_kol_4=1}}, -- red_forest={2,4,{balb_1=3, balb_2=6, balb_3=5, gravi_1=4, gravi_2=3, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=5, electra_1=5, electra_2=4, electra_3=3, zharka_1=5, zharka_2=5, zharka_3=3, buzz_1=3, buzz_2=5, voron_1=1, rusty_1=4, rusty_2=4, af_buliz=1, af_cry_2=1, af_cry_3=1, af_babka_2=1, af_babka_3=1, af_babka_4=1, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=1, af_armor_2=1, af_armor_3=1, af_armor_4=1, af_pudd_2=1, af_pudd_3=1, af_pudd_4=1, af_kol_2=1, af_kol_3=1, af_kol_4=1}}, -- lost_village={1,2,{balb_1=4, balb_2=7, balb_3=5, gravi_1=4, gravi_2=3, gravi_3=3, mincer_1=5, mincer_2=7, mincer_3=5, electra_1=5, electra_2=4, electra_3=2, zharka_1=4, zharka_2=4, zharka_3=4, buzz_1=4, buzz_2=4, dummy_1=5, af_buliz=1, af_cry_2=1, af_cry_3=1, af_babka_2=1, af_babka_3=1, af_babka_4=1, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=1, af_armor_2=1, af_armor_3=1, af_armor_4=1, af_pudd_2=1, af_pudd_3=1, af_pudd_4=1, af_kol_2=1, af_kol_3=1, af_kol_4=1}}, -- generators={2,4,{balb_1=1, balb_2=3, balb_3=2, gravi_1=2, gravi_2=2, gravi_3=2, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=3, electra_2=3, electra_3=2, zharka_1=5, zharka_2=4, zharka_3=4, buzz_1=5, buzz_2=4, buzz_3=3, rusty_2=6, dummy_1=4, dummy_2=4, dummy_3=1, dummy_4=1, dummy_5=1, af_buliz=1, af_cry_2=1, af_cry_3=2, af_babka_2=1, af_babka_3=1, af_babka_4=2, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=2, af_armor_2=1, af_armor_3=1, af_armor_4=2, af_pudd_2=1, af_pudd_3=1, af_pudd_4=2, af_kol_2=1, af_kol_3=1, af_kol_4=2}}, -- atp_for_test22={2,4,{balb_1=2, balb_2=3, balb_3=2, gravi_1=6, gravi_2=4, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=1, electra_1=5, electra_2=5, electra_3=2, zharka_1=4, zharka_2=4, zharka_3=1, buzz_1=5, buzz_2=4, buzz_3=4, rusty_1=5, rusty_2=4,dummy_1=5, dummy_2=1, dummy_3=1, dummy_4=1, voron_1=1, acumm=3, af_buliz=1, af_cry_1=1, af_cry_2=0.5, af_babka_1=1, af_babka_2=1, af_babka_3=0.5, af_dik_1=0.5, af_dik_2=0.5, af_spirit_1=1, af_spirit_2=1, af_spirit_3=0.5, af_armor_1=1, af_armor_2=1, af_armor_3=0.5, af_pudd_1=1, af_pudd_2=1, af_pudd_3=0.5, af_kol_1=1, af_kol_2=1, af_kol_3=0.5}}, -- dead_city={2,4,{balb_1=4, balb_2=3, balb_3=3, gravi_1=4, gravi_2=3, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=3, electra_2=3, electra_3=3, zharka_1=4, zharka_2=4, zharka_3=3, buzz_1=4, buzz_2=4, buzz_3=3, rusty_1=4, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=2, dummy_3=1, dummy_4=1, dummy_5=1, af_buliz=1, af_cry_2=1, af_cry_3=1, af_babka_2=1, af_babka_3=1, af_babka_4=1, af_dik_2=1, af_dik_3=1, af_dik_4=1, af_spirit_2=1, af_spirit_3=1, af_spirit_4=1, af_armor_2=1, af_armor_3=1, af_armor_4=1, af_pudd_2=1, af_pudd_3=1, af_pudd_4=1, af_kol_2=1, af_kol_3=1, af_kol_4=1}}, -- zaton={4,6,{balb_1=2, balb_2=3, balb_3=3, gravi_1=3, gravi_2=3, gravi_3=3, mincer_1=3, mincer_2=3, mincer_3=3, electra_1=5, electra_2=4, electra_3=3, zharka_1=5, zharka_2=4, zharka_3=3, buzz_1=7, buzz_2=4, buzz_3=3, rusty_1=5, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, voron_1=1, acumm=2, af_buliz=1, af_cry_2=1, af_cry_3=0.5, af_babka_2=1, af_babka_3=1, af_babka_4=0.5, af_dik_1=1, af_dik_2=0.5, af_dik_3=0.5, af_spirit_2=1, af_spirit_3=1, af_spirit_4=0.5, af_armor_2=1, af_armor_3=1, af_armor_4=0.5, af_pudd_2=1, af_pudd_3=1, af_pudd_4=0.5, af_kol_2=1, af_kol_3=1, af_kol_4=0.5}}, -- jupiter={4,6,{balb_1=2, balb_2=3, balb_3=3, gravi_1=4, gravi_2=4, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=5, electra_2=4, electra_3=3, zharka_1=5, zharka_2=4, zharka_3=3, buzz_1=5, buzz_2=4, buzz_3=3, rusty_1=5, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, voron_1=1, af_buliz=1, af_cry_2=1, af_cry_3=0.5, af_babka_2=1, af_babka_3=1, af_babka_4=0.5, af_dik_1=1, af_dik_2=0.5, af_dik_3=0.5, af_spirit_2=1, af_spirit_3=1, af_spirit_4=0.5, af_armor_2=1, af_armor_3=1, af_armor_4=0.5, af_pudd_2=1, af_pudd_3=1, af_pudd_4=0.5, af_kol_2=1, af_kol_3=1, af_kol_4=0.5}}, -- pripyat={2,4,{balb_1=2, balb_2=3, balb_3=3, gravi_1=4, gravi_2=4, gravi_3=3, mincer_1=4, mincer_2=4, mincer_3=3, electra_1=5, electra_2=4, electra_3=3, zharka_1=5, zharka_2=4, zharka_3=3, buzz_1=5, buzz_2=4, buzz_3=3, rusty_1=5, rusty_2=4, rusty_3=3, dummy_1=1, dummy_2=1, dummy_3=1, dummy_4=1, voron_1=1, af_buliz=1, af_cry_2=1, af_cry_3=0.5, af_babka_2=1, af_babka_3=1, af_babka_4=0.5, af_dik_1=1, af_dik_2=0.5, af_dik_3=0.5, af_spirit_2=1, af_spirit_3=1, af_spirit_4=0.5, af_armor_2=1, af_armor_3=1, af_armor_4=0.5, af_pudd_2=1, af_pudd_3=1, af_pudd_4=0.5, af_kol_2=1, af_kol_3=1, af_kol_4=0.5}} } --[[-------------------------- variable and table ---------------------end--]] --[[-------------------------- function for spawn --------------------------]] function init() local blow = amk.load_variable( "blowout", 0 ) local lname = level.name() if not level_vertexes[ lname ] then return end if not level_anoms[ lname ] then return end local anoms_sect = "amk_anoms." .. lname if system_ini():section_exist( anoms_sect ) then local result, id, value = nil, nil, nil for a = 0, system_ini():line_count( anoms_sect ) - 1 do result, id, value = system_ini():r_line( anoms_sect, a, "", "" ) if id and amk.trim( id ) ~= "" and amk.trim( id ) then local s = amk.str_explode( ",", id, true ) if s[ 1 ] == nil or s[ 2 ] == nil or s[ 3 ] == nil or s[ 4 ] == nil then abort( "amk_anoms:init() - error while parsing safe zones for " .. lname .. " at section's line #" .. ( a + 1 ) ) end table.insert( anti_spawn_zones, { vector():set( tonumber( s[ 1 ] ), tonumber( s[ 2 ] ), tonumber( s[ 3 ] ) ), tonumber( s[ 4 ] ) } ) end end end if blow > 0 and blow < 4 then return end pre_blow_off() generate_anoms() end function after_blow_on() local lname = level.name() if not level_vertexes[ lname ] then return end if not level_anoms[ lname ] then return end generate_anoms() move_mgr.invalidate_pp_accessibility() end --[=[ function pre_blow_off() -- уточнить нужна ли проверка на существование гейм вертекса по гейм вертексу объекта, который уже заспавнен и готовится к удалению local sim=alife() local ggraph=game_graph() for i=0,65534 do local sobj=sim:object(i) if sobj then if is_anomaly(sobj:clsid()) and ggraph:valid_vertex_id(sobj.m_game_vertex_id) then local map=sim:level_name(ggraph:vertex(sobj.m_game_vertex_id):level_id()) if not check_exclusion(sobj,map) then local status=get_anomaly_status(sobj) if status=="" or status=="on" then set_anomaly_status(sobj,"del") alife():release(sobj,true) end end end end end end --]=] function pre_blow_off() for i = 0, 65534 do local sobj = alife():object(i) if sobj then if is_anomaly( sobj:clsid() ) then local map = alife():level_name( game_graph():vertex( sobj.m_game_vertex_id ):level_id() ) if not check_exclusion( sobj, map ) then local status = get_anomaly_status( sobj ) if status == "" or status == "on" then set_anomaly_status( sobj, "del" ) alife():release( sobj, true ) end end end end end end function cleanup_arts() local known_arts = {} local known_sects = {} for lname, alist in pairs( level_arts ) do if not known_arts[ lname ] then known_arts[ lname ] = {} end for k, v in pairs( alist[ 3 ] ) do local sect = arts_sections[ k ] if sect then known_arts[ lname ][ sect ] = true known_sects[ sect ] = true end end end for i = 0, 65534 do local sobj = alife():object( i ) if sobj and sobj.parent_id == 65535 then local sect = sobj:section_name() if known_sects[ sect ] then local gvid = sobj.m_game_vertex_id local lname = alife():level_name( game_graph():vertex( gvid ):level_id() ) if known_arts[ lname ] and known_arts[ lname ][ sect ] then alife():release( sobj, true ) end end end end for k, v in pairs( amk_offline_alife.off_npcs ) do v.artefacts = {} end end function generate_anoms() local lname = level.name() local v = level_anoms[ lname ] if v then local cnt = 0 local mxx = math_random( v[ 1 ], v[ 2 ] ) * anoms_difficulty_koef[ level.get_game_difficulty() ] while cnt < mxx do if generate_anomaly() then cnt = cnt + 1 end end end end function generate_arts() local lname = level.name() if not level_vertexes[ lname ] then return end local v = level_arts[ lname ] if v then local cnt, mxx = 0, math_random( v[ 1 ], v[ 2 ] ) while cnt < mxx do if generate_art( lname ) then cnt = cnt + 1 end end end -- переделано на поршни - при выбросе снимаем все поршни, при спавне -- артов на локе выдаем - это больше не нужно --generate_test(lname) end function generate_anomaly() local lname = level.name() local gvn, gvx, lvx = game_vertexes[ lname ][ 1 ], game_vertexes[ lname ][ 2 ], level_vertexes[ lname ] local new_lv = math_random( 1, lvx ) local actor_pos = db.actor:position() local pos = level.vertex_position( new_lv ) if actor_pos:distance_to( pos ) < 5 then return false end if not check_coordinates( pos ) then return false end local new_gv = 0 local min_dist = 100000 for a = gvn, gvx do g1 = game_graph():vertex( a ):game_point() if g1:distance_to( pos ) < min_dist then min_dist = g1:distance_to( pos ) new_gv = a end end if game_graph():valid_vertex_id( new_gv ) then return spawn_rand_anom( pos, new_gv, new_lv ) end end function generate_art( lname, section, pre_check_coords_func ) local gvn, gvx, lvx = game_vertexes[ lname ][ 1 ], game_vertexes[ lname ][ 2 ], level_vertexes[ lname ] local new_lv = math_random( 1, lvx ) local pos = level.vertex_position( new_lv ) if not check_coordinates_arts( pos, lname ) then return false end if pre_check_coords_func then if not pre_check_coords_func( pos ) then return false end end local new_gv = 0 local min_dist = 100000 for a = gvn, gvx, 1 do g1 = game_graph():vertex( a ):game_point() if g1:distance_to( pos ) < min_dist then min_dist = g1:distance_to( pos ) new_gv = a end end if game_graph():valid_vertex_id( new_gv ) then if section then return spawn_art( section, pos, gv, lv ) else return spawn_rand_arts( pos, new_gv, new_lv, lname ) end end end -- переспавн провалившегося под текстуры артефакта на текущем уровне, -- на входе оффлайновый провалившийся арт function respawn_falling_art(art) local section = art:section_name() alife():release(art) local lname = level.name() local gvn,gvx,lvx,new_lv,pos repeat gvn,gvx,lvx = game_vertexes[lname][1], game_vertexes[lname][2], level_vertexes[lname] new_lv=math_random(1,lvx) pos = level.vertex_position(new_lv) until check_coordinates_arts(pos,lname) local new_gv = 0 local min_dist = 100000 for a = gvn, gvx, 1 do g1 = game_graph():vertex(a):game_point() if g1:distance_to(pos)<min_dist then min_dist = g1:distance_to(pos) new_gv = a end end if game_graph():valid_vertex_id(new_gv) then return spawn_art(section,pos,new_gv,new_lv) end end --[=[ переделано на поршни - при выбросе снимаем все поршни, при спавне --артов на локе выдаем - это больше не нужно function generate_test(lname) local gvn,gvx,lvx = game_vertexes[lname][1], game_vertexes[lname][2], level_vertexes[lname] local new_lv=math_random(1,lvx) local pos = level.vertex_position(new_lv) if not check_coordinates_arts(pos,lname) then return false end local new_gv = 0 local min_dist = 100000 for a = gvn, gvx, 1 do g1 = game_graph():vertex(a):game_point() if g1:distance_to(pos)<min_dist then min_dist = g1:distance_to(pos) new_gv = a end end if game_graph():valid_vertex_id(new_gv) then return spawn_test(pos,new_gv,new_lv,lname) end end --]=] function spawn_rand_anom(pos,gv,lv) local lname=level.name() local shapes,shape1={},{} local section section = "zone_ice" local rnd=math_random()*100 if 5>rnd then shape1={shtype=0,radius=4,center={0,0,0}} else local rnd_max = 0 for k,v in pairs(level_anoms[lname][4]) do rnd_max = rnd_max + v end rnd=math_random(1,rnd_max) for k,v in pairs(level_anoms[lname][4]) do if rnd<=v then section=anoms_sections[k] break end rnd=rnd-v end local anom_prefix="amk_zone_" local suffix_num=math_random(1,3) local suffix=anom_suffix(suffix_num) shape1=section[2] section=anom_prefix..section[1]..suffix end shapes[1]={} shapes[1].shtype=shape1.shtype if shape1.shtype == 0 then shapes[1].radius = shape1.radius shapes[1].center = vector():set(shape1.center[1],shape1.center[2],shape1.center[3]) else shapes[1].v1 = vector():set(shape1.v1[1],shape1.v1[2],shape1.v1[3]) shapes[1].v2 = vector():set(shape1.v2[1],shape1.v2[2],shape1.v2[3]) shapes[1].v3 = vector():set(shape1.v3[1],shape1.v3[2],shape1.v3[3]) shapes[1].offset = vector():set(shape1.offset[1],shape1.offset[2],shape1.offset[3]) end local status="on" return spawn_anomaly(section,pos,gv,lv,shapes,status) end function spawn_rand_arts(pos,gv,lv,lname) local rnd_max=0 for k,v in pairs(level_arts[lname][3]) do rnd_max=rnd_max+v*10 end local rnd=0 rnd=math_random(1,rnd_max) for k,v in pairs(level_arts[lname][3]) do if rnd<=v*10 then section=arts_sections[k] break end rnd=rnd-v*10 end return spawn_art(section,pos,gv,lv) end function spawn_anomaly(section,pos,gv,lv,shape,status) local sobj sobj=amk.spawn_item(section,pos,gv,lv) if sobj then local tbl = amk.get_anomaly_data(sobj) tbl.shapes=shape tbl.custom=modify_anomaly_custom_data(tbl.custom,status) amk.set_anomaly_data(tbl, sobj) end return sobj end function spawn_art(section,pos,gv,lv) local sobj sobj=amk.spawn_item(section,pos,gv,lv) if sobj then return sobj end end --[=[ --переделано на поршни - при выбросе снимаем все поршни, при --спавне артов на локе выдаем - это больше не нужно function spawn_test(pos,gv,lv,lname) local section="testsak_"..lname return amk.spawn_item(section,pos,gv,lv) end --]=] -- аномалии, которые не исчезнут при НИ, да и вообще function check_exclusion( obj, map ) local obj_name = obj:name() if string_find( obj_name, "amk_" ) or string_find( obj_name, "zone_ice" ) or string_find( obj_name, "caps_" ) then return false end if not level_vertexes[ map ] then return true end if not level_anoms[ map ] then return true end return string_find( obj_name, "zone_tuman" ) -- Острова туман or string_find( obj_name, "zone_fly_island" ) -- Острова парение or string_find( obj_name, "_snp" ) -- Снайпер or string_find( obj_name, "anim_ph_" ) -- Аномальные объекты or string_find( obj_name, "propeller" ) -- Пропеллер or string_find( obj_name, "sky_anomaly" ) -- Sky_Anomaly or string_find( obj_name, "esc_zone_witches" ) -- перемещающаяся электра (Кордон) or string_find( obj_name, "pri_zone_witches" ) -- электра на колесе обозрения (ЦП) or string_find( obj_name, "zone_topolinypuh" ) -- пух (Радар) or string_find( obj_name, "red_zone_acidic" ) -- холодцы в шахте (Красный Лес) or string_find( obj_name, "podval_tornado_strong" ) -- торнадо в подвале (Лиманск) or string_find( obj_name, "dcity_fontan_fountain_average" ) -- фонтан в фонтане (МГ) or string_find( obj_name, "rostok_zone_witches" ) -- электры везде (Росток) or string_find( obj_name, "rostok_zone_zharka_static" ) -- жарки в тоннеле (Росток) or string_find( obj_name, "tutorial" ) -- эпичная смерть псевдоплоти (Кордон) or ( string_find( obj_name, "_mincer" ) and map ~= "l11_pripyat" ) -- почему именно там? end function anom_suffix(suffix_num) local suffix="" if suffix_num==1 then suffix="_weak" elseif suffix_num==2 then suffix="_average" else suffix="_strong" end return suffix end function check_coordinates(pos) local lname=level.name() local hides=amk_hideouts.hide[lname] local tmp if hides then for i,o in ipairs(hides) do if o.zone then for j,v in ipairs(o.zone) do if v.p3 then tmp=amk.check_npc_in_box(pos,vector():set(unpack(v.p1)),vector():set(unpack(v.p2)),vector():set(unpack(v.p3))) else tmp=amk.check_npc_in_box(pos,vector():set(unpack(v.p1)),vector():set(unpack(v.p2))) end if tmp==true then return false end end end end end for k,v in pairs(anti_spawn_zones) do if pos:distance_to(v[1])<=v[2] then return false end end return true end function check_coordinates_arts(pos,lname) for k,v in pairs(anti_spawn_zones) do if pos:distance_to(v[1])<=v[2] then return false end end local hides=amk_hideouts.hide[lname] local tmp if hides then for i,o in ipairs(hides) do if o.zone then for j,v in ipairs(o.zone) do if v.p3 then tmp=amk.check_npc_in_box(pos,vector():set(unpack(v.p1)),vector():set(unpack(v.p2)),vector():set(unpack(v.p3))) else tmp=amk.check_npc_in_box(pos,vector():set(unpack(v.p1)),vector():set(unpack(v.p2))) end if tmp==true then return false end end end end end return true end function get_anomaly_status(sobj) local tbl = amk.get_anomaly_data(sobj) local cd=tbl.custom cd=amk.parse_custom_data(cd) if not cd.dyn_anom then return "" end if not cd.dyn_anom.status then return "" end return cd.dyn_anom.status end function is_anomaly(class_id) return (class_id and anoms_classes[class_id]==true) end function modify_anomaly_custom_data(cd,status) cd=amk.parse_custom_data(cd) if not cd then cd={} end if not cd.dyn_anom then cd.dyn_anom={} end cd.dyn_anom.status=status return amk.gen_custom_data(cd) end function set_anomaly_status( sobj, status ) if sobj then local anom_id = sobj.id if status == "del" then end local tbl = amk.get_anomaly_data( sobj ) tbl.custom = modify_anomaly_custom_data( tbl.custom, status ) amk.set_anomaly_data( tbl, sobj ) set_online_anomaly_status( anom_id, status ) end end function set_online_anomaly_status( obj_id, status ) local obj=level.object_by_id( obj_id ) if obj then if status == "off" or status=="del" then obj:disable_anomaly() amk_anoms.remove_anomaly( obj_id ) amk_anoms.restrictor_deleted( obj_id, obj:name() ) else obj:enable_anomaly() local sobj = alife():object( obj_id ) amk_anoms.add_anomaly( obj_id, sobj.position, sobj.radius, sobj ) end end end --[[-------------------------- function for spawn ---------------------end--]] --[[-------------------------- npc and anom_binder -------------------------]] local anoms_for_npc={} local npcs_for_anom={} local actual_anoms_for_npc={} local npc_restrictors_need_update={} function init_if_needed( nid ) if not anoms_for_npc[ nid ] then anoms_for_npc[ nid ] = {} end if not actual_anoms_for_npc[ nid ] then actual_anoms_for_npc[ nid ] = {} end return anoms_for_npc[ nid ], actual_anoms_for_npc[ nid ] end function add_restriction( npc, id, name ) local nid = npc:id() if name == nil then name = ( level.object_by_id( id ) and level.object_by_id( id ):name() ) end if not name then get_console():execute("load ~~~ add_restriction(): Warning! Nonexistent restrictor id "..id) return end init_if_needed( nid ) if anoms_for_npc[ nid ][ id ] then else anoms_for_npc[ nid ][ id ] = name npc_restrictors_need_update[ nid ]=true end end function remove_restriction(npc,id,name,immed) local nid=npc:id() if name==nil then name=(level.object_by_id(id) and level.object_by_id(id):name()) end if not name then abort("remove_restriction(): Nonexistent restrictor id "..id) return end init_if_needed(nid) if immed then if actual_anoms_for_npc[nid][id] then npc:remove_restrictions("",name) actual_anoms_for_npc[nid][id]=nil npcs_for_anom[id][nid]=nil end if anoms_for_npc[nid][id] then anoms_for_npc[nid][id]=nil end else if anoms_for_npc[nid][id] then anoms_for_npc[nid][id]=nil npc_restrictors_need_update[nid]=true end end end function restrictor_deleted(id,name) for nid,anoms in pairs(anoms_for_npc) do if anoms[id] then anoms[id]=nil npc_restrictors_need_update[nid]=true end end end function clear_to_release(id) local cnt if npcs_for_anom[id] then for nid in pairs(npcs_for_anom[id]) do cnt=cnt+1 end return cnt==0 else return true end end function have_pending_sync( npc ) local nid = npc:id() return npc_restrictors_need_update[ nid ] == true end local max_dynamic_restrictors_count=40 function syncronize( npc ) local nid = npc:id() local cnt = 0 local anoms, actual = init_if_needed( nid ) local disttbl = {} for id in pairs( anoms ) do cnt = cnt + 1 end if cnt > max_dynamic_restrictors_count then local disttbl = {} for id in pairs( anoms ) do local dist = 0 local sobj = alife():object( id ) if sobj then dist = npc:position():distance_to_sqr( sobj.position ) else dist = 1000000 end table.insert( disttbl, { id = id,dist = dist } ) end table.sort( disttbl, function ( a, b ) return a.dist > b.dist end ) for i = 1, cnt - max_dynamic_restrictors_count do anoms[ disttbl[ i ].id ] = nil end end local add, rem = "", "" local first = true for id, name in pairs( actual ) do if not anoms[ id ] then if first then first = false rem = name else rem = name .. "," .. rem end if npcs_for_anom[ id ] then npcs_for_anom[ id ][ nid ] = nil end actual[ id ] = nil end end first = true for id, name in pairs( anoms ) do if not actual[ id ] then if first then first = false add = name else add = name .. "," .. add end if not npcs_for_anom[ id ] then npcs_for_anom[ id ] = {} end npcs_for_anom[ id ][ nid ] = true actual[ id ] = name end end npc:remove_restrictions( "", rem ) npc:add_restrictions( "",add ) npc_restrictors_need_update[ nid ] = false end function unreg_in_anom_manager(npc) local nid=npc:id() local anoms=anoms_for_npc[nid] if anoms then for aid in pairs(anoms) do if npcs_for_anom[aid] then npcs_for_anom[aid][nid]=nil end end anoms_for_npc[nid]=nil end end function bind(obj) obj:bind_object(anom_binder(obj)) end class "anom_binder" ( object_binder ) function anom_binder:__init(obj) super(obj) end function anom_binder:net_spawn(sobj) if not object_binder.net_spawn( self,sobj ) then return false end local status=get_anomaly_status(sobj) if status=="del" or status=="off" then if status=="del" then end self.object:disable_anomaly() else amk_anoms.add_anomaly(sobj.id,sobj.position,sobj.radius, sobj) end return true end function anom_binder:net_destroy() amk_anoms.remove_anomaly(self.object:id()) object_binder.net_destroy(self) end anom_list={} function get_radius_for_section(section) return getIniValueFloat(section,"effective_radius",2,nil) end function add_anomaly( id, pos, radius, sobj ) if not anom_list then anom_list = {} end local lname = alife():level_name( game_graph():vertex(sobj.m_game_vertex_id):level_id() ) anom_list[ id ] = { pos = pos, clsid = sobj:clsid(), radius = radius or 0.0, section = sobj:section_name(), location = lname } end function remove_anomaly(id) if anom_list then anom_list[id]=nil end end function get_nearest_anomaly(npc) return get_nearest_anomaly_for_pos(npc:position()) end function get_nearest_anomaly_for_pos(posn) local anomid,pos,radius,dist local mindist=10000000 for id,o in pairs(anom_list) do dist=posn:distance_to(o.pos)-o.radius if dist<mindist then mindist=dist anomid=id pos=o.pos radius=o.radius end end return anomid,pos,radius,mindist end function get_anomaly_list(npc,radius) return get_anomaly_list_for_pos(npc:position(),radius) end function get_anomaly_list_for_pos(posn,radius) local ret={} if anom_list then for id,o in pairs(anom_list) do local obj=level.object_by_id(id) if obj then local dist=posn:distance_to(o.pos)-o.radius if dist<radius then table.insert(ret,{id=id,name=obj:name(),pos=o.pos,radius=o.radius}) end end end end return ret end остаются лишь скриптовые и те, которые прописаны в all.spawn 1 1 Поделиться этим сообщением Ссылка на сообщение
V.E.Q.O. 159 Опубликовано 7 Мая 2016 (изменено) Вопрос от Firewind: Всем привет. Подскажите кто знает в каких файлах находится порог слышимости приёмников на открытых пространствах, например возле Прапора, и где регулируется сама громкость в них когда приближаешься или удаляешься от них? Уже точно не помню, но вроде бы в ТЧ не было этих приёмников на локах, поэтому решил задать этот вопрос здесь. Ответ: gamedata\sounds\taler - Кулинар, Воронин, Жила и т.д., там написано в названиях. gamedata\sounds\characters_voice\scenario\prapor - это у прапора. Громкость и дальность слышимости регулируется в тегах звуковых файлов программой SAVandT (по моему есть на сайте), ну или в SDK. Изменено 8 Мая 2016 пользователем shahvkit Обьединение и удаление 1 Поделиться этим сообщением Ссылка на сообщение