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

Уроки по модостроению

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

Пособие >смотреть< по "добавлению в игру нового оружия". Вдруг кому пригодится.

256 символов
Ссылка на комментарий

Автор: Rezaniy
Уровень сложности: средне

Материал из

S.T.A.L.K.E.R. Inside Wiki.

В игре наверняка вы встречали такое - При получении какого то задания, или диалога появляются новые НПС или прочие ФПС. В этой статье мы будем рассматривать на Ростке. Итак нам понадобятся такие файлы:
info_l07rostok.xml
all.spawn


Начнём! Распакуем all.spawn и откроем файл alife_l06_rostok.ltx. В нём найдём такие строчки:
[3851]
; cse_abstract properties
section_name = stalker
name = bar_freedom_attacker_1
position = -214.942504882813,-2.09808349609375e-005,164.513900756836
direction = 0,0,0

; cse_alife_trader_abstract properties
money = 5000
character_profile = bar_Killer_regular

; cse_alife_object properties
game_vertex_id = 1335
distance = 6.29999971389771
level_vertex_id = 23441
object_flags = 0xffffffff
custom_data = <<END
[spawner]
cond = {+bar_heli_scene_stay_online}

[smart_terrains]
bar_freedom_attack = true
END

; cse_visual properties
visual_name = actors\killer\stalker_ki_mask

; cse_alife_creature_abstract properties
g_team = 0
g_squad = 5
g_group = 7
health = 1
dynamic_out_restrictions =
dynamic_in_restrictions =

upd:health = 1
upd:timestamp = 0
upd:creature_flags = 0
upd:position = -214.942504882813,-2.09808349609375e-005,164.513900756836
upd:o_model = 0
upd:o_torso = 0,0,0
upd:g_team = 0
upd:g_squad = 5
upd:g_group = 7

; cse_alife_monster_abstract properties

upd:next_game_vertex_id = 65535
upd:prev_game_vertex_id = 65535
upd:distance_from_point = 0
upd:distance_to_point = 0

; cse_alife_human_abstract properties
predicate5 = 0,1,2,0,2
predicate4 = 0,1,1,0

; cse_ph_skeleton properties

upd:start_dialog =

; se_stalker properties

В этой писанине нам нужно только это:

[spawner]
cond = {+bar_heli_scene_stay_online}

Это переход НПС в онлайн при выдаче инфопоршня. Чтобы убедится в этом найдём его в info_l07rostok.xml Убедились? Отлично! Двигаемся дальше. Вместо знака + вы можете поставить знак -. Значит при этом инфопоршне НПС уйдет в оффлайн.

Можно менять эти инфопоршны на любые другие, в том числе свои. Теперь поменяем его к примеру на... bar_kruglov_follow_tunnel. В итоге:

[spawner]
cond = {+bar_kruglov_follow_tunnel}

Этот НПС (или нпсы несколько неписей) буду рождаться когда вы пройдете через тунель где наёмники снайепры. Все инфопоршны брать из файлы, соответствующему локации. Вы можете сделать свой квест и применить инфопоршы к этому делу.

P.S. Теперь сделаем чтобы всё до конца работала. Найдём смарт_терраин в котором прописан +bar_heli_scene_stay_online. И допишем туда свой.

[3857]
; cse_abstract properties
section_name = smart_terrain
name = bar_ecolog_crush
position = -294.061706542969,7.43865966796875e-005,140.005218505859
direction = 1.01860559880151e-005,-7.54995954643789e-010,7.41205367376097e-005

; cse_alife_object properties
game_vertex_id = 1350
distance = 2.79999995231628
level_vertex_id = 100
object_flags = 0xffffffbe
custom_data = <<END
[smart_terrain]
type = bar_ecolog_crush
capacity = 5
squad = 5
groups = 1,2
cond = {+bar_heli_scene_stay_online},{+bar_kruglov_follow_tunnel}
END

; cse_shape properties
shapes = shape0
shape0:type = sphere
shape0:offset = 0,0,0
shape0:radius = 2.66736793518066

; cse_alife_space_restrictor properties
restrictor_type = 0

; se_smart_terrain properties

Вот он. Вот и всё!

 

Изменено пользователем World_Stalker
забыто и уничтожено.
Ссылка на комментарий

Я вот решил поделиться способом переключения модов.



В качестве примера возьму 2 мода под 1.0004 патч amk1.4.1 и арсенал мод, предполагается что папка bin у модов одна и таже
Создаем в корне игры текстовый документ с именем amk.bat и вписываем
ren amk_gamedata gamedata
cd bin
XR_3DA.exe -nointro
cd..
ren gamedata amk_gamedata

Создаем текстовый документ с именем ars.bat и вписываем:

ren ars_gamedata gamedata
cd bin
XR_3DA.exe -nointro
cd..
ren gamedata ars_gamedata

Создаем папку amk_gamedata и помещаем туда мод amk 1.4.1, а в ars_gamedata помещаем арсенал мод.

Игру запускаем BAT файлом
при этом сохранения в игре будут пересекаться, то-есть сохранился в арсенале, а в amk это сохранение вылетит. Тогда делаем так, берем файл fsgame.ltx и переименовываем в amk_fsgame.ltx, открываем блокнотом и изменяем путь до папки с сохранением

$app_data_root$=true|false|C:|Documents and Settings\All Users\Документы\STALKER-SHOC

меняем на это:

$app_data_root$=true|false|C:|Documents and Settings\All Users\Документы\STALKER-amk

делаем копию этого файла с именем ars_fsgame.ltx и меняем путь на это:

$app_data_root$=true|false|C:|Documents and Settings\All Users\Документы\STALKER-ars

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

ren ars_gamedata gamedata
ren ars_fsgame.ltx fsgame.ltx
cd bin
XR_3DA.exe -nointro
cd..
ren gamedata ars_gamedata
ren fsgame.ltx ars_fsgame.ltx

и так же во втором, amk.bat

ren amk_gamedata gamedata
ren amk_fsgame.ltx fsgame.ltx
cd bin
XR_3DA.exe -nointro
cd..
ren gamedata amk_gamedata
ren fsgame.ltx amk_fsgame.ltx

Все, сохранения будут храниться в разных папках и не будут пересекаться.

Если патчи для модов разные, например 1.0003 и 1.0004, то можно сделать так, например у нас мод "скрытая аномалия" он под 1.0003 патч и "арсенал мод" он под 1.0004 патч. Нам нужны папки bin с обоих патчей и файлы gamedata.dbb. В 1.0003 патче он занимает 23.5 мегабайта, а в 1.0004 52.6 мегабайта, папку bin 3 патча переименовываем в sa_bin, а 4го в ars_bin.Файл gamedata.dbb 3его патча (23.5mb) переименовываем в sa_gamedata.dbb, а файл gamedata.dbb 4го патча (52.6mb) переименовываем в ars_gamedata.dbb.
Теперь изменяем батники, в ars.bat вгоняем:

ren ars_bin bin
ren ars_gamedata gamedata
ren ars_gamedata.dbb gamedata.dbb
ren ars_fsgame.ltx fsgame.ltx
cd bin
XR_3DA.exe -nointro
cd..
ren bin ars_bin
ren gamedata ars_gamedata
ren fsgame.ltx ars_fsgame.ltx
ren gamedata.dbb ars_gamedata.dbb

А в sa.bat пишем

ren sa_bin bin
ren sa_gamedata gamedata
ren sa_fsgame.ltx fsgame.ltx
ren sa_gamedata.dbb gamedata.dbb
cd bin
XR_3DA.exe -nointro
cd..
ren bin sa_bin
ren gamedata sa_gamedata
ren fsgame.ltx sa_fsgame.ltx
ren gamedata.dbb sa_gamedata.dbb

При этом нужно создать этот sa_fsgame.ltx и изменить путь до папки с сохранениями на:

$app_data_root$=true|false|C:|Documents and Settings\All Users\Документы\STALKER-sa

В процессе игры заметил если свернуть игру и "случайно" закрыть окно
батника то запуск другого мода не произойдет, будет запущен первый мод. Что-бы такого не произошло я доработал батник, вписав в начало каждого бат файла эти строки:
if exist %SystemDrive%\WINDOWS\system32\cmdow.exe goto cool

copy cmdow.exe %SystemDrive%WINDOWS\system32
:cool
cmdow @ /hid

получилось так:

if exist %SystemDrive%\WINDOWS\system32\cmdow.exe goto cool
copy cmdow.exe %SystemDrive%WINDOWS\system32
:cool
cmdow @ /hid
ren ars_bin bin
ren ars_gamedata gamedata
ren ars_fsgame.ltx fsgame.ltx
ren ars_gamedata.dbb gamedata.dbb
cd bin
XR_3DA.exe -nointro
cd..
ren bin ars_bin
ren gamedata ars_gamedata
ren fsgame.ltx ars_fsgame.ltx
ren gamedata.dbb ars_gamedata.dbb

Для этого нужно скачать программу cmdow.exe (15kb) и поместить в корень игры. Добавленная команда просто скрывает окно работы бат файла от посторонних глаз. Внимание!!! некоторые антивирусы видят cmdow.exe как вирус.

Наверное у некоторых возникнет вопрос, что делает та или иная строка. На против каждой строчки я напишу действие которое она выполняет:
if exist %SystemDrive%\WINDOWS\system32\cmdow.exe goto cool - проверяет существует ли файл cmdow.exe, если да то переход к метке :cool
copy cmdow.exe %SystemDrive%WINDOWS\system32 - копирует файл cmdow.exe в систему
:cool -метка
cmdow @ /hid - команда "скрыть окно" для cmdow.exe
ren ars_bin bin - переименовывает папку из ars_bin в bin
ren ars_gamedata gamedata - переименовывает папку из ars_gamedata в gamedata
ren ars_fsgame.ltx fsgame.ltx - переименовывает файл из ars_fsgame.ltx в fsgame.ltx
ren ars_gamedata.dbb gamedata.dbb - переименовывает файл из ars_gamedata.dbb в gamedata.dbb
cd bin - переход в папку bin
XR_3DA.exe -nointro - запуск файла XR_3DA.exe с параметром -nointro
cd.. - переход назад в папку gamedata
ren bin ars_bin - переименовывает папку обратно в ars_bin
ren gamedata ars_gamedata - переименовывает папку обратно в ars_gamedata
ren fsgame.ltx ars_fsgame.ltx - переименовывает файл обратно в ars_fsgame.ltx
ren gamedata.dbb ars_gamedata.dbb - переименовывает файл обратно в ars_gamedata.dbb

Если у вас что-то не получается то можно в самом конце батника вписать команду "Pause" предварительно удалив команду "cmdow @ /hid" в окне можно увидеть лог работы и возможные ошибки
P.S. Первоисточник, найдете некоторые ответы перейти

 

Изменено пользователем World_Stalker
оформил
Ссылка на комментарий
Автор: PrototypeGameZ
Сложность: Средне

Файлы:
config\localization (rus).ltx
scripts\ui_main_menu.script
config\ui\ui_cheat.xml
scripts\ui_cheat.script
config\text\rus\ui_cheat.xml
scripts\prototype.script


Для начала, в файле config\localization.ltx допишите в конец строки files = ... вот это - ", ui_cheat" (без кавычек)

Далее, откроем файл scripts\ui_main_menu.script, и найдем такую строчку:
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then

И после неё пишем:

if dik == DIK_keys.DIK_HOME then
    if level.present() and (db.actor ~= nil) and db.actor:alive() then
        self:cheat_menu_show()
    end
end

В конец этого файла дописываем:

function main_menu:cheat_menu_show()
    if self.cheat_dlg == nil then
        self.cheat_dlg = ui_cheat.cheat()
        self.cheat_dlg.owner = self
    end
    self:GetHolder():start_stop_menu(self.cheat_dlg, true)
    self:GetHolder():start_stop_menu(self, true)
    self:Show(true)
end

Создаём файл scripts\ui_cheat.script.
Вот его содержимое:

class "cheat" (CUIScriptWnd)

function cheat:__init(owner,objid) super()
    self.owner = owner
    self:InitControls()
    self:InitCallBacks()
end

function cheat:__finalize()
end

function cheat:check_btn(id)
local number = 8
if id <= number then
return true
else
return false
end
end

function cheat:InitControls()
    self:Init(300,200,550,450)
    local xml=CScriptXmlInit()
    xml:ParseFile("ui_cheat.xml")
    xml:InitStatic("background", self)
    if self:check_btn(1) then
    self:Register(xml:Init3tButton("btn_1",self),"btn_1")
    end
    if self:check_btn(2) then
    self:Register(xml:Init3tButton("btn_2",self),"btn_2")
    end
    if self:check_btn(3) then
    self:Register(xml:Init3tButton("btn_3",self),"btn_3")
    end
    if self:check_btn(4) then
    self:Register(xml:Init3tButton("btn_4",self),"btn_4")
    end
    if self:check_btn(5) then
    self:Register(xml:Init3tButton("btn_5",self),"btn_5")
    end
    if self:check_btn(6) then
    self:Register(xml:Init3tButton("btn_6",self),"btn_6")
    end
    if self:check_btn(7) then
    self:Register(xml:Init3tButton("btn_7",self),"btn_7")
    end
    if self:check_btn(8) then
    self:Register(xml:Init3tButton("btn_8",self),"btn_8")
    end
    if self:check_btn(9) then
    self:Register(xml:Init3tButton("btn_9",self),"btn_9")
    end
    if self:check_btn(10) then
    self:Register(xml:Init3tButton("btn_10",self),"btn_10")
    end
    if self:check_btn(11) then
    self:Register(xml:Init3tButton("btn_11",self),"btn_11")
    end
    if self:check_btn(12) then
    self:Register(xml:Init3tButton("btn_12",self),"btn_12")
    end
    if self:check_btn(13) then
    self:Register(xml:Init3tButton("btn_13",self),"btn_13")
    end
    if self:check_btn(14) then
    self:Register(xml:Init3tButton("btn_14",self),"btn_14")
    end
    if self:check_btn(15) then
    self:Register(xml:Init3tButton("btn_15",self),"btn_15")
    end
    if self:check_btn(16) then
    self:Register(xml:Init3tButton("btn_16",self),"btn_16")
    end
    self:Register(xml:Init3tButton("btn_quit",self),"btn_quit")    
end

function cheat:InitCallBacks()
    if self:check_btn(1) then
    self:AddCallback("btn_1", ui_events.BUTTON_CLICKED, self.cheat_1, self)
    end
    if self:check_btn(2) then
    self:AddCallback("btn_2", ui_events.BUTTON_CLICKED, self.cheat_2, self)
    end
    if self:check_btn(3) then
    self:AddCallback("btn_3", ui_events.BUTTON_CLICKED, self.cheat_3, self)
    end
    if self:check_btn(4) then
    self:AddCallback("btn_4", ui_events.BUTTON_CLICKED, self.cheat_4, self)
    end
    if self:check_btn(5) then
    self:AddCallback("btn_5", ui_events.BUTTON_CLICKED, self.cheat_5, self)
    end
    if self:check_btn(6) then
    self:AddCallback("btn_6", ui_events.BUTTON_CLICKED, self.cheat_6, self)
    end
    if self:check_btn(7) then
    self:AddCallback("btn_7", ui_events.BUTTON_CLICKED, self.cheat_7, self)
    end
    if self:check_btn(8) then
    self:AddCallback("btn_8", ui_events.BUTTON_CLICKED, self.cheat_8, self)
    end
    if self:check_btn(9) then
    self:AddCallback("btn_a", ui_events.BUTTON_CLICKED, self.cheat_a, self)
    end
    if self:check_btn(10) then
    self:AddCallback("btn_10", ui_events.BUTTON_CLICKED, self.cheat_10, self)
    end
    if self:check_btn(11) then
    self:AddCallback("btn_11", ui_events.BUTTON_CLICKED, self.cheat_11, self)
    end
    if self:check_btn(12) then
    self:AddCallback("btn_12", ui_events.BUTTON_CLICKED, self.cheat_12, self)
    end
    if self:check_btn(13) then
    self:AddCallback("btn_13", ui_events.BUTTON_CLICKED, self.cheat_13, self)
    end
    if self:check_btn(14) then
    self:AddCallback("btn_14", ui_events.BUTTON_CLICKED, self.cheat_14, self)
    end
    if self:check_btn(15) then
    self:AddCallback("btn_15", ui_events.BUTTON_CLICKED, self.cheat_15, self)
    end
    if self:check_btn(16) then
    self:AddCallback("btn_16", ui_events.BUTTON_CLICKED, self.cheat_16, self)
    end
    self:AddCallback("btn_quit", ui_events.BUTTON_CLICKED, self.on_quit, self)
end

function cheat:OnKeyboard(dik, keyboard_action)
    CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
    if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
        if dik == DIK_keys.DIK_ESCAPE then
            self:on_quit()
        end
    end
    return true
end

function cheat:on_quit()
    local console = get_console()
    self:GetHolder():start_stop_menu (self.owner, true)
    self:GetHolder():start_stop_menu (self,true)
    self.owner:Show(true)
    console:execute("main_menu off")
end

function cheat:cheat_1()
    prototype.spawn_actor("wpn_fn2000","1")
    self:on_quit()
end

function cheat:cheat_2()
    prototype.spawn_actor("ammo_5.56x45_ap","5")
    prototype.spawn_actor("ammo_5.56x45_ap","5")
    prototype.spawn_actor("ammo_5.56x45_ap","5")
    prototype.spawn_actor("ammo_5.56x45_ap","5")
    prototype.spawn_actor("ammo_5.56x45_ap","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    prototype.spawn_actor("ammo_m209","5")
    self:on_quit()
end

function cheat:cheat_3()
    prototype.spawn_actor("outfit_exo_m1","1")
    self:on_quit()
end

function cheat:cheat_4()
    prototype.spawn_actor("af_medusa","5")
    prototype.spawn_actor("af_night_star","5")
    prototype.spawn_actor("af_vyvert","5")
    prototype.spawn_actor("af_gravi","5")
    self:on_quit()
end

function cheat:cheat_5()
    local section = "bar_dolg_respawn_1"
    local pos = db.actor:position()
    local lvid = db.actor:level_vertex_id()
    local gvid = db.actor:game_vertex_id()
    local number = "10"
    local tip = "Ну, блин! Догадался нажать HOME! Тоже мне хакер... Ну чё!? Где враги?"
    local time = "15000"
    prototype.prototype_spawn(section,pos,lvid,gvid,number,tip,time)
    self:on_quit()
end

function cheat:cheat_6()
    local section = "mil_freedom_respawn_1"
    local pos = db.actor:position()
    local lvid = db.actor:level_vertex_id()
    local gvid = db.actor:game_vertex_id()
    local number = "10"
    local tip = "Ну, блин! Догадался нажать HOME! Тоже мне хакер... Ну чё!? Где враги?"
    local time = "15000"
    prototype.prototype_spawn(section,pos,lvid,gvid,number,tip,time)
    self:on_quit()
end

function cheat:cheat_7()
    db.actor:give_money(100000)
    game_stats.money_quest_update (100000)
    self:on_quit()
end

function cheat:cheat_8()
    db.actor:restore_weapon()
    self:on_quit()
end

function cheat:cheat_a()
    self:on_quit()
end

function cheat:cheat_10()
    self:on_quit()
end

function cheat:cheat_11()
    self:on_quit()
end

function cheat:cheat_12()
    self:on_quit()
end

function cheat:cheat_13()
    self:on_quit()
end

function cheat:cheat_14()
    self:on_quit()
end

function cheat:cheat_15()
    self:on_quit()
end

function cheat:cheat_16()
    self:on_quit()
end

Создаём config\text\rus\ui_cheat.xml. Пишем:

<?xml version="1.0" encoding="windows-1251" standalone="yes"?>
<string_table>
    <string id="ui_cheat_1">
        <text>FN2000</text>
    </string>
    <string id="ui_cheat_2">
        <text>Патроны к FN2000</text>
    </string>
    <string id="ui_cheat_3">
        <text>Броня</text>
    </string>
    <string id="ui_cheat_4">
        <text>Артефакты</text>
    </string>
    <string id="ui_cheat_5">
        <text>Вызвать Долг</text>
    </string>
    <string id="ui_cheat_6">
        <text>Вызвать Свободу</text>
    </string>
    <string id="ui_cheat_7">
        <text>100000 денег</text>
    </string>
    <string id="ui_cheat_8">
        <text>Достать оружие</text>
    </string>
    <string id="ui_cheat_9">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_10">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_11">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_12">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_13">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_14">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_15">
        <text>Чит</text>
    </string>
    <string id="ui_cheat_16">
        <text>Чит</text>
    </string>
</string_table>

Создаём config\ui\ui_cheat.xml. Пишем:

<?xml version="1.0" encoding="windows-1251" ?>
<cheat>    
    <background x="-70" y="100" width="574" height="232" stretch="0">
        <texture x="450" y="792" width="574" height="232">ui\ui_hud</texture>
    </background>
    
    <btn_1 x="-52" y="172" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_1</text>
    </btn_1>

    <btn_2 x="78" y="172" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_2</text>
    </btn_2>

    <btn_3 x="-52" y="204" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_3</text>
    </btn_3>

    <btn_4 x="78" y="204" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_4</text>
    </btn_4>

    <btn_5 x="-52" y="236" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_5</text>
    </btn_5>

    <btn_6 x="78" y="236" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_6</text>
    </btn_6>

    <btn_7 x="-52" y="268" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_7</text>
    </btn_7>

    <btn_8 x="78" y="268" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_8</text>
    </btn_8>

    <btn_9 x="215" y="172" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_9</text>
    </btn_9>

    <btn_10 x="345" y="172" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_10</text>
    </btn_10>

    <btn_11 x="215" y="204" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_11</text>
    </btn_11>

    <btn_12 x="345" y="204" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_12</text>
    </btn_12>

    <btn_13 x="215" y="236" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_13</text>
    </btn_13>

    <btn_14 x="345" y="236" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_14</text>
    </btn_14>

    <btn_15 x="215" y="268" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_15</text>
    </btn_15>

    <btn_16 x="345" y="268" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>ui_cheat_16</text>
    </btn_16>

    <btn_quit x="368" y="114" width="117" height="29">
        <texture_e>ui_button_ordinary_e</texture_e>
        <texture_t>ui_button_ordinary_t</texture_t>
        <texture_h>ui_button_ordinary_h</texture_h>
        <text>Выход</text>
    </btn_quit>
</cheat>

Создаём scripts\prototype.script. Пишем:

function prototype_spawn(section,pos,lvid,gvid,number,tip,time)
local i = "0"
local temp = "1"
local step = "1"
if not number then
number = "1"
end
for i = temp, number, step do
alife():create(section,pos,lvid,gvid)
end
if (tip ~= nil and time ~= nil) then
news_manager.send_tip(db.actor, tip, nil, nil, time)
end
end

function spawn_actor(section,number,tip,time)
local i = "0"
local temp = "1"
local step = "1"
if not number then
number = "1"
end
for i = temp, number, step do
alife():create(section,db.actor():position(), db.actor:level_vertex_id(), db.actor:game_vertex_id(), db.actor:id())
end
if (tip ~= nil and time ~= nil) then
news_manager.send_tip(db.actor, tip, nil, nil, time)
end
end

Всё. Заходим в игру, нажимаем HOME, пользуемся. В меню еще предусмотрено 8 кнопок, кому надо, сам поймёт как их настроить.
Если чё-то не работает, обращайтесь.
(Тестировалось на Исполнителе Желаний)

 

Изменено пользователем World_Stalker
  • Согласен 1
Ссылка на комментарий

Если кому то надоели стандартные звуки в игре, то всё возможно исправить. Туториал от Мюллера и Монгола - как заменить звуки в игре (статья неполная, я когда то давно её урезал и чуть упростил, но смысл прежний), полный вариант можно найти в readme в Саунд Римейк моде.
Сложность: легко (при установленном SDK)

Подразумевается что Вы знаете какие какие

ogg файлы собираетесь заменять, иначе Вам сначала надо изучить что где находится.
Во первых требуется звуковой редактор, можно любой ( я использую TotalAudioConverter).
Нужно перевести ваши mp3 файлы в WAV формат 44100Гц, Моно, 16 бит, желательно сохранить в отдельную папку,(для последующих экспериментов).
Почему сразу нельзя сохранить звук в формате ogg 44100Гц, Моно, 16 бит, в принципе
можно, вот только в комментах Ogg файла должны прописываться параметры распространения звука по игровому миру. Именно по этой причине собственные звуки в игре практически не слышно на определенных расстояниях.
Теперь нам понадобится X-Ray SDK – официальный пакет разработчика для игры S.T.A.L.K.E.R.
Открываем меню Пуск/программы/X-Ray SDK жмём Map X-Drave для создания диска X.
Заходим на диск Х и в папку rawdata/sounds копируем наши файлы в формате Wav( советую сразу переименовать файлы на те которые хотите заменить, геммороя будет меньше, если что-то не получится)
Потом запускаем Level Editor, справа вверху находим меню Звуки (или Sounds, у кого английская версия) жмём и выбираем Звуковой редактор
Там увидим наши файлы, выбираем файл и изменяем следующие параметры:
Quality - 0,00 изменяет битрейт файла,игра поддерживает до 80 Kбит/c (ставьте не больше 0,4)
MinDist = 1.00 - расстояние, с которого звук начнет затухать (практически это и есть громкость звука)
MaxDist = 300.0 - максимальное расстояние, на котором звук будет слышен ГГ
MaxAIDist = 300.0 - максимальное расстояние, на котором звук будут слышать NPC
BaseVolume = 1.0 - громкость

Дальше надо выбрать к какому типу отнести звук: приведу только нужные
Game Type:
- undefined – неопределенный, на них NPC не реагируют
- Weapon shooting – выстрел оружия
- NPC dying - смерть NPC (Здесь значение MaxAIDist надо поставить поменьше,в игре
стоит 40м, из-за этого нельзя втихую перебить тех-же бандитов не поднимая шума)
- NPC injuring - ранение NPC
- NPC talking - разговор NPC
- Anomaly idle – звуки аномалий
- World ambient - звуки окружающего мира
Теперь жмём ОК и ждём пока закончится синхронизация. Если всё получилось правильно
идём на диск Х в папку gamedata\sounds там забираем готовые ogg файлы и вставляем их
в игру.
Удачного моддинга!

ЗЫ. Советую удалять файлы из Х\gamedata\sounds после синхронизации, иначе (при повторной конвертации) словите вылет на то что файл уже существует. Папка sounds должна быть изначально чиста ( всё что в ней есть изначально после установки SDK можно смело удалить - это просто пример конвертации файла).

 

Изменено пользователем World_Stalker
оформил

Все мы могли бы быть разными, если не были бы так одинаковы.
Нам что водка, что пулемёт - лишь бы с ног валило.

Ссылка на комментарий

Пропишем нужному нам смарт-террейну укрытие 

gamedata\configs\misc\simulation_objects_props.ltx
[esc_sim_13]:default
surge = 1 ; прописали возможность укрытия
territory = 1
sim_avail = true

Регистрируем наше укрытие в файле gamedata\configs\misc\surge_manager.ltx

;escape
esc_surge_hide_sim_13

Зарегистрируем нашу локацию в скриптах gamedata\scripts\sim_board.script

--'******************************************************
--'* Реестр смарт-террейнов. Игровое поле симуляции.
--'******************************************************

--' В этом ltx хранятся дескрипторы сквадов.
squad_ltx = system_ini()
setting_ini = ini_file("misc\\simulation.ltx")

local group_id_by_levels = {zaton = 1,
pripyat = 2,
jupiter = 3,
labx8 = 4,
jupiter_underground = 5,
escape = 6}

Также в этом скрипте gamedata\scripts\smart_terrain.script

-- строка 1196
function surge_stats()
local sim_obj_registry = simulation_objects.get_sim_obj_registry().objects
local sim_squads = {
["zaton"] = {},
["jupiter"] = {},
["pripyat"] = {},
["escape"] = {}
}
local sim_smarts = {
["zaton"] = {},
["jupiter"] = {},
["pripyat"] = {},
["escape"] = {}
}

-- строка 1241
print_smarts_and_squads_by_level("zaton")
print_smarts_and_squads_by_level("jupiter")
print_smarts_and_squads_by_level("pripyat")
print_smarts_and_squads_by_level("escape")

И в этом скрипте gamedata\scripts\surge_manager.script

-- строка 38
self.levels_respawn = {zaton = false, jupiter = false, pripyat = false, escape = false}

-- строка 194
xr_sound.set_sound_play(db.actor:id(), "zat_a2_stalker_barmen_after_surge")
elseif(level.name()=="jupiter") then
xr_sound.set_sound_play(db.actor:id(), "jup_a6_stalker_medik_after_surge")
elseif not has_alife_info("pri_b305_fifth_cam_end") then
xr_sound.set_sound_play(db.actor:id(), "pri_a17_kovalsky_after_surge")
elseif(level.name()=="escape") then
xr_sound.set_sound_play(db.actor:id(), "zat_a2_stalker_barmen_after_surge")

-- строка 249
if(level.name()=="zaton") then
xr_sound.set_sound_play(db.actor:id(), "zat_a2_stalker_barmen_surge_phase_2")
elseif(level.name()=="jupiter") then
xr_sound.set_sound_play(db.actor:id(), "jup_a6_stalker_medik_phase_2")
elseif not has_alife_info("pri_b305_fifth_cam_end") then
xr_sound.set_sound_play(db.actor:id(), "pri_a17_kovalsky_surge_phase_2")
elseif(level.name()=="escape") then
xr_sound.set_sound_play(db.actor:id(), "zat_a2_stalker_barmen_surge_phase_2")

-- строка 273
if(level.name()=="zaton") then
xr_sound.set_sound_play(db.actor:id(), "zat_a2_stalker_barmen_surge_phase_1")
elseif(level.name()=="jupiter") then
xr_sound.set_sound_play(db.actor:id(), "jup_a6_stalker_medik_phase_1")
elseif not has_alife_info("pri_b305_fifth_cam_end") then
xr_sound.set_sound_play(db.actor:id(), "pri_a17_kovalsky_surge_phase_1")
elseif(level.name()=="escape") then
xr_sound.set_sound_play(db.actor:id(), "zat_a2_stalker_barmen_surge_phase_1")

-- строка 329
self.levels_respawn = {zaton = true, jupiter = true, pripyat = true, escape = true}

-- строка 352
self.levels_respawn = {zaton = true, jupiter = true, pripyat = true, escape = true}

-- строка 638
packet:w_bool(self.levels_respawn.zaton)
packet:w_bool(self.levels_respawn.jupiter)
packet:w_bool(self.levels_respawn.pripyat)
packet:w_bool(self.levels_respawn.escape)

-- строка 665
self.levels_respawn.zaton = packet:r_bool()
self.levels_respawn.jupiter = packet:r_bool()
self.levels_respawn.pripyat = packet:r_bool()
self.levels_respawn.escape = packet:r_bool()

Переходим к all.spawn - создаем секцию укрытия в файле alife_escape.ltx

[xxxx]  ; номер секции
; cse_abstract properties
section_name = space_restrictor
name = esc_surge_hide_sim_13
position = -11.2279901504517,2.46390247344971,57.3380393981934
direction = 0,0,0
version = 0x7c
script_version = 8

; cse_alife_object properties
game_vertex_id = 934
distance = 0
level_vertex_id = 3366
object_flags = 0xffffff3e

; cse_shape properties
shapes = shape0
shape0:type = box
shape0:axis_x = 3.27519989013672,0,0
shape0:axis_y = 0,5.44060039520264,0
shape0:axis_z = 0,0,7.41159915924072
shape0:offset = 0,0,0

; cse_alife_space_restrictor properties
restrictor_type = 0

Создаем точки пути по количеству мест в укрытии в файле way_escape.ltx

[esc_sim_13_surge_1_look]
points = p0
p0:name = name00
p0:position = -11.0934257507324,2.45600557327271,56.0012626647949
p0:game_vertex_id = 1051
p0:level_vertex_id = 286804


[esc_sim_13_surge_1_walk]
points = p0
p0:name = name00
p0:position = -12.587254524231,2.45982217788696,54.6062545776367
p0:game_vertex_id = 1051
p0:level_vertex_id = 284937


[esc_sim_13_surge_2_look]
points = p0
p0:name = name00
p0:position = -11.7026491165161,2.45731353759766,55.4043731689453
p0:game_vertex_id = 1051
p0:level_vertex_id = 285862


[esc_sim_13_surge_2_walk]
points = p0
p0:name = name00
p0:position = -11.7085494995117,2.45401954650879,54.6906051635742
p0:game_vertex_id = 1051
p0:level_vertex_id = 285861


[esc_sim_13_surge_3_look]
points = p0
p0:name = name00
p0:position = -11.700403213501,2.46191310882568,55.9261016845703
p0:game_vertex_id = 1051
p0:level_vertex_id = 285863


[esc_sim_13_surge_3_walk]
points = p0
p0:name = name00
p0:position = -10.5211238861084,2.45401906967163,54.5706977844238
p0:game_vertex_id = 1051
p0:level_vertex_id = 287736


[esc_sim_13_surge_4_look]
points = p0
p0:name = name00
p0:position = -12.1378507614136,2.46710777282715,55.9775772094727
p0:game_vertex_id = 1051
p0:level_vertex_id = 285863


[esc_sim_13_surge_4_walk]
points = p0
p0:name = name00
p0:position = -12.5659475326538,2.4704270362854,55.9364585876465
p0:game_vertex_id = 1051
p0:level_vertex_id = 284939


[esc_sim_13_surge_5_look]
points = p0
p0:name = name00
p0:position = -11.3268537521362,2.45915699005127,56.0716171264648
p0:game_vertex_id = 1051
p0:level_vertex_id = 286804


[esc_sim_13_surge_5_walk]
points = p0
p0:name = name00
p0:position = -11.4233283996582,2.45504951477051,55.4901466369629
p0:game_vertex_id = 1051
p0:level_vertex_id = 286803


[esc_sim_13_surge_6_look]
points = p0
p0:name = name00
p0:position = -11.951548576355,2.46743059158325,56.5034790039063
p0:game_vertex_id = 1051
p0:level_vertex_id = 285864


[esc_sim_13_surge_6_walk]
points = p0
p0:name = name00
p0:position = -10.5399560928345,2.45401906967163,55.9832763671875
p0:game_vertex_id = 1051
p0:level_vertex_id = 287738


[esc_sim_13_surge_7_look]
points = p0
p0:name = name00
p0:position = -11.060601234436,2.46146583557129,56.6575355529785
p0:game_vertex_id = 1051
p0:level_vertex_id = 286805


[esc_sim_13_surge_7_walk]
points = p0
p0:name = name00
p0:position = -12.5727767944336,2.47284889221191,57.334114074707
p0:game_vertex_id = 1051
p0:level_vertex_id = 284941


[esc_sim_13_surge_8_look]
points = p0
p0:name = name00
p0:position = -11.7709636688232,2.46654939651489,57.2202682495117
p0:game_vertex_id = 1051
p0:level_vertex_id = 285865


[esc_sim_13_surge_8_walk]
points = p0
p0:name = name00
p0:position = -11.6660528182983,2.4660382270813,56.7951736450195
p0:game_vertex_id = 1051
p0:level_vertex_id = 285864


[esc_sim_13_surge_9_look]
points = p0
p0:name = name00
p0:position = -11.4014568328857,2.4647479057312,57.3022918701172
p0:game_vertex_id = 1051
p0:level_vertex_id = 286806


[esc_sim_13_surge_9_walk]
points = p0
p0:name = name00
p0:position = -10.5875377655029,2.46077871322632,57.3240737915039
p0:game_vertex_id = 1051
p0:level_vertex_id = 287740


[esc_sim_13_surge_10_look]
points = p0
p0:name = name00
p0:position = -12.009449005127,2.47024631500244,58.7685432434082
p0:game_vertex_id = 1051
p0:level_vertex_id = 285867


[esc_sim_13_surge_10_walk]
points = p0
p0:name = name00
p0:position = -12.5359506607056,2.47053003311157,58.6904754638672
p0:game_vertex_id = 1051
p0:level_vertex_id = 284943


[esc_sim_13_surge_11_look]
points = p0
p0:name = name00
p0:position = -11.6696643829346,2.47010707855225,58.7928047180176
p0:game_vertex_id = 1051
p0:level_vertex_id = 285867


[esc_sim_13_surge_11_walk]
points = p0
p0:name = name00
p0:position = -11.7617807388306,2.47143888473511,58.0255508422852
p0:game_vertex_id = 1051
p0:level_vertex_id = 285866


[esc_sim_13_surge_12_look]
points = p0
p0:name = name00
p0:position = -11.1556959152222,2.46973323822021,58.9260101318359
p0:game_vertex_id = 1051
p0:level_vertex_id = 286808


[esc_sim_13_surge_12_walk]
points = p0
p0:name = name00
p0:position = -10.5822420120239,2.46985769271851,58.7564964294434
p0:game_vertex_id = 1051
p0:level_vertex_id = 287742

На этом всё.

 

 

Перенес сюда. Там потеряется.[Halford]

Изменено пользователем World_Stalker
Ссылка на комментарий

Доброго вам времени суток. Мне поведали о том, как создать непися в зп и я решил, что вопрос создание нпса мучает не только меня и решил написать об этом.

 

Нам нужны следующие файлы:
- configs\creatures\spawn_sections_zaton.ltx
- configs\gameplay\npc_profile.xml
- сonfigs\gameplay\charecter_desc_zaton.xml
- scripts\db.script

 

И создадим сами файлы:
- scripts\npc.script
- configs\scripts\snaiper_lg.ltx

Для начала создадим нашему неписю логику(( после мы её сможем часто пользоваться)
Для этого заходим в configs\scripts\snaiper_lg.ltx
И там вбиваем следующие строки:

[logic]
active = remark1
danger = danger_ignore
anim = desk_idle

[danger_ignore]
ignore_distance = 5

[remark1]
invulnerable = true
no_move = true
meet = meet_guide

[meet_guide]
close_anim = nil
close_victim = nil
far_anim = nil
far_victim = nil
close_distance = 0
far_distance = 0
close_snd_distance = 3
abuse = false
use = {=actor_enemy} false, true
allow_break = false
meet_on_talking = false
meet_on_talking = false

Теперь всё по порядку поясняю:
[logic] – обозначает, что это функция логи
active = remark1 - функция его действий
danger = danger_ignore – можно ли рядом достать оружие
anim = desk_idle - анимка, но вроде не влияет

[danger_ignore]
ignore_distance = 5
– на сколько близко можно махать стволом

[remark1]
invulnerable = true
- бессмертие. True-бессмертный, false- смертный
no_move = true (будет стоять на месте) или false что б ходил -- не работает.
meet = meet_guide название схемы

[meet_guide] - сама схема
close_anim = nil - анимка при прощании
close_victim = nil - вроде анимка при встречи
far_anim = nil
far_victim = nil
close_distance = 0
far_distance = 0
close_snd_distance = 3
 - на каком расстоянии будет слышен звук приветствия
abuse = false - вроде разрешение говорить
use = {=actor_enemy} false, true - ?
allow_break = false - можно ли закрыть диалог esc
meet_on_talking = false – говорить можно(диалог)
meet_on_talking = false - говорить можно(диалог)

Теперь заходим в configs\creatures\spawn_sections_zaton.ltx
После:

[test_body_5]:stalker
$spawn = "respawn\test_body_5"
;character_profile = zat_a2_stalker_mechanic
community = stalker
;story_id = test_body_5
custom_data = scripts\test_cfg5.ltx

прописываем это:

[snaiper]:stalker
$spawn = "respawn\snaiper"
character_profile = snaiper
spec_rank = master
community = stalker
custom_data = scripts\snaiper_lg.ltx
story_id = stalker_snaiper

где

[snaiper]:stalker - секция нпс
$spawn = "respawn\snaiper" - респавн для sdk
character_profile = snaiper - ссылка на профиль
spec_rank = master - ранг
community = stalker - группировка( здесь роли не играет
custom_data = scripts\snaiper_lg.ltx - логика, которую мы создали
story_id = stalker_snaiper - уникальный ID , не знаю но вроде что-то про квесты

Теперь заходим в configs\gameplay\npc_profile.xml
И в самый конец (перед </xml>) пишем:

<character id="snaiper">
<class>snaiper</class>
<specific_character>snaiper</specific_character>
</character>

Должно получиться примерно так:

<character id="conrack_selo_stalker">
<class>jup_b6_freedom_stalker_1</class>
</character>

<character id="snaiper">
<class>snaiper</class>
<specific_character>snaiper</specific_character>
</character>
</xml>

Пояснения:
<character id="snaiper"> - ID
<class>snaiper</class> - класс , это типа метки
<specific_character>snaiper</specific_character> - ID
</character> - массив закрыт

Теперь создадим профиль для нашего непися. Заходим в configs\gameplay\charecter_desc_zaton.xml
И в самый конец (перед <xml>) прописываем:

<specific_character id="snaiper" team_default="1">
<name>Дрюня</name>
<icon>ui_inGame2_merc_4</icon>
<map_icon x="1" y="0">
</map_icon>
<bio>Опытный сталкер. Детальная информация отсутствует.</bio>

<class>snaiper</class>
<community>stalker</community>
<terrain_sect>stalker_terrain</terrain_sect>
<snd_config>characters_voice\human_01\bandit\</snd_config>

<rank>40</rank>
<money min="1500" max="3500" infinitive="1"/>
<reputation>0</reputation>

<visual>actors\stalker_soldier\stalker_soldier_1</visual>
<supplies>

[spawn] \n
wpn_svd \n
ammo_9x39_ap = 1 \n
wpn_beretta \n
ammo_9x19_fmj = 1 \n
grenade_rgd5 = 2 \n
#include "gameplay\character_items.xml"
#include "gameplay\character_food.xml"
#include "gameplay\character_drugs.xml"
</supplies>
#include "gameplay\character_criticals_4.xml"

<start_dialog>zat_b215_stalker_guide_start</start_dialog>

<actor_dialog>zat_b215_stalker_guide_leave_zone</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_maps</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_to_pripyat_no_way</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_to_pripyat</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_to_jupiter</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_to_zaton</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_where_to</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_about_himself</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_about_anomalies</actor_dialog>
<actor_dialog>zat_b215_stalker_guide_about_surge</actor_dialog>

<actor_dialog>actor_break_dialog</actor_dialog>
</specific_character>

Где:
<specific_character id="snaiper" team_default="1"> - ID
<name>Дрюня</name> -имя
<icon>ui_inGame2_merc_4</icon> - иконка
<map_icon x="1" y="0"> - иконка на карте
</map_icon> - закрывающий тэг
<bio>Опытный сталкер. Детальная информация отсутствует.</bio> в игре не используется

<class>snaiper</class> - класс
<community>stalker</community> - группировка
<terrain_sect>stalker_terrain</terrain_sect> - ?
<snd_config>characters_voice\human_01\bandit\</snd_config> - голос

<rank>40</rank> - ранг( не используется в игре)
<money min="1500" max="3500" infinitive="1"/> - количество денег. infinitive="1"- бесконечные, infinitive="0" - заканчивающиеся
<reputation>0</reputation> - репутация

<visual>actors\stalker_soldier\stalker_soldier_1</visual> - модель непися
<supplies>

[spawn] \n - вещи в рюкзаке
wpn_svd \n
ammo_9x39_ap = 1 \n
wpn_beretta \n
ammo_9x19_fmj = 1 \n
grenade_rgd5 = 2 \n

#include "gameplay\character_items.xml" - случайный спавн вещей в рюкзаке
#include "gameplay\character_food.xml"
#include "gameplay\character_drugs.xml"
</supplies>
#include "gameplay\character_criticals_4.xml"


<start_dialog>zat_b215_stalker_guide_start</start_dialog>- диалоги. В нашем случае диалоги лоцмана
<actor_dialog>zat_b215_stalker_guide_leave_zone</actor_dialog> - диалог актора
.....
<actor_dialog>actor_break_dialog</actor_dialog> - диалог выхода
</specific_character> - закрывающий тэг

Теперь создаём скрипт спавна scripts\npc.script
Вбиваем в него:

function snaiper()
if not db.actor:has_info("spawn_snaiper")
then

alife():create("snaiper",vector():set(116.238,2.250,183.199),1165999,316)
db.actor:give_info_portion("spawn_snaiper")
end
end

Строчка alife():create("snaiper",vector():set(116.238,2.250,183.199),1165999,316) отвечает за координаты, на которых спавнится объект. В нашем случае - непись. Подробнее о них:
Pos - 116.238,2.250,183.199
Ivid - 1165999
Gvid - 316

Чтобы их получить качаем позишн информер Отсюда

 

И последнее - регистрация скрипта в scripts\db.script
Открываем db.script. Находим строки:

function add_actor(obj)
actor = obj
actor_proxy:net_spawn(obj)
add_obj(obj)
end

И меняем на такие:

function add_actor(obj)
actor = obj
actor_proxy:net_spawn(obj)
add_obj(obj)
npc.snaiper()
end

Заходим в игру и всё - глядим на непися

 

Изменено пользователем PRYZRAK
оформил и исправил ошибки
Ссылка на комментарий

Итак, приступим! Мы подключили локацию к ЗП, расположили карту в пда, начали обустройство. И тут возникает вопрос - как добавить отметки в пда(в ЗП например Аномалия Битум, Коготь и т.д.)? Вот об этом я и расскажу. Например: я сделал аномалию Свалка на подключенной Припяти(на стадионе) В файле

alife_l11_pripyat.ltx пишем:
[137]
; cse_abstract properties
section_name = space_restrictor
name = zero_b1_spot ----любое уникальное имя
position = 5.76249980926514,2.64950323104858,341.929992675781 ---центр окружности, при наведении на которую появиться надпись
direction = 0,0,0

; cse_alife_object properties
game_vertex_id = 934 -------гейм вертекс уровня
distance = 0
level_vertex_id = 214948 -----левел вертекс уровня
object_flags = 0xffffff3e
custom_data = <<END
[story_object]
story_id = zero_b1_spot
END

; cse_shape properties
shapes = shape0
shape0:type = sphere
shape0:offset = 0,0,0
shape0:radius = 1

; cse_alife_space_restrictor properties
restrictor_type = 3

Далее собираем all.spawn ( Его еще на место надо положить будет) и идем в папку скрипт, а именно открываем файл pda.script Находим строку:

{target="jup_a9_spot", hint="st_jup_a9_name"},

И после неё вставляем:

{target="zero_b1_spot", hint="st_zero_b1_name"},

Закрываем и сохраняем изменения. Далее в папку text/rus/любой файл и там добавляем перед </string_table> вот это:

<string id="st_zero_b1_name">
<text>Пишем то что хотим видеть при наведении</text>
</string>

 

 

Изменено пользователем World_Stalker
оформил

я изменился. пью, курю, употребляя наркотические средства.

Жизнь-говно. Бабы -консервы.

Забьюсь под стол, чтоб никто не трогал.

Ссылка на комментарий


local idMyNPC = nil --/ тут будем хранить ID заспавненного непися!
function spawnych()
local soObj = alife():create("esc_kvest_killer1",vector():set(-232,-19,-115),22645,8)
if soObj then --/ перепроверка для безопасности
idMyNPC = soObj.id --/ запоминаем!!!
end
end


function Delete_ak74u_from_Actor()
local oItem = db.actor:object("предмет") --/ определяем предмет у ГГ
if oItem then --/ у ГГ есть предмет
db.actor:drop_item(oItem) --/ выбрасываем предмет (опционально)
alife():release(alife():object(oItem:id()), true) --/ удаляем из игры
end
end


function Release_3_Kalash()
local cnt = db.actor:object_count()
local ch=0
for i=0, cnt-1 do
local item = db.actor:object(i)
if item:section() == "предмет" then --/ секция предмета
local sobj = alife():object(item:id())
if sobj then
alife():release(sobj,true)
ch = ch+1
if ch ==кол-во_предметов then
break end
end
end
end
end


Изменено пользователем Murarius

Freedom

Ссылка на комментарий

Создание новой сетки прицела (Например вдруг создали оружие с прицелом а старые сетки не охота использовать)

Для начала открываем

gamedata\configs\ui\scopes.xml
И пишем структуру прицела:
<название прицела x="0" y="0" width="1024" height="768">
<auto_static x="0" y="0" width="1024" height="768" stretch="1">
<texture>название прицела</texture>
</auto_static>
</название прицела>

После того как написали сохраняем файл. Теперь надо нарисовать саму текстуру прицела!
После того как нарисовали называем её название прицела.dds
И сохраняем в gamedata\textures

Теперь добавляем прицел оружию.
Открываем конфиг оружия и находим строчку scope_texture
После того как нашли вставляем туда ваше название прицела.
Вот и всё!

 

Изменено пользователем World_Stalker
оформил
Ссылка на комментарий

Мне для мода потребовалась функция логики space_restrictor-а - sr_sound
Я создал сам space_restrictor в файле alife_l01_escape.ltx написал вот это:

[20506]
; cse_abstract properties
section_name = space_restrictor
name = esc_tips_fox
position = 287.200012207031,16.6319103240967,275.321502685547
direction = -0.104504659771919,0.517827808856964,-0.0501847825944424

; cse_alife_object properties
game_vertex_id = 934
distance = 0
level_vertex_id = 594270
object_flags = 0xffffff3e
custom_data = <<END
[logic]
active = sr_sound

[sr_sound]
snd = characters_voice\human_02\stalker\alife\defence\request_help_vs_mutant_1_pda
END

; cse_shape properties
shapes = shape0,shape1,shape2,shape3,shape4,shape5
shape0:type = box
shape0:axis_x = 71.6746063232422,0,0
shape0:axis_y = 0,18.0631980895996,0
shape0:axis_z = 0,0,7.15800046920776
shape0:offset = 0,0,0
shape1:type = box
shape1:axis_x = 71.6746063232422,2.67008715582051e-007,-2.13606972465641e-006
shape1:axis_y = 0,18.063196182251,1.34581313204762e-007
shape1:axis_z = 0,2.66656297043255e-008,7.15800046920776
shape1:offset = -70.810791015625,3.28049087524414,0.246719360351563
shape2:type = box
shape2:axis_x = 70.5857162475586,-5.34017431164102e-007,-12.4460964202881
shape2:axis_y = 6.72906566023812e-008,18.063196182251,-6.72906566023812e-008
shape2:axis_z = 1.24296712875366,1.06662518817302e-007,7.04925537109375
shape2:offset = -139.549942016602,6.66907978057861,6.34806823730469
shape3:type = box
shape3:axis_x = 64.9593124389648,-1.00128272606526e-006,-30.2908554077148
shape3:axis_y = 3.81672322191662e-007,25.6135959625244,1.90836161095831e-007
shape3:axis_z = 3.0250871181488,0,6.48735809326172
shape3:offset = -203.898208618164,6.86461544036865,27.2836456298828
shape4:type = box
shape4:axis_x = 64.9593124389648,-1.00128272606526e-006,-30.2908554077148
shape4:axis_y = 3.81672322191662e-007,25.6135959625244,1.90836161095831e-007
shape4:axis_z = 3.0250871181488,0,6.48735809326172
shape4:offset = -260.097442626953,7.74838256835938,53.8768310546875
shape5:type = box
shape5:axis_x = 65.4553070068359,4.65114135295153e-006,-45.8319931030273
shape5:axis_y = -1.67716643773019e-006,26.4829940795898,9.86568466032622e-007
shape5:axis_z = 6.40486860275269,3.32790563106755e-007,9.14716148376465
shape5:offset = -318.800598144531,12.4033985137939,88.3407592773438

; cse_alife_space_restrictor properties
restrictor_type = 3

Результат - вылет с ссылкой на ошибку в логике. Поковыряв, я обнаружил отсутствие файла sr_sound.script. Я добавил его, запустил игру и получил тот же самый вылет с тем же контекстом. Значит надо этот файл зарегистрировать.
Лезем в modules.script. Внутри скрипта ищем:

----------------------------------------------------------------------
-- Загрузка модулей рестрикторов:
----------------------------------------------------------------------

Он в конце. И поле 85 строки с тексом:

load_scheme("sr_deimos",                        "sr_deimos",        stype_restrictor)

вставляем наш:

load_scheme("sr_sound",                        "sr_sound",        stype_restrictor)

Всё зарегистрировали.
Теперь снова загружаем нашу игру и, добежав до нашего space_restrictor-а, ловим вылет:

Expression : !m_error_code
Function : raii_guard::~raii_guard
File : D:\prog_repository\sources\trunk\xrServerEntities\script_storage.cpp
Line : 748
Description : ....e.r. - Зов Припяти\gamedata\scripts\sr_sound.script:201: attempt to call field 'get_safe_sound_object' (a nil value)

Залез в sr_sound.script на 201 строку я обнаружил, что get_safe_sound_object - это функция xr_sound.script

В xr_sound.script я наткнулся на отсутствие get_safe_sound_object, а sr_sound.script я брал из ТЧ, куда и лезем за помощью в xr_sound.script, где данная функция есть. После нехитрых рассуждения я скомуниздил из тч-льского файла xr_sound.script следующий код:

--' Соунд обжект

--' Таблица для хранения созданных саунд обжектов.
sound_object_by_theme = {}
--' type = [random|seq|looped]
function get_sound_object(theme, t_type)
if sound_theme.ph_snd_themes[theme] == nil then
abort("ph_snd_themes for theme %s", tostring(theme))
return
end

if sound_object_by_theme[theme] == nil then
sound_object_by_theme[theme] = {}
end

if t_type == nil then
t_type = "random"
end

--' Выбор следующего айдишника
local play_id = -1
local table_size = table.getn(sound_theme.ph_snd_themes[theme])
if sound_object_by_theme[theme].last_id == nil then
if t_type == "random" then
if table_size >= 2 then
play_id = math.random(1, table_size)
else
play_id = 1
end
else
play_id = 1
end
else
if t_type == "random" then
if table_size >= 2 then
play_id = math.random(1, table_size - 1)
if play_id >= sound_object_by_theme[theme].last_id then play_id = play_id + 1 end
else
play_id = 1
end
else
if sound_object_by_theme[theme].last_id < table_size then
play_id = sound_object_by_theme[theme].last_id + 1
else
if type == "looped" then
play_id = 1
end
end
end
end

printf("SOUND_OBJECT: selected id [%s] for theme [%s], type [%s], size [%s]", tostring(play_id), tostring(theme), tostring(type), table_size)

if play_id == -1 then
return
end
--' Проверяем создан ли у нас соответствующий саунд обжект или его надо создать
if sound_object_by_theme[theme][play_id] == nil then
if type(sound_theme.ph_snd_themes[theme][play_id]) == "table" then
sound_object_by_theme[theme][play_id.."_r"] = get_safe_sound_object(sound_theme.ph_snd_themes[theme][play_id][1].."_r")
sound_object_by_theme[theme][play_id.."_l"] = get_safe_sound_object(sound_theme.ph_snd_themes[theme][play_id][1].."_l")
else
sound_object_by_theme[theme][play_id] = get_safe_sound_object(sound_theme.ph_snd_themes[theme][play_id])
end
end

sound_object_by_theme[theme].last_id = play_id

--' Возвращаем саунд обжект
if type(sound_theme.ph_snd_themes[theme][play_id]) == "table" then
return sound_object_by_theme[theme][play_id.."_r"], sound_object_by_theme[theme][play_id.."_l"]
else
return sound_object_by_theme[theme][play_id]
end
end

local sound_object_by_path = {}
--' Обертка вокруг функции, возвращающий звуковой объект.
function get_safe_sound_object(path)
if sound_object_by_path[path] == nil then
sound_object_by_path[path] = sound_object(path)
end
return sound_object_by_path[path]
end

function stop_all_sound_object()
for k,v in pairs(sound_object_by_path) do
if v:playing() then
v:stop()
end
end
end
function clear_all_sound_object()
sound_object_by_theme = {}
end

Добавив его в файл xr_sound.script уже ЗП и запустив игру я обнаружил, что моя логика заработала!!!

P.S. Делал данную рокировку я на ЗП на добавленном мною кордоне из ТЧ, откуда я и брал дополнительные скрипты.

 

Изменено пользователем World_Stalker
оформил
Ссылка на комментарий
Полезная информация по работе с картами локаций в ПДА
Авторы: Shadows и XMK

Мини дополнение: http://xfiles.xianionline.com/tools/map_dragger/
Там залита чужая карта но принцип тот-же. Спасибо XiaNi за ссылку.

Изменено пользователем World_Stalker

Мой архив

Сталкером не занимаюсь.

Ссылка на комментарий

Создаете скрипт:

имя_файла.script туда пишете:
function use_snd(obj)
local obj_sect = obj:section()
local snd
if obj_sect == 'ваш предмет' then snd = [[Путь_до_звука_относительно_папки_sounds]]
elseif obj_sect == 'ваш предмет' then snd = [[Путь_до_звука_относительно_папки_sounds]]
elseif obj_sect == 'ваш предмет' then snd = [[Путь_до_звука_относительно_папки_sounds]]
elseif obj_sect == 'ваш предмет' then snd = [[Путь_до_звука_относительно_папки_sounds]]
end
if snd then
local snd_obj = xr_sound.get_safe_sound_object(snd)
snd_obj:play_no_feedback(db.actor, sound_object.s2d, 0, vector(), 1.0)
end
end

Сохраняем.

Открываем bind_stalker.script и в функцию function actor_binder:net_destroy() пишем:

self.object:set_callback(callback.use_object, nil)

и в функцию actor_binder:reinit() пишем:

self.object:set_callback(callback.use_object, self.use_object, self)

и в этом же файле создаем функцию:

function actor_binder:use_object(obj)
имя_вашего_скрипта.use_snd(obj)
end

Все теперь при использовании предмета будет проигрываться звук.
Автор скрипта: Gun12

Для создания текста в главном меню нам понадобится два файла ui_main_menu.script (gamedata\scripts) и ui_mm_main.xml (gamedata\config\ui).
Заходим в ui_main_menu.script и находим там это:

function main_menu:InitControls()
self:Init(0,0,1024,768)
local xml = CScriptXmlInit()
xml:ParseFile("ui_mm_main.xml")

xml:InitStatic("back_movie", self)
xml:InitStatic("background", self)
xml:InitStatic("fire_movie", self)
self.shniaga = xml:InitMMShniaga("shniaga_wnd",self);

self.message_box = CUIMessageBoxEx()
self:Register(self.message_box, "msg_box")

local _ver = xml:InitStatic ("static_version",self)
local mm = _G.main_menu.get_main_menu()
_ver:SetText ("S.T.A.L.K.E.R. v" .. mm:GetGSVer())

end

После self:Register(self.message_box, "msg_box") в следующей строке пишем:

local add_ver = xml:InitStatic ("add_version",self)
add_ver:SetText ("Ваш текст")

Должно получится так:

function main_menu:InitControls()
self:Init(0,0,1024,768)
local xml = CScriptXmlInit()
xml:ParseFile("ui_mm_main.xml")

xml:InitStatic("back_movie", self)
xml:InitStatic("background", self)
xml:InitStatic("fire_movie", self)
self.shniaga = xml:InitMMShniaga("shniaga_wnd",self);

self.message_box = CUIMessageBoxEx()
self:Register(self.message_box, "msg_box")
local add_ver = xml:InitStatic ("add_version",self)
add_ver:SetText ("Ваш текст")
local _ver = xml:InitStatic ("static_version",self)
local mm = _G.main_menu.get_main_menu()
_ver:SetText ("S.T.A.L.K.E.R. v" .. mm:GetGSVer())

end

Далее заходим в ui_mm_main.xml и в самый конец вписываем:

<add_version x="5" y="720" width="100" height="30">
<text align="l" font="letterica16" r="255" g="80" b="80" complex_mode="0"/>
</add_version>

Там где r="237, g="28, b="36 это цвета их можно поменять на любой другой, достаточно просто открыть палитру цветов в paint и выбрать такой какой надо r=" это красный g=" это зеленый b=" синий.
Автор статьи: vavilov8

 

Изменено пользователем World_Stalker
оформил
Ссылка на комментарий
Разбор секций
Открываем файл outfit.ltx находится он gamedata/configs/misc

И так для начала разберемся что и как, возьмем к
примеру стандартный шлем [helm_respirator] его код выглядит так:
; Противогаз
[helm_respirator]:helmet ;название секции шлема,именно к нему игра будет обращаться.helmet базовая (наследуемая) секция (изменять строго не рекомендуется).
$spawn = "outfit\helm_respirator" ;тут у нас спавн менять его не будем,оставим стандартный
visual = dynamics\outfit\helm_respirator ;тут у нас модель шлема
control_inertion_factor = 1.0 ;управление инертион фактором
inv_name = st_helm_respirator ;название шлема в инвентаре.
inv_name_short = st_helm_respirator ;название шлема в инвентаре.
description = st_helm_respirator_descr ;ссылка на описание шлема

inv_weight = 4.0 ;Вес шлема

inv_grid_width = 2 ;Ширина иконки в ui_icon_equipment.dds
inv_grid_height = 2 ;Высота иконки в ui_icon_equipment.dds
inv_grid_x = 4 ;Положение по Х в ui_icon_equipment.dds
inv_grid_y = 18 ;Положение по У в ui_icon_equipment.dds

upgr_icon_x = 20 ;Тут всё тоже самое но только для иконки Апгрейда - ui_actor_armor.dds
upgr_icon_y = 619 ;Тут всё тоже самое но только для иконки Апгрейда - ui_actor_armor.dds
upgr_icon_width = 106 ;Тут всё тоже самое но только для иконки Апгрейда - ui_actor_armor.dds
upgr_icon_height = 149 ;Тут всё тоже самое но только для иконки Апгрейда - ui_actor_armor.dds

cost = 1000 ;Цена

immunities_sect = sect_helm_respirator_immunities ;секции иммунитета
bones_koeff_protection = actor_helm_respirator ;это по моему защита головы ГГ

telepatic_protection = 0.0200 ;защита от телепатии
radiation_protection = 0.0015 ;защита от радиации
chemical_burn_protection = 0.0500 ;защита от химических ожогов

upgrades = up_gr_firstab_helm_respirator ;это код на Апгрейд
installed_upgrades =
upgrade_scheme = upgrade_scheme_helm_respirator ;это код на схему Апгрейд

[sect_helm_respirator_immunities] ;коэффициенты иммунитета самого шлема, то есть - то, насколько сильно он сам подвержен повреждениям от различных типов воздействий. по значениям каждого типа

burn_immunity = 0.04 ;защита от воздействия огня (костры,аномалия "Жарка" и т.д.)
strike_immunity = 0.0 ;защита от ударов (наносятся мутантами, например, псевдогигантом)
shock_immunity = 0.04 ;защита от поражения электричеством.
wound_immunity = 0.0 ;защита от ранений (наносятся мутантами, например, собаками, кровососами и т.д.)
wound_2_immunity = 0.0 ;защита от ранений (наносятся мутантами, например, собаками, кровососами и т.д.)
radiation_immunity = 0.0 ;защита от радиации.
telepatic_immunity = 0.0 ;защита от пси-воздействия (например, присутствие контроллера серьезно влияет на psy_health)
chemical_burn_immunity = 0.04 ;защита от химического воздействия.
explosion_immunity = 0.04 ;защита от взрывов/осколков.
fire_wound_immunity = 0.04 ;защита от огнестрельного оружия.

P.s. При создании нового шлема не забудьте добавить инклуд. Они находятся на самом верху файла outfit.ltx

#include "outfit_upgrades\helm_respirator_up.ltx"

Далее создадим свой шлем в файле outfit.ltx в самом низу пишем:

; Шлем "Сфера Долга"
[helm_battle_dolg]:helmet
$spawn = "outfit\helm_battle"
visual = dynamics\helm\helm_battle_dolg
control_inertion_factor = 1.0
inv_name = st_helm_battle_dolg
inv_name_short = st_helm_battle_dolg
description = st_helm_battle_dolg_descr
inv_weight = 3.0
inv_grid_width = 2
inv_grid_height = 2
inv_grid_x = 26
inv_grid_y = 0
upgr_icon_x = 900
upgr_icon_y = 450
upgr_icon_width = 100
upgr_icon_height = 100
cost = 8000
nightvision_sect = effector_nightvision_1
immunities_sect = sect_helm_battle_immunities
bones_koeff_protection = actor_helm_battle
telepatic_protection = 0.0600
radiation_protection = 0.0050
chemical_burn_protection = 0.0300
strike_protection = 0.0
explosion_protection = 0.0
wound_protection = 0.0

[sect_helm_battle_dolg_immunities]
burn_immunity = 0.02
strike_immunity = 0.0
shock_immunity = 0.02
wound_immunity = 0.0
wound_2_immunity = 0.0
radiation_immunity = 0.0
telepatic_immunity = 0.0
chemical_burn_immunity = 0.02
explosion_immunity = 0.01
fire_wound_immunity = 0.01

Далее добавим к мену апгрейд,в файле outfit.ltx в верху пишем:

#include "outfit_upgrades\helm_battle_dolg_up.ltx"

Так теперь создадим ветку Апгрейда. Для этого создадим текстовый документ helm_battle_dolg_up.ltx в папке gamedata/configs/misc/outfit_upgrades. Далее в нашем файле helm_battle_dolg_up.ltx пишем:

[up_sect_firsta_helm_battle_dolg]
cost = 500
value = +10

chemical_burn_protection = 0.005
radiation_protection = 0.0004

[up_sect_firstc_helm_battle_dolg]
cost = 1000
value = +20

telepatic_protection = 0.010

[up_sect_firstd_helm_battle_dolg]
cost = 1000
value = +20

chemical_burn_protection = 0.010

[up_sect_firste_helm_battle_dolg]
cost = 1500
value = +20

chemical_burn_protection = 0.015
radiation_protection = 0.0006

[up_sect_secona_helm_battle_dolg]
cost = 500
value = +1

power_restore_speed = 0.001

[up_sect_seconc_helm_battle_dolg]
cost = 1000
value = +20

telepatic_protection = 0.010

[up_sect_second_helm_battle_dolg]
cost = 2500
value = +2

nightvision_sect = effector_nightvision_2

[up_sect_secone_helm_battle_dolg]
cost = 3500
value = +3

nightvision_sect = effector_nightvision_3

[up_firsta_helm_battle_dolg]
scheme_index = 0, 0
known = 1
effects = up_gr_firstcd_helm_battle_dolg
section = up_sect_firsta_helm_battle_dolg
property = prop_radio, prop_chem

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_res_a1_name
description = st_up_res_a1_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_1


[up_firstc_helm_battle_dolg]
scheme_index = 1, 0
known = 1
effects = up_gr_firstef_helm_battle_dolg
section = up_sect_firstc_helm_battle_dolg
property = prop_psy

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_res_b1_name
description = st_up_res_b1_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_2

[up_firstd_helm_battle_dolg]
scheme_index = 1, 1
known = 1
effects = up_gr_firstef_helm_battle_dolg
section = up_sect_firstd_helm_battle_dolg
property = prop_chem

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_res_b5_name
description = st_up_res_b5_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_4


[up_firste_helm_battle_dolg]
scheme_index = 2, 0
known = 1
effects =
section = up_sect_firste_helm_battle_dolg
property = prop_radio, prop_chem

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_res_c7_name
description = st_up_res_c7_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_3

[up_secona_helm_battle_dolg]
scheme_index = 0, 1
known = 1
effects = up_gr_seconcd_helm_battle_dolg
section = up_sect_secona_helm_battle_dolg
property = prop_power

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_resp_a3_name
description = st_up_res_a3_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_5


[up_seconc_helm_battle_dolg]
scheme_index = 1, 2
known = 1
effects = up_gr_seconef_helm_battle_dolg
section = up_sect_seconc_helm_battle_dolg
property = prop_psy

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_resp_c4_name
description = st_up_resp_c4_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_6

[up_second_helm_battle_dolg]
scheme_index = 1, 3
known = 1
effects = up_gr_seconef_helm_battle_dolg
section = up_sect_second_helm_battle_dolg
property = prop_night_vision

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_resp_b1_name
description = st_up_resp_b1_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_8

[up_secone_helm_battle_dolg]
scheme_index = 2, 1
known = 1
effects =
section = up_sect_secone_helm_battle_dolg
property = prop_night_vision

precondition_functor = inventory_upgrades.precondition_functor_a
precondition_parameter = a & b

effect_functor = inventory_upgrades.effect_functor_a
effect_parameter = something_here

prereq_functor = inventory_upgrades.prereq_functor_a
prereq_tooltip_functor = inventory_upgrades.prereq_tooltip_functor_a
prereq_params =
name = st_up_resp_c1_name
description = st_up_resp_c1_descr
icon = ui_inGame2_upgrade_helm_battle_dolg_9


[up_gr_firstab_helm_battle_dolg]
elements = up_firsta_helm_battle_dolg

[up_gr_firstcd_helm_battle_dolg]
elements = up_firstc_helm_battle_dolg, up_firstd_helm_battle_dolg

[up_gr_firstef_helm_battle_dolg]
elements = up_firste_helm_battle_dolg

[up_gr_seconab_helm_battle_dolg]
elements = up_secona_helm_battle_dolg

[up_gr_seconcd_helm_battle_dolg]
elements = up_seconc_helm_battle_dolg, up_second_helm_battle_dolg

[up_gr_seconef_helm_battle_dolg]
elements = up_secone_helm_battle_dolg

Теперь добавим наш апгрейд Кардану,в файле stalkers_upgrade_info.ltx пропишем название нашего шлема
После строк

........
helm_respirator
helm_tactic
helm_battle_dolg ;наш шлем

Затем всё в этом же файле stalkers_upgrade_info.ltx после строк:

.................
up_sect_secona_helm_battle = {!upgrade_hint_kardan(1)} false, true
up_sect_seconc_helm_battle = {!upgrade_hint_kardan(2)} false, true
up_sect_second_helm_battle = {!upgrade_hint_kardan(2)} false, true
up_sect_secone_helm_battle = {!upgrade_hint_kardan(3)} false, true
up_sect_seconf_helm_battle = {!upgrade_hint_kardan(3)} false, true

Пишем:

up_sect_firsta_helm_battle_dolg= {!upgrade_hint_kardan(1)} false, true
up_sect_firstc_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_firstd_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_firste_helm_battle_dolg = false ;{!upgrade_hint_kardan(3)} false, true

up_sect_secona_helm_battle_dolg = {!upgrade_hint_kardan(1)} false, true
up_sect_seconc_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_second_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_secone_helm_battle_dolg = {!upgrade_hint_kardan(3)} false, true
up_sect_seconf_helm_battle_dolg = {!upgrade_hint_kardan(3)} false, true

Выглядеть будет так:

.................
up_sect_secona_helm_battle = {!upgrade_hint_kardan(1)} false, true
up_sect_seconc_helm_battle = {!upgrade_hint_kardan(2)} false, true
up_sect_second_helm_battle = {!upgrade_hint_kardan(2)} false, true
up_sect_secone_helm_battle = {!upgrade_hint_kardan(3)} false, true
up_sect_seconf_helm_battle = {!upgrade_hint_kardan(3)} false, true

up_sect_firsta_helm_battle_dolg= {!upgrade_hint_kardan(1)} false, true
up_sect_firstc_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_firstd_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_firste_helm_battle_dolg = false ;{!upgrade_hint_kardan(3)} false, true

up_sect_secona_helm_battle_dolg = {!upgrade_hint_kardan(1)} false, true
up_sect_seconc_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_second_helm_battle_dolg = {!upgrade_hint_kardan(2)} false, true
up_sect_secone_helm_battle_dolg = {!upgrade_hint_kardan(3)} false, true
up_sect_seconf_helm_battle_dolg = {!upgrade_hint_kardan(3)} false, true

Так же можно добавим описание нашему шлему , для этого откроем файл st_items_outfit.xml находится он в gamedata/configs/text/rus и в самом низу пишем:

<string id="st_helm_battle_dolg">
<text>Стальной Сталкера</text>
</string>
<string id="st_helm_battle_dolg_descr">
<text>Описание шлема</text>
</string>

Всё сохраняем , далее добавляем наш шлем либо в торговлю либо сразу спавним в стартовом капитале ГГ
Я предпочитаю спавнить, для этого в файле character_desc_general.xml находится он gamedata/configs/gameplay
Пишем после строки:

.................
conserva = 2 \n
helm_battle_dolg = \n

Всё, можно проверять.

Автор: DOC_VENOM

 

Изменено пользователем World_Stalker
оформил
Ссылка на комментарий
By max_max_08, iDreD ©
--что делают функции из бинд сталкер
function actor_binder:net_spawn(data) --функция запускается при переходе на новую локацию, при загрузке сохранения.
end
 
function actor_binder:update(delta) --функция запускается постоянно, т.е. если вписать какую либо проверку, то проверяться будет постоянно.
end
 
--Общее
local npc --создается локальная переменная с именем npc (при обращении к ней, она существует, но равна nil)
--пример
local active_item = db.actor:item_in_slot(db.actor:active_slot())
-- local active_item (локальная переменная с именем active_item) = db.actor:(у кого проверяем,)item_in_slot(предмет в слоте(в скобках номер слота или условие))(db.actor:active_slot()(активный слот, т.е. если ДЕРЖИМ в руках пистолет то db.actor:active_slot равно 1 если автомат то 2) в итоге локальная active_item равняется обьекту который держим в руках
--active_item это обьект, который в онлайне, если нам нужно проверить его секцию то делаем так
local active_item = db.actor:item_in_slot(db.actor:active_slot())
if active_item:section() == "wpn_ak74" then --if(если) active_item:section() (секция обьекта active_item) == (равна) "wpn_ak74" (секция калаша) then(то)
--действие 
end
--у обьекта можно многое проверить, например группировку, имя, цену, состояние и пр.
 
math.random(120,140) -- принимает рандомное число в даном пределе.
-- т.е amk.start_timer("taimer",math.random(120,140)) будет выглядить примерно так amk.start_timer("taimer",120) где число 120 будет выбано рандомно
local obj=alife():create("секция_обьекта",vector():set(-81.4560,-0.2423,157.2334),186914,163) --спавнит обьект и приравнивает его к локальной obj
--тоесть после спавна с обьектом можно проделать какие либо действия(нанести хит, изменить группировку, заспавнить ему оружие\предмет, изменить состояние(кондицию)
 
--функция спавна с чтением\записью нэт пакета(требуется АМК)
function spawn_burer()
local obj = alife():create("burer_normal",vector():set(73.2404251098633,-0.0141735374927521,28.42),10537,2430) --спавним бюррера, и назначаем ему локальную obj
local params=amk.read_monster_params(obj) --читаем параметры (обьекта) obj
params.custom="[logic]\ncfg = scripts\\new\\burer1.ltx" --указываем путь до логики
params.sid=9800 --назначаем сид, что-то типа айди(индивидуальный номер)
params.health = 0 --назначаем значение здоровья, 0-мертв, 1-как новенький.
amk.write_monster_params(params,obj) --записываем новые параметры (обьекту) obj
end

--даем предмет, вызывается из диалога
function give_scope(first_speaker, second_speaker) --в скобках два обьекта которые ведут диалог, один из них актор другой нпс
if db.actor and db.actor:id() == first_speaker:id() then --если айди актора и first_speaker РАВНЫ то.
actor = first_speaker --локальная actor принимает значение first_speaker
npc = second_speaker  --а локальная npc принимает значение second_speaker
else --иначе (если айди актора и first_speaker НЕ РАВНЫ)
actor = second_speaker --наоборот локальная actor принимает значение second_speaker
npc = first_speaker   --а локальная npc принимает значение first_speaker
end
dialogs.relocate_item_section(actor, "wpn_addon_scope", "in") --даем оптику на калаш актору,(если указать npc до дадим тому с кем говорим) "in" даем, "out" забираем
dialogs.relocate_item_section(actor, "wpn_addon_grenade_launcher", "in")
dialogs.relocate_item_section(actor, "wpn_ak74", "in")
end

-- удаляем непися по сиду
function del_oleg_1()
local sim = alife()
local se_obj = sim:story_object(5004) --сид обьекта которого удаляем
if se_obj then --если se_obj равно true т.е. существует т.е. не равно nil
sim:release(se_obj, true) -- собственно удаление
end
end
 
function daem_patroni(first_speaker, second_speaker)
if  sak.have_item_namber("wpn_abakan", 1)   or --если в рюкзаке есть абакан или (sak. это файл, have_item_namber это функция ("wpn_abakan") это строка которая передается в функцию have_item_namber, а функция возвращает true или false )
sak.have_item_namber("wpn_groza_m1", 1) or --гроза или
sak.have_item_namber("wpn_ak74", 1) or --ак 74 или
sak.have_item_namber("wpn_ak74u", 1) then --ак 74у то...
dialogs.relocate_item_section(second_speaker, "ammo_5.45x39_ap", "in") --даем патроны ammo_5.45x39_ap  second_speaker-у (тоесть гг)
dialogs.relocate_item_section(second_speaker, "ammo_5.45x39_ap", "in")
dialogs.relocate_item_section(second_speaker, "ammo_5.45x39_ap", "in")
dialogs.relocate_item_section(second_speaker, "ammo_5.45x39_ap", "in")
else -- иначе (если перечисленных стволов в юкзаке нет)
dialogs.relocate_item_section(second_speaker, "ammo_5.56x45_ss190", "in")--даем патроны ammo_5.56x45_ss190  second_speaker-у (тоесть гг)
dialogs.relocate_item_section(second_speaker, "ammo_5.56x45_ss190", "in")
dialogs.relocate_item_section(second_speaker, "ammo_5.56x45_ss190", "in")
dialogs.relocate_item_section(second_speaker, "ammo_5.56x45_ss190", "in")
end -- закрывающий тэг для if (для else end не нужен)
end -- закрывающий тэг для function
 
if has_alife_info("инфо1") and has_alife_info("инфо2") and has_alife_info("инфо3") then --если выданы ВСЕ инфопоршны то...
end

if has_alife_info("инфо1") or has_alife_info("инфо2") or has_alife_info("инфо3") then --если выдан хоть один инфопоршнен то...
end

if (has_alife_info("инфо1") or has_alife_info("инфо2")) and not has_alife_info("инфо3") then --если выданы инфо 1 или 2, а инфо 3 отсутствует (в скобках проверяется первым, как в алгебре)...
end

--проверка для квеста
function xabar_in_actor()
return db.actor:object("pda_wolf_drug") ~= nil --return(вернуть) true(правда) если pda_wolf_drug не равен nil т.е. находится в рюкзаке
end

--различные проверки 
if level.name()=="l07_military" then --если актор находится на локации l07_military (военные склады) то...
--деиствие
end 
 
db.actor:give_info_portion("имя инфо") --выдать гг инфоноршен
 
if has_alife_info("имя инфо") then --проверить выдан ли поршен
--действие
end 
obj:cost() --цена обьекта
--Как использовать?
if obj:cost() > 1000 then -- если цена обьекта больше 1000 то..
--действие
end
--или
local cost = obj:cost() --переменная cost принимает значение цены у обьекта(obj)
 
obj:condition() --состояние обьекта 1.0-новый
obj:active_slot() --активный предмет, тот который сейчас держит obj, obj-ом может быть db.actor
local rank = ranks.get_obj_rank_name(db.actor) --проверим ранг
local dist = obj:position():distance_to(db.actor:position()) -- dist это растояние в метрах между obj и db.actor 
db.actor:eat(medkit) --использовать(схавать) предмет, medkit это ни секция, а обьект т.е. кастомдата обьекта
npc:see(db.actor) --нпс видит актора
obj:get_ammo_in_magazine() --кол-во патронов в магазине
alife():release(alife():object(obj:id()),true) -- удаляем obj
obj:add_animation("анимация") --проиграть анимацию у нпс
"udar_0"  = Удар кулаком
"prisluh_1_idle_1"  = одной рукой пушку вверх 
"prisluh_0_idle_1"  = одной рукой на земле
"prisluh_3_idle_1"  = сидя, двумя руками пушка накрест
"wounded_idle_0"    = сидя, тошнит
"waunded_1_idle_0"  = калачик
"wounded_2_idle_0"  = лежит, раненый
"wounded_3_idle_0"  = лежит, двумя руками держась за живот
local number = tonumber(number_1) --конвертируем number_1 в число number
local string = tostring(string) --конвертируем string в строку string

--способы получения объектов 
local obj = level_object_by_sid(6) -- по сиду из алл спавна. Это сид волка.
local obj = alife():create("секция",vector():set(x,y,z)game_vertex,level_vertex) --при спавне скриптом.
local obj = db.actor:item_in_slot(number) --по предмету в слоте,number - это номер слота
local sobj = alife():object(npc:id()) --получение серверного обьекта по айди
--[[
[Слот_1]=[пистолеты]
[Слот_2]=[автоматы]
[Слот_3]=[гранаты]
[Слот_4]=[бинокль]
[Слот_5]=[болт]
[Слот_6]=[бронекостюм]
[Слот_7]=[пда]
[Слот_8]=[детектор]
[Слот_9]=[фонарик]
]]
npc:relation(obj) == game_object.neutral --отношение npc к obj запишем нейтральное или game_object.friend дружеское
obj:name() -- имя obj
npc:object("medkit") --проверим наличие аптечки у npc
npc:character_community() -- групировка npc
npc:character_name()
npc:character_reputation()
npc:character_rank()
npc:profile_name()
db.actor:set_character_rank(650) --запишем ранг актору

-- нанесение хита обьекту
local h = hit()
h.power = 10000 --сила удара
h.impulse = 1 --импульс
h.draftsman = obj 
h.type = hit.fire_wound --тип урона
h.direction = db.actor:position():sub(obj:position()) --откуда пришел удар(имеется в виду направление)
h:bone("pelvis") -- по какой кости даем пинка
obj:hit(h) --собственно сам удар по obj

--фиксация обьекта
function name()
local obj=alife():create("wpn_ak74",vector():set(268.300,12.157,23.788),543524,138) --спавним калаш и присваеваем ему переменную obj
if obj then --если obj существует то...
local pshell = obj:get_physics_shell() --получаем оболочку обьекта
if pshell then --если получили то...
local element = pshell:get_element_by_order(0) --получаем елемент оболочки
if element then --если получили то...
element:fix() --фиксируем елемент оболочки
end
end
end
end

--спавн рюкзака и спав в него предмета
local obj = alife():create("section_treasure", vector():set(-347.58, -22.4, 194.8), 8132, 1839) --спавним тайник
if obj then alife():create("имя секции", vector():set(-347.58, -22.4, 194.8), 8132, 1839, obj.id) -- спавним (В ОФФЛАЙНЕ) в тайник предмет, ловим по айди
end
--если в секции есть такая строка то истина
if string.find(obj:section(), "boar") then
--деиствие
end

--перебор обьектов
for a=1,65534 do --крутим цикл
  local obj = alife():object(a) --каждый обьект (a)  принимает значение obj
    if obj and IsMonster(obj) then --если обьект монстр(или IsStalker(obj) - сталкер)
--действие
end
end

--если пушка в руках - прячем, а то тащить неудобно
if npc:weapon_unstrapped() then
npc:set_item(object.idle,nil)
end
-- получим активную схему
local actsch=db.storage[npc:id()].active_scheme
--если зашли в эти координаты то кирдык
local pos = db.actor:position()
if pos.z>65 and pos.x>350 and pos.x<410 then
db.actor:kill(db.actor)
end

--взято из OGSE
-- Отметка укрытий на карте
function mark_hideouts()
for k,v in pairs(ogsm_respawn.restrictor_list) do
local obj = level.object_by_id(v.id)
level.map_add_object_spot(obj:id(), "red_location", obj:name())
end
end
 
-- Удаление укрытий
function del_hideouts()
for k,v in pairs(ogsm_respawn.restrictor_list) do
alife():release(v, true)
end
end 

 

Когда-то писалось для камрада стартер, но и другим пригодится. http://rghost.ru/9364471

Изменено пользователем World_Stalker
Ссылка на комментарий

Создайте аккаунт или авторизуйтесь, чтобы оставить комментарий

Комментарии могут оставлять только зарегистрированные пользователи

Создать аккаунт

Зарегистрировать новый аккаунт в нашем сообществе. Это несложно!

Зарегистрировать новый аккаунт

Войти

Есть аккаунт? Войти.

Войти
  • Недавно просматривали   0 пользователей

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

AMK-Team.ru

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