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 |
6 | void KeyValue( KeyValueData *pkvd ); |
7 | void SpawnFlock( void ); |
9 | virtual int Save( CSave &save ); |
10 | virtual int Restore( CRestore &restore ); |
11 | static TYPEDESCRIPTION m_SaveData[]; |
13 | // Sounds are shared by the flock |
14 | static void PrecacheFlockSounds( void ); |
17 | float m_flFlockRadius; |
20 | TYPEDESCRIPTION CFlockingFlyerFlock::m_SaveData[] = |
22 | DEFINE_FIELD( CFlockingFlyerFlock, m_cFlockSize, FIELD_INTEGER ), |
23 | DEFINE_FIELD( CFlockingFlyerFlock, m_flFlockRadius, FIELD_FLOAT ), |
26 | IMPLEMENT_SAVERESTORE( CFlockingFlyerFlock, CBaseMonster ); |
And XashXT (aflock.cpp)
C++ Source Code:
1 | class CFlockingFlyerFlock : public CBaseMonster |
3 | DECLARE_CLASS( CFlockingFlyerFlock, CBaseMonster ); |
7 | void KeyValue( KeyValueData *pkvd ); |
8 | void SpawnFlock( void ); |
12 | // Sounds are shared by the flock |
13 | static void PrecacheFlockSounds( void ); |
16 | float m_flFlockRadius; |
19 | BEGIN_DATADESC( CFlockingFlyerFlock ) |
20 | DEFINE_FIELD( m_cFlockSize, FIELD_INTEGER ), |
21 | DEFINE_FIELD( m_flFlockRadius, FIELD_FLOAT ), |
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 |
3 | DECLARE_CLASS( CGonomeSpit, CBaseMonster ); |
7 | static void Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity ); |
8 | void Touch( CBaseEntity *pOther ); |
9 | void EXPORT Animate( void ); |
CGonome
C++ Source Code:
1 | class CGonome : public CBaseMonster |
3 | DECLARE_CLASS( CGonome, CBaseMonster ); |
7 | void SetYawSpeed( void ); |
8 | int ISoundMask( 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 ); |
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 ); |
27 | int Save( CSave &save ); |
28 | int Restore( CRestore &restore ); |
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[]; |
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!