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

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- XashXT (https://hlfx.ru/forum/forumdisplay.php?forumid=30)
-- Added the vehicle code from CS but ... (https://hlfx.ru/forum/showthread.php?threadid=4399)


Отправлено CRxTRDude 16-05-2014 в 02:25:

Added the vehicle code from CS but ...

Following the advice of Ku2zoff, I grabbed the vehicle mechanic from the CS1.6 rev-eng dll source code. I have already fixed the save-restore mechanics and edited some of the stuff that I think needs editing. Now comes the part where I have to ask again. (I'm getting a little repetitive, am I?)

I compiled the thing hoping that the code is incorporated, but it looks like I missed something here:

code:
--------------------Configuration: server - Win32 Release-------------------- Compiling... multiplay_gamerules.cpp E:\Applications\Xash Source Code\Nikki\server\multiplay_gamerules.cpp(599) : error C2065: 'CFuncVehicle' : undeclared identifier E:\Applications\Xash Source Code\Nikki\server\multiplay_gamerules.cpp(599) : error C2059: syntax error : ')' player.cpp E:\Applications\Xash Source Code\Nikki\server\player.cpp(1516) : error C2065: 'pTrain' : undeclared identifier E:\Applications\Xash Source Code\Nikki\server\player.cpp(1516) : error C2227: left of '->Classify' must point to class/struct/union E:\Applications\Xash Source Code\Nikki\server\player.cpp(1517) : error C2065: 'CFuncVehicle' : undeclared identifier E:\Applications\Xash Source Code\Nikki\server\player.cpp(1517) : error C2059: syntax error : ')' E:\Applications\Xash Source Code\Nikki\server\player.cpp(1533) : error C2059: syntax error : ')' E:\Applications\Xash Source Code\Nikki\server\player.cpp(1978) : error C2059: syntax error : ')' E:\Applications\Xash Source Code\Nikki\server\player.cpp(1987) : error C2059: syntax error : ')' func_vehicle.cpp Generating Code... Error executing cl.exe. server.dll - 9 error(s), 0 warning(s)


Apparently the code couldn't find the entity, but as you can see also, func_vehicle.cpp (where the code for the entity is) compiled just fine.

I checked out the codes from the player cpp and multiplay rules cpp since I edited them as well to incorporate the vehicle cpp to the code. All are ripped directly from the player code of the CS dll source.

C++ Source Code:
CBasePlayer *pDriver = (CBasePlayer *)((CFuncVehicle *)ktmp)->m_pDriver;


I placed the source down here in hopes that someone would see where the problem stems from. I suspected that I missed something there during my editing.

BTW, the code originally had a header, but I merged it in the cpp file because it gave errors.

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


Отправлено XaeroX 16-05-2014 в 06:01:

#include vehicle.h into multiplay_gamerules.cpp and player.cpp.

Добавлено 16-05-2014 в 13:01:

Цитата:
CRxTRDude писал:
but I merged it in the cpp

unmerge.

__________________

xaerox on Vivino


Отправлено CRxTRDude 16-05-2014 в 06:28:

Okay, so I'll unmerge what was supposed to be from the header, then I'll place includes on all what I wanted to affect? I couldn't believe I would forget something like that. Sorry bout that. I'll be going ahead and put it then. I'll edit the post if it works or not.

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


Отправлено XaeroX 16-05-2014 в 06:57:

Цитата:
CRxTRDude писал:
error C2065: 'CFuncVehicle' : undeclared identifier

You see? This means that these files are not aware of CFuncVehicle class. When you place an include at the beginning, the class definition becomes known to them, and this error will be fixed.

__________________

xaerox on Vivino


Отправлено CRxTRDude 16-05-2014 в 08:37:

Tried the code out, didn't work unfortunately. The vehicle is there, the controls is there, but when I press use, there is no hud display, it didn't gain control, didn't work. I wonder why it didn't carry over?

I edited player.cpp appropriately, added now the header file from vehicle code.


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

I modified the vehicle code based on CFuncTrackTrain from plats.cpp. It compiled good along with all the declarations to player.cpp and the rest.

I tested it with a sample map for CS from TWHL, didn't work.

I have a copy of CS 1.3 that runs on the latest Xash3D engine, placed the CS vehicle map and worked.

I have a copy of my source code for anyone interested in helping. Thanks again.


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

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