Перейти к контенту

Скриптование


Svoboда

Рекомендуемые сообщения

Здравствуйте.

Столкнулся с такой проблемой: в COC (мод на ЗП) решил отредактировать рупоры, чтобы было как в ТЧ (выключались на ночь, а при нападении противника на базу играли сигналы тревоги), и вообщем-то прописал логику и т.д. Но натолкнулся на такую проблему: необходимо в логике прописать info_portion, ну чтобы менялись звуковые дорожки, но для этого его нужно выдать, насколько я понял через функцию. И вот какую функцию необходимо использовать, чтобы при нападении на отряд/базу выдавался info_portion?

Поделиться этим сообщением


Ссылка на сообщение

 

Здравствуйте. Столкнулся с такой проблемой. Как известно Call of Chernobyl хотя и масштабный мод, имеет несколько неприятных багов. Один из них: НПС у костра после того как их потревожит противник, возвращались к костру и молчали, застревая на одной анимации, до перезагрузки. Я решил исправить этот баг, и методом тыка вычислил файл который отвечает за поведение НПС у костра, xr_animpoint_predicates.script. Я взял файл из ЗП и заменил им COCовский, проблема исчезла, но появился побочный эффект, теперь НПС у костра всегда с одной анимацией, и разговаривают только "о жизни", не едят, не играют на гитаре, вообщем ведут себя как будто не в зоне кампа. Все попытки отредактировать файл не к чему не привели, отчасти потому что я плохо разбираюсь в скриптах. Может кто разбирается и увидит что не так? Вроде бы в этом замешаны эти фрагменты.
 

Скрытый текст

 

--------------------------------------------------------------------------------
-- Predicate functions for xr_animpoint actions --------------------------------
--------------------------------------------------------------------------------
function const_predicate_true(id)
    local npc = db.storage[id] and db.storage[id].object
    if (npc and db.storage[id].need_sleep) then
        return false
    end

    return true
end

function animpoint_predicate_bread(id)
    local npc = db.storage[id] and db.storage[id].object
    if (npc and not db.storage[id].need_sleep) then
        return true
    end
    return false
end

function animpoint_predicate_kolbasa(id)
    local npc = db.storage[id] and db.storage[id].object
    if (npc and not db.storage[id].need_sleep) then
        return true
    end
    return false
end

function animpoint_predicate_vodka(id)
    local npc = db.storage[id] and db.storage[id].object
    if (npc and not db.storage[id].need_sleep) then
        return true
    end
    return false
end

function animpoint_predicate_energy(id)
    local npc = db.storage[id] and db.storage[id].object
    if (npc and not db.storage[id].need_sleep) then
        return true
    end
    return false
end

function animpoint_predicate_guitar(id, camp)
    if not (camp) then
        return false 
    end 
    local npc = db.storage[id] and db.storage[id].object
    if (npc and not db.storage[id].need_sleep) then
        return true
    end
    return false
end

function animpoint_predicate_harmonica(id, camp)
    if not (camp) then
        return false 
    end 
    local npc = db.storage[id] and db.storage[id].object
    if (npc and not db.storage[id].need_sleep) then
        return true
    end
    return false
end

function animpoint_predicate_weapon(id)
    return true
end

 

Скрытый текст

 

function const_predicate_true(npc_id)
    return true
end

function animpoint_predicate_bread(npc_id)
    if(db.storage[npc_id] and db.storage[npc_id].object and eatable_visuals[db.storage[npc_id].object:get_visual_name()] and db.storage[npc_id].object:object("bread")) == true then
        return true
    end
    return false
end

function animpoint_predicate_kolbasa(npc_id)
    if(db.storage[npc_id] and db.storage[npc_id].object and eatable_visuals[db.storage[npc_id].object:get_visual_name()] and db.storage[npc_id].object:object("kolbasa")) then
        return true
    end
    return false
end

function animpoint_predicate_vodka(npc_id)
    if(db.storage[npc_id] and db.storage[npc_id].object and eatable_visuals[db.storage[npc_id].object:get_visual_name()] and db.storage[npc_id].object:object("vodka")) then
        return true
    end
    return false
end

function animpoint_predicate_energy(npc_id)
    if(db.storage[npc_id] and db.storage[npc_id].object and eatable_visuals[db.storage[npc_id].object:get_visual_name()] and db.storage[npc_id].object:object("energy_drink")) then
        return true
    end
    return false
end

function animpoint_predicate_guitar(npc_id, is_in_camp)
    --printf("  predicate_guitar %s", npc_id)
    --printf("        registred_camp %s", tostring(is_in_camp))
    if is_in_camp == true and db.storage[npc_id] and db.storage[npc_id].object and db.storage[npc_id].object:object("guitar_a") then
        --printf("  return true")
        return true
    end
    --printf("  return false")
    return false
end

function animpoint_predicate_harmonica(npc_id, is_in_camp)
    --printf("  predicate_harmonica %s", npc_id)
    --printf("        registred_camp %s", tostring(is_in_camp))
    if is_in_camp == true and db.storage[npc_id] and db.storage[npc_id].object and harmonica_visuals[db.storage[npc_id].object:get_visual_name()] and db.storage[npc_id].object:object("harmonica_a") then
        --printf("  return true")
        return true
    end
    --printf("  return false")
    return false
end


function animpoint_predicate_weapon(npc_id)
    if(db.storage[npc_id] and db.storage[npc_id].object) then
            local smart = xr_gulag.get_npc_smart(db.storage[npc_id].object)
            if(smart) then
                    for k,v in pairs(smart_table) do
                            if smart:name() == v then
                                    return false
                            end
                    end
            end
    end
        return true
end

 

Поделиться этим сообщением


Ссылка на сообщение
  • Недавно просматривали   0 пользователей

    Ни один зарегистрированный пользователь не просматривает эту страницу.

AMK-Team.ru

×
×
  • Создать...