HLFX.Ru Forum
профиль •  правила •  регистрация •  календарь •  народ •  FAQ •  поиск •  новое •  сутки •  главная •  выход  
HLFX.Ru Forum HLFX.Ru Forum > Разработка игр > Наши проекты > XashXT > Problem with compiling server.dll
Страницы (2): [1] 2 »   Предыдущая тема   Следующая тема
Автор
Тема Новая тема    Ответить
Burner
Новичок

Дата регистрации: Apr 2014
Проживает: Craiova
Сообщений: 10
Возраст: 29

Рейтинг



Problem with compiling server.dll

Hello everybody, sorry I don't know Russian language so I use to speak English

I tried to compile source codes from XashXT, from the last version 0.65 but I have a problem with the dimenision of compiled server.dll ...
Without editing anything inside I just tried to compile source codes to check if it compiles fine but dimension of the compiled server.dll its 3,189 kb, compared to the original server.dll wich has just 1,352 kb.
It work fine when I play...but dimension of this 2 files scares me

I use Microsoft Visual Studio 6 to compile this source codes.

Another problem its with adding a new monster in Xash3D v0.65... I tried to add monster_gonome, with this source code "gonome.cpp" but while compiling the source code I get these errors:

code:
--------------------Configuration: server - Win32 Debug-------------------- Compiling... gonome.cpp d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : warning C4002: too many actual parameters for macro 'DEFINE_FIELD' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2597: illegal reference to data member 'CGonomeSpit::m_maxFrame' in a static member function d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2440: 'initializing' : cannot convert from '' to 'enum _fieldtypes' Context does not allow for disambiguation of overloaded function d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2440: 'initializing' : cannot convert from 'char [12]' to 'enum _fieldtypes' There is no context in which this conversion is possible d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2065: 'classNameTypedef' : undeclared identifier d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2059: syntax error : ')' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(70) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(71) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(71) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(111) : error C2664: 'UTIL_SetOrigin' : cannot convert parameter 1 from 'struct entvars_s *' to 'class CBaseEntity *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : warning C4002: too many actual parameters for macro 'DEFINE_FIELD' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : error C2597: illegal reference to data member 'CGonome::m_fCanThreatDisplay' in a static member function d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : error C2440: 'initializing' : cannot convert from '' to 'enum _fieldtypes' Context does not allow for disambiguation of overloaded function d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : error C2440: 'initializing' : cannot convert from 'char [8]' to 'enum _fieldtypes' There is no context in which this conversion is possible d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : error C2059: syntax error : ')' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(307) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(308) : warning C4002: too many actual parameters for macro 'DEFINE_FIELD' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(308) : error C2143: syntax error : missing ';' before '{' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(308) : error C2447: missing function header (old-style formal list?) d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(308) : error C2143: syntax error : missing ';' before ',' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(309) : warning C4002: too many actual parameters for macro 'DEFINE_FIELD' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(309) : error C2143: syntax error : missing ';' before '{' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(309) : error C2447: missing function header (old-style formal list?) d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(309) : error C2143: syntax error : missing ';' before ',' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(310) : error C2143: syntax error : missing ';' before '}' d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(310) : error C2143: syntax error : missing ';' before '}' Error executing cl.exe. server.dll - 24 error(s), 4 warning(s)


I can say that the engine AM: Rebirth do not get these errors when I want to implement monster_gonome (with same source code) and the compilation works fine and the result is very good

Thanks!

Отредактировано Burner 06-05-2014 в 21:03

Сообщить модератору | | IP: Записан
Сообщение: 137291

Старое сообщение 06-05-2014 22:40
- За что?
~ X ~
offline

Дата регистрации: Oct 2005
Проживает: Архангельск
Сообщений: 3619

Рейтинг



Награды
 
[1 награда]


Don't know for sure, but it appears that DEFINE_FIELD syntax is different in XashXT (which is not 100% HL-compatible by design). Look how other monsters are made in XashXT.

__________________
Минутка полезного:
Бесплатный UT-подобный Half-Life mod.
Бесплатный редактор для 32-битных текстур. Без дотнета.
Бесплатный IDE для любых компиляторов и ЯП.
Бесплатная Windows-подобная ОС.
Проверка грамматики русского языка.
Чат по hl[fx]: [email protected]

Сообщить модератору | | IP: Записан
Сообщение: 137292

Старое сообщение 07-05-2014 07:20
- За что?
Cybermax
Житель форума

Дата регистрации: May 2006
Проживает: ㅤ
Сообщений: 5126

Рейтинг



Хотите верьте хотите нет в первый момент прочитал ник топикстартера не Бюрнер а Бумер

__________________

За это сообщение Cybermax получил предупреждение за флуд

Сообщить модератору | | IP: Записан
Сообщение: 137295

Старое сообщение 07-05-2014 11:47
- За что?
 Дядя Миша
racing for fish

Дата регистрации: Oct 2005
Проживает: Кубань
Сообщений: 32202
Нанёс повреждений: 392 ед.

Рейтинг



Цитата:
Burner писал:
I tried to compile source codes from XashXT, from the last version 0.65 but I have a problem with the dimenision of compiled server.dll ...
Without editing anything inside I just tried to compile source codes to check if it compiles fine but dimension of the compiled server.dll its 3,189 kb, compared to the original server.dll wich has just 1,352 kb.
It work fine when I play...but dimension of this 2 files scares me

Probably you build dll in debug-mode.
Цитата:
Burner писал:
I tried to add monster_gonome, with this source code "gonome.cpp" but while compiling the source code I get these errors:

XashXT uses different save-restore system like in HL2. There two examples for better understanding:
Original half-life (aflock.cpp)
C++ Source Code:
1
class CFlockingFlyerFlock : public CBaseMonster
2
{
3
public:
4
  void Spawn( void );
5
  void Precache( void );
6
  void KeyValue( KeyValueData *pkvd );
7
  void SpawnFlock( void );
8
 
9
  virtual int		Save( CSave &save );
10
  virtual int		Restore( CRestore &restore );
11
  static	TYPEDESCRIPTION m_SaveData[];
12
 
13
  // Sounds are shared by the flock
14
  static  void PrecacheFlockSounds( void );
15
 
16
  int		m_cFlockSize;
17
  float	m_flFlockRadius;
18
};
19
 
20
TYPEDESCRIPTION	CFlockingFlyerFlock::m_SaveData[] =
21
{
22
  DEFINE_FIELD( CFlockingFlyerFlock, m_cFlockSize, FIELD_INTEGER ),
23
  DEFINE_FIELD( CFlockingFlyerFlock, m_flFlockRadius, FIELD_FLOAT ),
24
};
25
 
26
IMPLEMENT_SAVERESTORE( CFlockingFlyerFlock, CBaseMonster );

And XashXT (aflock.cpp)
C++ Source Code:
1
class CFlockingFlyerFlock : public CBaseMonster
2
{
3
  DECLARE_CLASS( CFlockingFlyerFlock, CBaseMonster );
4
public:
5
  void Spawn( void );
6
  void Precache( void );
7
  void KeyValue( KeyValueData *pkvd );
8
  void SpawnFlock( void );
9
 
10
  DECLARE_DATADESC();
11
 
12
  // Sounds are shared by the flock
13
  static  void PrecacheFlockSounds( void );
14
 
15
  int		m_cFlockSize;
16
  float	m_flFlockRadius;
17
};
18
 
19
BEGIN_DATADESC( CFlockingFlyerFlock )
20
DEFINE_FIELD( m_cFlockSize, FIELD_INTEGER ),
21
DEFINE_FIELD( m_flFlockRadius, FIELD_FLOAT ),
22
END_DATADESC()

And if you use Xash3D you should change the modinfo on MODDB
http://www.moddb.com/mods/the-volcano

__________________
My Projects: download page

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

Цитата:

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

Сообщить модератору | | IP: Записан
Сообщение: 137299

Старое сообщение 07-05-2014 12:34
-
Burner
Новичок

Дата регистрации: Apr 2014
Проживает: Craiova
Сообщений: 10
Возраст: 29

Рейтинг



Цитата:
~ X ~ писал:
Don't know for sure, but it appears that DEFINE_FIELD syntax is different in XashXT (which is not 100% HL-compatible by design). Look how other monsters are made in XashXT.


Yep...

Цитата:
Cybermax писал:
Хотите верьте хотите нет в первый момент прочитал ник топикстартера не Бюрнер а Бумер


I said that I don't know Russian language ...but thanks for help!


Цитата:
Дядя Миша писал:
Probably you build dll in debug-mode.


Hmm... possible, it would be something bad for .dll compiled file?

Цитата:
Дядя Миша писал:
XashXT uses different save-restore system like in HL2. There two examples for better understanding:


Yes...I got it, this must be, thank you verry much!

Цитата:
Дядя Миша писал:
And if you use Xash3D you should change the modinfo on MODDB


Oh...of course I put, sorry for dealy but I said to launch this news with some new stuffs... but don't worry, everybody will know that I work on XashXD!

Сообщить модератору | | IP: Записан
Сообщение: 137311

Старое сообщение 07-05-2014 14:46
- За что?
CRxTRDude
Dude extraordinare

Дата регистрации: Apr 2014
Проживает: (void)
Сообщений: 46
Возраст: 31

Рейтинг



Цитата:
Дядя Миша писал:
XashXT uses different save-restore system like in HL2.


I did realize that also when I tried HL SDK tutorials on the internet, that did reduce the amount of coding you do when you save and restore message calling in the dlls though.

BTW, I know that not all code in the Source SDK are implemented in Xash, right?

__________________
CRxTRDude
-----------------------
Nikki Shore blog / XashXT Cookbook (CSM)

Сообщить модератору | | IP: Записан
Сообщение: 137313

Старое сообщение 07-05-2014 14:47
- За что?
 Дядя Миша
racing for fish

Дата регистрации: Oct 2005
Проживает: Кубань
Сообщений: 32202
Нанёс повреждений: 392 ед.

Рейтинг



Цитата:
Burner писал:
Hmm... possible, it would be something bad for .dll compiled file?

Get a more perfomance in Release mode.
Цитата:
Burner писал:
Oh...of course I put, sorry for dealy but I said to launch this news with some new stuffs...

No problem
Цитата:
CRxTRDude писал:
BTW, I know that not all code in the Source SDK are implemented in Xash, right?

No. Save\Restore System only. All other code is very close to original HL SDK. At least on the server-side.

__________________
My Projects: download page

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

Цитата:

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

Сообщить модератору | | IP: Записан
Сообщение: 137315

Старое сообщение 07-05-2014 15:11
-
CRxTRDude
Dude extraordinare

Дата регистрации: Apr 2014
Проживает: (void)
Сообщений: 46
Возраст: 31

Рейтинг



Oh, okay. Thanks about that.

__________________
CRxTRDude
-----------------------
Nikki Shore blog / XashXT Cookbook (CSM)

Сообщить модератору | | IP: Записан
Сообщение: 137317

Старое сообщение 07-05-2014 15:32
- За что?
Burner
Новичок

Дата регистрации: Apr 2014
Проживает: Craiova
Сообщений: 10
Возраст: 29

Рейтинг



This problem with "gonome.cpp" was solved largely, but still get 3 errors ... I changed that save-restore system like in XashXT engine...

--------------------Configuration: server - Win32 Debug--------------------
Compiling...
gonome.cpp
d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(107) : error C2664: 'UTIL_SetOrigin' : cannot convert parameter 1 from 'struct entvars_s *' to 'class CBaseEntity *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(302) : error C2509: 'GetDataDescMap' : member function not declared in 'CGonome'
d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(187) : see declaration of 'CGonome'
d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(302) : error C2509: 'GetBaseMap' : member function not declared in 'CGonome'
d:\games\the volcano\volcano\devkit\source_code\volcano\server\gonome.cpp(187) : see declaration of 'CGonome'
Error executing cl.exe.

gonome.obj - 3 error(s), 0 warning(s)


And here, is modified "gonome.cpp"


I have no idea what they are, I must say I am beginner in programming

Сообщить модератору | | IP: Записан
Сообщение: 137318

Старое сообщение 07-05-2014 15:33
- За что?
CRxTRDude
Dude extraordinare

Дата регистрации: Apr 2014
Проживает: (void)
Сообщений: 46
Возраст: 31

Рейтинг



I saw some error like that when I was compiling old HL SDK tutorial stuff as well, you need to examine other monster codes carefully and reincorporate their code. It's not just in the public declaration that you need to rewrite as well.

By public declaration, i mean the part in CBaseMonster.

I say, look further down from the declaration on the other monster codes. I'll try to find where.


EDIT: Nevermind, this is not a problem in save/restore. That's from the code:

C++ Source Code:
UTIL_SetOrigin( [u]pGSpit->pev[/u], vecStart );


Specifically, in where I underlined it.

It's a problem that is more than I can handle though. I still couldn't understand about the pev thing.

__________________
CRxTRDude
-----------------------
Nikki Shore blog / XashXT Cookbook (CSM)

Отредактировано CRxTRDude 07-05-2014 в 15:53

Сообщить модератору | | IP: Записан
Сообщение: 137320

Старое сообщение 07-05-2014 15:39
- За что?
Burner
Новичок

Дата регистрации: Apr 2014
Проживает: Craiova
Сообщений: 10
Возраст: 29

Рейтинг



Цитата:
CRxTRDude писал:
you need to examine other monster codes carefully and reincorporate their code


yes, this would indeed be an good idea :-?

Сообщить модератору | | IP: Записан
Сообщение: 137321

Старое сообщение 07-05-2014 15:45
- За что?
CRxTRDude
Dude extraordinare

Дата регистрации: Apr 2014
Проживает: (void)
Сообщений: 46
Возраст: 31

Рейтинг



Check my edited post. This is not a problem in the save/load.

But just to be sure that you didn't miss, check the monster code. You'll never know, you might just found what you're looking for in there.

__________________
CRxTRDude
-----------------------
Nikki Shore blog / XashXT Cookbook (CSM)

Сообщить модератору | | IP: Записан
Сообщение: 137322

Старое сообщение 07-05-2014 15:53
- За что?
Burner
Новичок

Дата регистрации: Apr 2014
Проживает: Craiova
Сообщений: 10
Возраст: 29

Рейтинг



Цитата:
CRxTRDude писал:

Uh, ok...let me check this :-?

Edit: If I block this line :
C++ Source Code:
//UTIL_SetOrigin( pGSpit->pev, vecStart );
that error disappear, but i don't know if it is recommended...

Отредактировано Burner 07-05-2014 в 16:11

Сообщить модератору | | IP: Записан
Сообщение: 137323

Старое сообщение 07-05-2014 16:04
- За что?
 Дядя Миша
racing for fish

Дата регистрации: Oct 2005
Проживает: Кубань
Сообщений: 32202
Нанёс повреждений: 392 ед.

Рейтинг



1. replace UTIL_SetOrigin( pGSpit->pev, vecStart ); with UTIL_SetOrigin( pGSpit, vecStart ); like in SOHL mod.
2. may be you forget about DECLARE_DATADESC(); ?

Добавлено 07-05-2014 в 20:35:

PS. And i recommend replace all pev->origin with GetAbsOrigin(), pev->angles with GetAbsAngles() and pev->velocity with GetAbsvelocity() but this is optional for monsters.

__________________
My Projects: download page

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

Цитата:

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

Сообщить модератору | | IP: Записан
Сообщение: 137326

Старое сообщение 07-05-2014 16:35
-
Burner
Новичок

Дата регистрации: Apr 2014
Проживает: Craiova
Сообщений: 10
Возраст: 29

Рейтинг



Lol...finally... problem solved

I forgot to declare CGonome like CGonomeSpit...

CGonomeSpit

C++ Source Code:
1
class CGonomeSpit : public CBaseEntity
2
{
3
  DECLARE_CLASS( CGonomeSpit, CBaseMonster );
4
public:
5
  void Spawn( void );
6
 
7
  static void Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity );
8
  void Touch( CBaseEntity *pOther );
9
  void EXPORT Animate( void );
10
 
11
  DECLARE_DATADESC();
12
 
13
  int  m_maxFrame;
14
};


CGonome
C++ Source Code:
1
class CGonome : public CBaseMonster
2
{
3
  DECLARE_CLASS( CGonome, CBaseMonster );
4
public:
5
  void Spawn( void );
6
  void Precache( void );
7
  void SetYawSpeed( void );
8
  int  ISoundMask( void );
9
  int  Classify ( void );
10
  void HandleAnimEvent( MonsterEvent_t *pEvent );
11
  void IdleSound( void );
12
  void PainSound( void );
13
  void DeathSound( void );
14
  void AlertSound ( void );
15
  void AttackSound( void );
16
  void StartTask ( Task_t *pTask );
17
  void RunTask ( Task_t *pTask );
18
  BOOL CheckRangeAttack1 ( float flDot, float flDist );
19
  void RunAI( void );
20
  Schedule_t *GetSchedule( void );
21
  Schedule_t *GetScheduleOfType ( int Type );
22
  int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
23
  int IRelationship ( CBaseEntity *pTarget );
24
  int IgnoreConditions ( void );
25
  MONSTERSTATE GetIdealState ( void );
26
 
27
  int	Save( CSave &save );
28
  int Restore( CRestore &restore );
29
 
30
  static const char *pAttackSounds[];
31
  static const char *pIdleSounds[];
32
  static const char *pAlertSounds[];
33
  static const char *pPainSounds[];
34
  static const char *pAttackHitSounds[];
35
  static const char *pAttackMissSounds[];
36
 
37
  DECLARE_DATADESC();


But when I rebuild all, I get another 3 errors to go and i have no idea how to solve them

Linking...
Creating library ..\temp\server\!release/server.lib and object ..\temp\server\!release/server.exp
gonome.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CGonome::Restore(class CRestore &)" (?Restore@CGonome@@UAEHAAVCRestore@@@Z)
gonome.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CGonome::Save(class CSave &)" (?Save@CGonome@@UAEHAAVCSave@@@Z)
..\temp\server\!release/server.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

server.dll - 3 error(s), 0 warning(s)

Добавлено 07-05-2014 в 23:39:

Edit : Solved...I forgot to delete this 2 lines

C++ Source Code:
virtual int		Save( CSave &save );
virtual int		Restore( CRestore &restore );


Thank you verry much guys for help!

Отредактировано Burner 07-05-2014 в 18:13

Сообщить модератору | | IP: Записан
Сообщение: 137328

Старое сообщение 07-05-2014 19:39
- За что?
Тема: (Опционально)
Ваш ответ:



Переводчик транслита


[проверить длину сообщения]
Опции: Автоматическое формирование ссылок: автоматически добавлять [url] и [/url] вокруг интернет адресов.
Уведомление по E-Mail: отправить вам уведомление, если кто-то ответил в тему (только для зарегистрированных пользователей).
Отключить смайлики в сообщении: не преобразовывать текстовые смайлики в картинки.
Показать подпись: добавить вашу подпись в конец сообщения (только зарегистрированные пользователи могут иметь подписи).

Временная зона GMT. Текущее время 22:41. Новая тема    Ответить
Страницы (2): [1] 2 »   Предыдущая тема   Следующая тема
HLFX.Ru Forum HLFX.Ru Forum > Разработка игр > Наши проекты > XashXT > Problem with compiling server.dll
Версия для печати | Отправить тему по E-Mail | Подписаться на эту тему

Быстрый переход:
Оцените эту тему:

Правила Форума:
Вы not можете создавать новые темы
Вы not можете отвечать в темы
Вы not можете прикреплять вложения
Вы not можете редактировать ваши сообщения
HTML Код ВЫКЛ
vB Код ВКЛ
Смайлики ВКЛ
[IMG] Код ВКЛ
 

< Обратная связь - HLFX.ru >

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