Теория Мне кажется многие задавались вопросом "Как же создать худ маски"?Немного пораздумав, я создал функцию, которая крепит текстуру к определенному костюму. Опытным модмейкерам может показаться моя функция усложненной, но главное, что все работает и не вылетает! ПрактикаРабота со скриптамиПервым делом в директории gamedata\scripts создайте файл с названием xr_mask.script Открываем его пишем: function hud_gas()local slot_stalker = db.actor:item_in_slot(6) local object_1 = db.actor:object("stalker_outfit") local slot_killer = db.actor:item_in_slot(6) local object_2 = db.actor:object("killer_outfit") if slot_stalker and slot_stalker:section() == "stalker_outfit" and object_1 ~= nilor slot_killer and slot_killer:section() == "killer_outfit"and object_2 ~= nilthenlocal hud = get_hud() local custom_static = hud:GetCustomStatic("hud_gas") if custom_static == nilthen hud:AddCustomStatic("hud_gas", true)endelselocal hud = get_hud() local custom_static = hud:GetCustomStatic("hud_gas") if custom_static ~= nilthen hud:RemoveCustomStatic("hud_gas", false)endendend Теперь поясню: function hud_gas()-- функция local slot_stalker = db.actor:item_in_slot(6)-- переменная костюма local object_1 = db.actor:object("stalker_outfit")-- переменная объекта local slot_killer = db.actor:item_in_slot(6)-- переменная костюма local object_2 = db.actor:object("killer_outfit")-- переменная объекта if slot_stalker and slot_stalker:section() == "stalker_outfit" and object_1 ~= nilor slot_killer and slot_killer:section() == "killer_outfit"and object_2 ~= nilthen-- проверяем надет ли костюм сталкера\наемника local hud = get_hud()-- худ local custom_static = hud:GetCustomStatic("hud_gas") if custom_static == nilthen-- если худа нет, выдаем, если одет костюм hud:AddCustomStatic ("hud_gas", true)endelselocal hud = get_hud() local custom_static = hud:GetCustomStatic("hud_gas") if custom_static ~= nilthen-- если худ есть, убираем при смене костюма hud: RemoveCustomStatic("hud_gas", false)endendend Теперь зайдем в bind_stalker.script, который находится в gamedata\scripts,найдем функцию:function actor_binder:update(delta) и после пишем: xr_mask.hud_gas() в итоге: function actor_binder:update(delta) xr_mask.hud_gas() object_binder.update(self, delta)localtime = time_global() game_stats.update (delta, self.object) Работа с XML - описателемИтак, заходим в директорию gamedata\config\ui, находим файл с названием ui_custom_msgs, открываем его и в самом конце перед строкой: </header> пишем: <hud_gas x="0" y="0" width="1024" height="768" stretch="1"> <texture>hud\hud_gas</texture> </hud_gas> Теперь поясню: <hud_gas x="0" y="0" width="1024" height="768" stretch="1"> <texture>hud\hud_gas</texture> -- текстура маски. Посмотрите внимательно в скрипте мы указывали '''hud_gas''' </hud_gas> ТекстураТеперь заходим в gamedata\textures\ui, находим файл с названием ui_mainmenu.dds.Копируем его, заходим в gamedata\textures\hud вставляем его и переминуем в hud_gas.ddsОткрываем программой Adobe Photoshop и рисуем подходящую для вас маску.Как работать с текстурами описано в этой статье: http://www.stalkerin.gameru.net/wiki/index.php/Изменение%20текстур Вот и все! Начинаем новую игру, ищем костюм сталкера или наемника, надеваем и видим вашу текстуру.
|