Рекомендуем зарегистрироваться либо войти в свой аккаунт.
Автор: Сектор · Добавил: Сектор · 28.03.14 в 22:08

Очень хочется заменить цифры жизни на картинку, но не знаете как? В этом уроке мы рассмотрим создание Худа. Но для начала немного теории: Худ жизни создан на основе 20 изображений показа здоровья игрока от 100% до 0% с шагом в 5%.
Итак начинаем, идем в папку Files\languagebank\english\gamebank\mygame и открываем файл setuplevel.fpi, находим строчки:

Код
:state=0:hudreset,hudx=5,hudy=5,hudimage=languagebank\english\gamecore\huds\lives.tga,hudmake=display
:state=0:hudreset,hudx=4,hudy=8,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudtype=1,hudmake=numeric


Теперь перед каждой строкой ставим знак ";", получится вот так:

Код
;:state=0:hudreset,hudx=5,hudy=5,hudimage=languagebank\english\gamecore\huds\lives.tga,hudmake=display
;:state=0:hudreset,hudx=4,hudy=8,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudtype=1,hudmake=numeric


Тем самым мы запретили движку показывать надпись lives и количество жизней игрока. Теперь сразу после этих строк вставляем вот это:

Код
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudimage=
languagebank\english\gamecore\huds\healthbar
\healthbar.dds,hudmake= display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health100,hudimage=
languagebank\english\gamecore
\huds\healthbar\100. dds,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health95,hudimage=
languagebank\english\gamecore
\huds\healthbar\95.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health90,hudimage=
languagebank\english\gamecore
\huds\healthbar\90.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health85,hudimage=
languagebank\english\gamecore
\huds\healthbar\85.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health80,hudimage=
languagebank\english\gamecore
\huds\healthbar\80.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health75,hudimage=
languagebank\english\gamecore
\huds\healthbar\75.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health70,hudimage=
languagebank\english\gamecore
\huds\healthbar\70.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health65,hudimage=
languagebank\english\gamecore
\huds\healthbar\65.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health60,hudimage=
languagebank\english\gamecore
\huds\healthbar\60.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health55,hudimage=
languagebank\english\gamecore
\huds\healthbar\55.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health50,hudimage=
languagebank\english\gamecore
\huds\healthbar\50.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health45,hudimage=
languagebank\english\gamecore
\huds\healthbar\45.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health40,hudimage=
languagebank\english\gamecore
\huds\healthbar\40.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health35,hudimage=
languagebank\english\gamecore
\huds\healthbar\35.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health30,hudimage=
languagebank\english\gamecore
\huds\healthbar\30.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health25,hudimage=
languagebank\english\gamecore
\huds\healthbar\25.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health20,hudimage=
languagebank\english\gamecore
\huds\healthbar\20.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health15,hudimage=
languagebank\english\gamecore
\huds\healthbar\15.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health10,hudimage=
languagebank\english\gamecore
\huds\healthbar\10.dd s,hudhide=1,hudmake=display
:state=0:hudreset,hudsizex=222,hudsizey=19,hudx=15.75,hudy=6.55,hudname=Health5,hudimage=
languagebank\english\gamecore
\huds\healthbar\5.dds, hudhide=1,hudmake=display,state=0


Объясняю что к чему :

hudimage=languagebank\english\gamecore\huds\healthbar - папка расположения картинок Худа
hudsizex,hudsizey - размеры картинок Худа
hudx - положение Худа по координате "Х" с лева направо, значение от 1 до 100
hudy - положение Худа по координате "Y" с верху вниз, значение от 1 до 100
hudname=Health5-100 - количество отнимаемой\прибавляемой энергии у игрока с каждым выстрелом в процентах
(представлено с шагом в 5%,но в принципе можно сделать с любым шагом)
hudimage - расположение картинки соответствующей проценту энергии игрока

Теперь после строки Main Game вставляем сам код худа:

Код
Health Control
:state=1,plrhealthgreater=499:hudreset,hudshow=Health100,hudunshow=Health95,hudunshow=Health90,
hudunshow=Health85,
hudunshow=Health80,hudunsh ow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudunshow=Heal th40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=Health5
:state=1,plrhealthless=500,plrhealthgreater=475:hudunshow=Health100,hudshow=Health95,hudunshow=
Health90,hudunshow=Health85,
hudunshow=Health8 0,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=474,plrhealthgreater=450:hudunshow=Health100,hudunshow=Health95,hudshow=
Health90,hudunshow=Health85,
hudunshow=Health8 0,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=449,plrhealthgreater=425:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudshow=Health85,
hudunshow=Health8 0,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=424,plrhealthgreater=400:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudunshow=Health85,
hudshow=Health8 0,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=399,plrhealthgreater=375:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudunshow=Health85,
hudunshow=Healt h80,hudshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=374,plrhealthgreater=350:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudunshow=Health85,
hudunshow=Healt h80,hudunshow=Health75,hudshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=Health55,
hudunshow=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=349,plrhealthgreater=325:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudunshow=Health85,
hudunshow=Healt h80,hudunshow=Health75,hudunshow=Health70,hudshow=Health65,hudunshow=Health60,hudunshow=
Health55,hudunshow
=Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20
,hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=324,plrhealthgreater=300:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudunshow=Health85
,hudunshow=Healt h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudshow=Health60,hudunshow=
Health55,hudunshow=
Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5
:state=1,plrhealthless=299,plrhealthgreater=275:hudunshow=Health100,hudunshow=Health95,hudunshow=
Health90,hudunshow=Health85,
hudunshow=Healt h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudshow=
Health55,hudunshow=
Health50,hudunshow=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow=Health10,hudunshow=He alth5

:state=1,plrhealthless=274,plrhealthgreater=250:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow

=Healt h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudshow=Health50,hudunshow

=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow

=Health10,hudunshow=He alth5
:state=1,plrhealthless=249,plrhealthgreater=225:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow

=Healt h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudshow

=Health45,hudun show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow

=Health10,hudunshow=He alth5
:state=1,plrhealthless=224,plrhealthgreater=200:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Healt  

h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudunshow=

Health45,hud show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow=

Health10,hudunshow=He alth5
:state=1,plrhealthless=199,plrhealthgreater=175:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Healt  

h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudunshow=

Health45,hud unshow=Health40,hudshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow

=Health10,hudunshow=He alth5:state=1,plrhealthless=174,plrhealthgreater=150:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudun
show
=Health85,hudunshow=Healt
h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=
Health55,hudunshow=Health50,hudunshow=Health45,hud  

unshow=Health40,hudunshow=Health35,hudshow=Health30,hudunshow=Health25,hudunshow=
Health20,hudunshow=Health15,hudunshow=Health10,hudun
s h o w =
He alth5
:state=1,plrhealthless=149,plrhealthgreater=125:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Healt  

h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudunshow=Health45,hud  

unshow=Health40,hudunshow=Health35,hudunshow=Health30,hudshow=Health25,hudunshow=Health20,
hudunshow=Health15,hudunshow=Health10,hudunshow=

Health5
:state=1,plrhealthless=124,plrhealthgreater=100:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Healt  

h80,hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudunshow=Health45,hud  

unshow=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudshow=Health20
,hudunshow=Health15,hudunshow=Health10,hudunshow=

He alth5
:state=1,plrhealthless=99,plrhealthgreater=75:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Health8  
0,
hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudunshow=Health45,hudun

show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=
Health20,hudshow=Health15,hudunshow=Health10,hudunshow=Heal  
th5
:state=1,plrhealthless=74,plrhealthgreater=50:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Health8  
0,
hudunshow=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,
hudunshow=Health55,hudunshow=Health50,hudunshow=Health45,hudun

show=Health40,hudunshow=Health35,hudunshow=Health30,hudunshow=Health25,
hudunshow=Health20,hudunshow=Health15,hudshow=Health10,hudunshow=Heal  
th5
:state=1,plrhealthless=49,plrhealthgreater=25:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Health8  
0,hudunshow
=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=
Health55,hudunshow=Health50,hudunshow=Health45,hudun
show=Heal th40,hudunshow
=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,hudunshow=
Health15,hudunshow=Health10,hudshow=Heal th5

:state=1,plrhealthless=24,plrhealthgreater=5:hudunshow=Health100,hudunshow=Health95,
hudunshow=Health90,hudunshow=Health85,hudunshow=Health80  
,hudunshow
=Health75,hudunshow=Health70,hudunshow=Health65,hudunshow=Health60,hudunshow=
Health55,hudunshow=Health50,hudunshow=Health45,huduns
how=Heal th40,hudunshow
=Health35,hudunshow=Health30,hudunshow=Health25,hudunshow=Health20,hudunshow=
Health15,hudunshow=Health10,hudunshow=Hea lth5


Где plrhealthgreater - количество энергии игрока от 500 и до 0 в системных единицах - в данном случае с шагом 25 или 5% шаг можно использовать любой
Health - количество энергии игрока в процентах.

Пример кода с шагом в 1%

Код
state=1,plrhealthless=495,plrhealthgreater=490:hudunshow=Health100,hudunshow=Health99,hudshow=Health98,hudunshow=Health97,
hudunshow=Health96 ,........
hudunshow=Health55,hudunshow=Health56,hudunshow=Health57,.......,hudunshow=Health3,hudunshow=Health2,

hudunshow=Health1
state=1,plrhealthless=490,plrhealthgreater=490:hudunshow=Health100,hudunshow=Health99,hudshow=Health98,hudunshow=Health97,hudunshow

=Health96 ,........ hudunshow=Health55,hudunshow=Health56,hudunshow=Health57,.......,hudunshow=Health3,hudunshow=Health2,hudunshow=Health1


И так далее. Соответственно, количество строк и изображений увеличится с 20 до 100 штук

Ну вот теперь для создания своего Худа с шагом энергии в 5% вам надо всего лишь заменить размер картинок (hudsizex, hudsizey) и положение координат (hudx, hudY) Худа на свои, вот и все. Ждем ваших творений у нас на сайте.

В итоге должно получится это:



Эта статья была полезной? Не забудь повысить репутацию Сектор!
Просмотров: 1307 · Комментариев: 2

Narkoman Материал
А куда последний код вставлять?

Это пример


Для добавления комментария необходимо зарегистрироваться либо войти в свой аккаунт.


  Новые файлы

Новых файлов за текущий месяц нет.
Перейти в архив файлов


  Последний комментарий

23.11.24 в 23:19
Написал: matweykoles00
К материалу: Пак оружия 8шт
Комментарий: как скачать то

Перейти к комментариям


  Он-лайн Чат

Чат только для пользователей.

  Актуальный опрос!

Проверка актива! Чем занимаешься?
Проголосовало 326 чел.


  Статистика посещаемости

Сейчас в сети:


Сегодня нас проведали:
 joelwolfe00



Яндекс.Метрика


Уроки по GameGuru · Помощь по GameGuru · FPS Creator X9 · Уроки по FPS Creator · Помощь по FPS Creator
© FPS Creator Community · 2012-2024 · Хостинг от uCoz
Руководители проекта - Даниил Костин и Богдан Зиза