Перейти к содержанию

Kalambur

Сталкеры
  • Публикаций

    173
  • Зарегистрирован

  • Посещение

Сообщения, опубликованные Kalambur


  1. подскажите пожалуйста, в каком файле и как называется строка чтобы  править положение глушителя в слоте оружия, ибо в инвентаре ровно оружие с глушителем, а в слоте глушак в стороне !?


  2. Подскажите пожалуйста, кто умеет и может помочь переписать положение слотов в инвентаре, поменять местами, слоты быстрого доступу опустить ниже на место пояса, а пояс поднять выше на место слотов быстр.доступа ?!


  3. Всем срасибо за подсказки, но ответ оказался проще : if rnd_value > 49  ... с 50 не хотело работать 100% выпадало, а с 49 выпадает как хотел. 


    Дополнено 27 минуты спустя

    Подскажите пожалуйста, как порезать грейды в комбезе, в каких файлах и как сделать, в файле грейда меняю например +20 к електре на +10 и фторую фишку с 0.20 на 0.10 и у механика вылет при нажатии на комбез !


  4. Спойлер

    -- Умер сталкер
    function npc_on_death(npc)
            local rnd_value = math.random(1,99)
                    if rnd_value > 50 then return end

            local rank = ranks.get_obj_rank_name(npc)
            local comm = npc:character_community()
            local coef = get_comb_coeff(rank,comm)^0.5
            local visual = npc:get_visual_name()
            local outfit_section, helmet_section = get_outfit_sections(visual)
            
            if (axr_main.config:r_value("mm_options","enable_outfit_maradeur",1,false)) then
            
                if outfit_section then
                    local se_outfit = alife():create(outfit_section, npc:position(), npc:level_vertex_id(), npc:game_vertex_id(), npc:id())
                    curent_outfit[se_outfit.id] = coef
                    update_outfit()
                end
                if helmet_section then
                    local se_helmet = alife():create(helmet_section, npc:position(), npc:level_vertex_id(), npc:game_vertex_id(), npc:id())
                    curent_helmet[se_helmet.id] = coef
                    update_helmet()
                end
            end
    end

    -- Получим секцию брони и шлема
    function get_outfit_sections(visual)
            local s_name = alun_utils.str_explode(visual,"\\")
            local v_name = s_name[3]
            local t_vis = visuals[v_name]
            if t_vis then
                return t_vis[1], t_vis[2]
            end
    end

    -- update
    function update_outfit()
        local function actor_on_update()
        local param = false
            for k,v in pairs(curent_outfit) do
            local outfit_obj = level.object_by_id(k)
                if outfit_obj then
                outfit_obj:set_condition(mean_random(10,50,v,1)/100)
                curent_outfit[k] = nil
                param = true
                elseif param == true then
                UnregisterScriptCallback("actor_on_update",actor_on_update)
                return
                end
            end
        end
    RegisterScriptCallback("actor_on_update",actor_on_update)
    end

    function update_helmet()
        local function actor_on_update()
        local param = false
            for k,v in pairs(curent_helmet) do
            local helmet_obj = level.object_by_id(k)
                if helmet_obj then
                helmet_obj:set_condition(mean_random(10,50,v,1)/100)
                curent_helmet[k] = nil
                param = true
                elseif param == true then
                UnregisterScriptCallback("actor_on_update",actor_on_update)
                return
                end
            end
        end
    RegisterScriptCallback("actor_on_update",actor_on_update)
    end

    --утилиты
    function mean_random(index_min,index_max,mean_index,left_power,right_power,flag)
            local index_mean = mean_index or 0
            if (index_mean >= 0) and (index_mean <= 1) then
                index_mean = (index_max-index_min)*index_mean + index_min
                local mean_down, mean_up = math.floor(index_mean), math.ceil(index_mean)
                local d_mean_down, d_mean_up = index_mean - mean_down, mean_up - index_mean
                if d_mean_down == d_mean_up then
                    index_mean = (math.random(0,1) == 1) and mean_down or mean_up
                else
                    index_mean = (d_mean_down > d_mean_up) and mean_up or mean_down
                end
            end
            local power_left = left_power or 1
            local power_right = right_power or power_left
            local coeffs_list = {}
            local coeffs_total = 0
            local coeff = 0
            local power = 0
            local base = 0
            local shift = math.max(index_mean-index_min,index_max-index_mean) + 1
            for i=index_min,index_max do
                base = shift - math.abs(index_mean - i)
                if i < index_mean then
                    power = power_left
                elseif i == index_mean then
                    power = math.max(power_left,power_right)
                else
                    power = power_right
                end
                coeff = base^power
                coeffs_list = coeff
                coeffs_total = coeffs_total + coeff
            end
            local rnd = math.random(1,coeffs_total)
            for i=index_min,index_max do
                if rnd <= coeffs_list then
                    return i
                end
                rnd = rnd - coeffs_list
            end
    end


    function get_comb_coeff(rank,comm)
            local rank_coeffs_table = {novice = 1, trainee = 1, experienced = 1, professional = 1, veteran = 1, expert = 1, master = 1, legend = 1}
            local comm_coeffs_table = {zombied = 1, ecolog = 1, bandit = 1, freedom = 1, stalker = 1, clearsky = 1, dolg = 1, killer = 1, army = 1, monolith = 1}
            local rank_coeff = rank_coeffs_table[rank] or 0
            local comm_coeff = comm_coeffs_table[comm] or 0
            return rank_coeff * comm_coeff

    end

    Подскажите пожалуйста, как изменить выпадение комбезов с шанса 100% на 50% ?


  5. Подскажите пожалуйста, как правельно должна быть логика нпс механиков торговцев медиков, чтобы они воевали сразу, а не бегали как угарелые даже без оружие в руках, а потом когда уже позно достают оружие перед смертью !?


  6. Спойлер

    function inv_item_dismantle(itm)

        local p = itm:parent()
        if not (p and p:id() == db.actor:id()) then return end

        local section = itm:section()
        local condition = itm:condition()
        local se_itm = alife_object(itm:id())
        alife():release(se_itm)
        
        local pos = db.actor:position()
        local lvid = db.actor:level_vertex_id()
        local gvid = db.actor:game_vertex_id()
        local actor = db.actor:id()

    Подскажите пожалуйста, как эту функцию поправить, чтобы разбор осуществялся только с помощью например ножа или чегото ищо ?