HLFX.Ru Forum
Показать все 14 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- BSP in Background. (https://hlfx.ru/forum/showthread.php?threadid=2640)


Отправлено supra36 21-02-2011 в 17:42:

BSP in Background.

Hi there fellas

I was recently checking new mod updates in moddb and i found something very super mega ultra cool interesting, which can be very very usefull for everyone who want to make such thing (look this thread name) in his modification.

http://www.moddb.com/mods/cry-of-fe...w-menu#imagebox

This is such awesome that it can't just be 'bypassed' by half-life modding community.

Well i think it works like this :

Check when client is beign initialized. Render map, entities and everything which should be rendered on our background map, run your own precoded VGUI menu.

But do anyone have idea or clues how to "give" it life ?

Cheers.

__________________
настоящий мужчина не нуждается в подписи.


Отправлено XaeroX 22-02-2011 в 03:29:

I think this is actually a loaded map with custom menu code. I don't know what the hell is "awesome" here and I prefer static menus - they are robust and load quickly.

__________________

xaerox on Vivino


Отправлено supra36 22-02-2011 в 07:17:

The awesomness is that we can create source stuff in goldsource and this is more fun than creating goldsource stuff in source

__________________
настоящий мужчина не нуждается в подписи.


Отправлено XaeroX 22-02-2011 в 07:45:

The most fun is to create goldsource stuff in goldsource and source stuff in source. Crutches are never funny.

__________________

xaerox on Vivino


Отправлено supra36 22-02-2011 в 20:27:

Well i started to code this stuff, i already have map load on start by using engfuncs command but here i have problem with chapter files :

code:
string BSPBackground::LoadBackgroundFile( void ) { level_id = 1; const char* szGameDir = gEngfuncs.pfnGetGameDirectory(); ifstream infile("%s/scripts/background0%s.txt", szGameDir, level_id); if (!infile) { gEngfuncs.Con_Printf( "Cannot find background0%s.txt . Game will load default background file.", level_id); } else { gEngfuncs.Con_Printf( "The file background0%s.txt found ! Game will load specified background file.", level_id); string line; infile >> line; infile.close(); return line; } } and i got this stupid error

code:
Compiling... cdll_int.cpp C:\HLSDK\Single-Player Source\cl_dll\cdll_int.cpp(318) : error C2661: 'basic_ifstream<char,struct std::char_traits<char> >::basic_ifstream<char,struct std::char_traits<char> >' : no overloaded function takes 3 parameters Error executing cl.exe.

__________________
настоящий мужчина не нуждается в подписи.


Отправлено Дядя Миша 22-02-2011 в 21:14:

What is 'level_id' ?

__________________
My Projects: download page

F.A.Q по XashNT
Блог разработчика в телеграме

Цитата:

C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'


Отправлено fire64 22-02-2011 в 21:19:

supra36, Why, you are using ifstream?
You have a very strange code that uses the function engine.

C++ Source Code:
1
char *BSPBackground::LoadBackgroundFile( void )
2
{
3
  level_id = 1;
4
 
5
  char szChapterConfig[MAX_PATH];
6
  sprintf( "scripts/background0%d.txt", level_id );
7
 
8
  char *pChapterFile = (char*)gEngfuncs.COM_LoadFile( sz, 5, NULL );
9
 
10
  if(!pChapterFile)
11
  {
12
    gEngfuncs.Con_Printf( "Cannot find %s . Game will load default background file.\n", szChapterConfig );
13
 
14
    return 0;
15
  }
16
 
17
  gEngfuncs.Con_Printf( "The file %s found !\n Game will load specified background file.\n", szChapterConfig );
18
 
19
  gEngfuncs.COM_FreeFile( pChapterFile );
20
 
21
  return pChapterFile;
22
}
23
 

__________________
Вся сила лысого кощея,
Сокрыта в башне из костей
Воздвигнутой, под небесами
На месте похорон людей


Отправлено FiEctro 22-02-2011 в 21:33:

http://pastebin.com/ScNVa9E4

__________________
У котёнка мокрый нос и гладенькая шерсть, у него забавный хвост и быстрых лапок шесть. Две задних, две средних и две передних лапы, такая многоножка получилася у папы.
Он ученый — папа мой — зверушек изучает, гуляет по помойкам, ловит крыс и чаек. Две крысы белокрылые и чайки две унылые покрытые пупырчатою кожей лягушат без пёрышек тоскуют и ускакать спешат.
А ещё есть муравей большой размером с гуся он пугает всех зверей, и я его боюся, когда он ковыляет на лапках на своих.
И в двери ударяет, и начинает стих: Я — муравей, воды налей! Не меньше ведра, напиться мне пора!


Отправлено supra36 23-02-2011 в 07:04:

@up : Yeah, btw the code you have is old, first try xD Whatever, it was first time when im working with fstream, i spent lot of time on chaning gameplay, not really on codding features like that.

Well level_id represents actual background.

If level_id will be 5 then game will load background5.txt.

__________________
настоящий мужчина не нуждается в подписи.


Отправлено XaeroX 23-02-2011 в 07:55:

supra36 forget about io streams, STL an so on. It is the work of the devil.

__________________

xaerox on Vivino


Отправлено RavenPest 23-02-2011 в 22:25:

Re: BSP in Background.

Цитата:
supra36 писал:
Hi there fellas

I was recently checking new mod updates in moddb and i found something very super mega ultra cool interesting, which can be very very usefull for everyone who want to make such thing (look this thread name) in his modification.

http://www.moddb.com/mods/cry-of-fe...w-menu#imagebox

This is such awesome that it can't just be 'bypassed' by half-life modding community.

Well i think it works like this :

Check when client is beign initialized. Render map, entities and everything which should be rendered on our background map, run your own precoded VGUI menu.

But do anyone have idea or clues how to "give" it life ?

Cheers.


Well I already made this stuff for my mod some time ago, its pretty easy actually.

You dont even have to code anything beside the VGUI menu stuff. You can just do a batch file that loads your background map, then in it you make a trigger_auto or a multi_manager that activates on map load, and in there you change a CVAR, lets say "show_background_menu" from 0 to 1 (using a trigger_changecvar), and you then use that CVAR to trigger your VGUI MENU. Simple as hell and very fast to make. Why are you complicating your life?


Отправлено supra36 24-02-2011 в 07:53:

I have no idea why I'm complicating my life, on maths lessons I do not make fractions shorter, I was always making stuff in a harder way. Well, maybe harder way = win sometimes ?

I will check out if you hav any screenshot of your work, and I'm making menu concept already.

By the way i cannot decide about something, there is a model renderer by DJShark23Prog but I'm afraid that if i will use paranoia's renderer in my modification i won't be able to use new model renderer which supports up to 48,000 polys and i wanted to make facial animations for mod characters.

@edit : Hell no, you do not have any screenshot's , can you show us an example or this is TOP SECRET ?

__________________
настоящий мужчина не нуждается в подписи.


Отправлено RavenPest 24-02-2011 в 15:41:

Цитата:
supra36 писал:
I have no idea why I'm complicating my life, on maths lessons I do not make fractions shorter, I was always making stuff in a harder way. Well, maybe harder way = win sometimes ?

I will check out if you hav any screenshot of your work, and I'm making menu concept already.

By the way i cannot decide about something, there is a model renderer by DJShark23Prog but I'm afraid that if i will use paranoia's renderer in my modification i won't be able to use new model renderer which supports up to 48,000 polys and i wanted to make facial animations for mod characters.

@edit : Hell no, you do not have any screenshot's , can you show us an example or this is TOP SECRET ?


Well atm I'm working on the background thing, I only have a small room with nothing inside of it. And the VGUI menu for now is just a copy of VGUI_Weaponpanel from AM source, I have to modify it to make it work as a real in-game menu. So no, I wont show it until its (at least almost) finished, sorry.

BUT! I can tell you that it works perfectly. And about the code itself, just do some research and copy-paste of things from the keypad code, again from AM, there's everything you need to know about VGUIs there, and its really easy stuff.

And no, DJShark's model renderer doesnt work in paranoia. I tried that too, and unfortunately models are viewed inside-out and without lighting, and the textures are either missing or completely screwed


Отправлено supra36 24-02-2011 в 16:15:

Well i had inside-out bug but it was because i made wrong defines values, like #define STUDIO_NF_UNLIT or #define STUDIO_NF_ALPHA ect. After i set them on 0 it worked one time but i changed sth (idk what exactly) and i have ugly bug now

__________________
настоящий мужчина не нуждается в подписи.


Временная зона GMT. Текущее время 07:21.
Показать все 14 сообщений этой темы на одной странице

На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024