HLFX.Ru Forum Страницы (2): [1] 2 »
Показать все 20 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- XashXT (https://hlfx.ru/forum/forumdisplay.php?forumid=30)
-- Problem with compiling server.dll (https://hlfx.ru/forum/showthread.php?threadid=4388)


Отправлено Burner 06-05-2014 в 22:40:

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!


Отправлено ~ X ~ 07-05-2014 в 07:20:

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]


Отправлено Cybermax 07-05-2014 в 11:47:

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

__________________


Отправлено Дядя Миша 07-05-2014 в 12:34:

Цитата:
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'


Отправлено Burner 07-05-2014 в 14:46:

Цитата:
~ 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!


Отправлено CRxTRDude 07-05-2014 в 14:47:

Цитата:
Дядя Миша писал:
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)


Отправлено Дядя Миша 07-05-2014 в 15:11:

Цитата:
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'


Отправлено CRxTRDude 07-05-2014 в 15:32:

Oh, okay. Thanks about that.

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


Отправлено Burner 07-05-2014 в 15:33:

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


Отправлено CRxTRDude 07-05-2014 в 15:39:

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)


Отправлено Burner 07-05-2014 в 15:45:

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


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


Отправлено CRxTRDude 07-05-2014 в 15:53:

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)


Отправлено Burner 07-05-2014 в 16:04:

Цитата:
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...


Отправлено Дядя Миша 07-05-2014 в 16:35:

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'


Отправлено Burner 07-05-2014 в 19:39:

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!


Временная зона GMT. Текущее время 13:58. Страницы (2): [1] 2 »
Показать все 20 сообщений этой темы на одной странице

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