.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   its driving me nuts ! (http://forums.bots-united.com/showthread.php?t=3310)

Rifleman 01-01-2005 12:34

its driving me nuts !
 
Please tell me among these stuff , which is needed in order the game to run properly (both listen server & hlds) , I have try commented some but it crash the game horribly ... Please help me if you know ! And its for hl1

Code:

pFunctionTable->pfnGameInit = GameDLLInit;
pFunctionTable->pfnSpawn = DispatchSpawn;
pFunctionTable->pfnThink = DispatchThink;
pFunctionTable->pfnUse = DispatchUse;
pFunctionTable->pfnTouch = DispatchTouch;
pFunctionTable->pfnBlocked = DispatchBlocked;
pFunctionTable->pfnKeyValue = DispatchKeyValue;
pFunctionTable->pfnSave = DispatchSave;
pFunctionTable->pfnRestore = DispatchRestore;
pFunctionTable->pfnSetAbsBox = DispatchObjectCollisionBox;
pFunctionTable->pfnSaveWriteFields = SaveWriteFields;
pFunctionTable->pfnSaveReadFields = SaveReadFields;
pFunctionTable->pfnSaveGlobalState = SaveGlobalState;
pFunctionTable->pfnRestoreGlobalState = RestoreGlobalState;
pFunctionTable->pfnResetGlobalState = ResetGlobalState;
pFunctionTable->pfnClientConnect = ClientConnect;
pFunctionTable->pfnClientDisconnect = ClientDisconnect;
pFunctionTable->pfnClientKill = ClientKill;
pFunctionTable->pfnClientPutInServer = ClientPutInServer;
pFunctionTable->pfnClientCommand = ClientCommand;
pFunctionTable->pfnClientUserInfoChanged = ClientUserInfoChanged;
pFunctionTable->pfnServerActivate = ServerActivate;
pFunctionTable->pfnServerDeactivate = ServerDeactivate;
pFunctionTable->pfnPlayerPreThink = PlayerPreThink;
pFunctionTable->pfnPlayerPostThink = PlayerPostThink;
pFunctionTable->pfnStartFrame = StartFrame;
pFunctionTable->pfnParmsNewLevel = ParmsNewLevel;
pFunctionTable->pfnParmsChangeLevel = ParmsChangeLevel;
pFunctionTable->pfnGetGameDescription = GetGameDescription;
pFunctionTable->pfnPlayerCustomization = PlayerCustomization;
pFunctionTable->pfnSpectatorConnect = SpectatorConnect;
pFunctionTable->pfnSpectatorDisconnect = SpectatorDisconnect;
pFunctionTable->pfnSpectatorThink = SpectatorThink;
pFunctionTable->pfnSys_Error = Sys_Error;
pFunctionTable->pfnPM_Move = PM_Move;
pFunctionTable->pfnPM_Init = PM_Init;
pFunctionTable->pfnPM_FindTextureType = PM_FindTextureType;
pFunctionTable->pfnSetupVisibility = SetupVisibility;
pFunctionTable->pfnUpdateClientData = UpdateClientData;
pFunctionTable->pfnAddToFullPack = AddToFullPack;
pFunctionTable->pfnCreateBaseline = CreateBaseline;
pFunctionTable->pfnRegisterEncoders = RegisterEncoders;
pFunctionTable->pfnGetWeaponData = GetWeaponData;
pFunctionTable->pfnCmdStart = CmdStart;
pFunctionTable->pfnCmdEnd = CmdEnd;
pFunctionTable->pfnConnectionlessPacket = ConnectionlessPacket;
pFunctionTable->pfnGetHullBounds = GetHullBounds;
pFunctionTable->pfnCreateInstancedBaselines = CreateInstancedBaselines;
pFunctionTable->pfnInconsistentFile = InconsistentFile;


And yes , for HPB_template 4.0 :)

Whistler 01-01-2005 12:40

Re: its driving me nuts !
 
look at engine.cpp and see which function actually has code

Rifleman 01-01-2005 12:43

Re: its driving me nuts !
 
I have already cleaned the engine.cpp , this one is for dll.cpp , I comment all functions that does not have any code inside , but when I try to run the game , swds.dll crashes ...

[EDIT]
This is what I left ...

Code:

pFunctionTable->pfnGameInit = GameDLLInit;
pFunctionTable->pfnSpawn = DispatchSpawn;
pFunctionTable->pfnClientConnect = ClientConnect;
pFunctionTable->pfnClientDisconnect = ClientDisconnect;
pFunctionTable->pfnClientPutInServer = ClientPutInServer;
pFunctionTable->pfnClientCommand = ClientCommand;
pFunctionTable->pfnStartFrame = StartFrame;

[/EDIT]

Whistler 01-01-2005 13:54

Re: its driving me nuts !
 
none of these hooks are "required" to make the game run. if the hlds.dll crashes, I'm sure it's bacause of something else

Rifleman 02-01-2005 09:05

Re: its driving me nuts !
 
no , when I uncommented the other functions , the game runs like normal

botman 02-01-2005 15:56

Re: its driving me nuts !
 
ALL of them are required to be in the table, since you can't pass only PART of the table to the game DLL code.

You CAN however, copy the contents (function pointers) of the original table into your hooked DLLs version of the table and simply replace the ones you want to override, but you can't just comment out some of them and leave that slot in the table empty.

botman

Pierre-Marie Baty 02-01-2005 15:57

Re: its driving me nuts !
 
Well there are 2 situations.
If your bot is a metamod plugin, you only need to hook the functions for which you want to do something.
If your bot is NOT a metamod plugin, you need to hook ALL the functions from both interfaces, whether you do something in them OR NOT. If you forget one, your game will crash sooner or later.

*edit*
argh, botman fired before me again. This town is too small for two, cowboy :D

Whistler 03-01-2005 11:02

Re: its driving me nuts !
 
I don't think so, as if we don't modify that slot of function, at the last it will just pass the original one in the engine to the game dll.
the "pengFuncsFromEngine" is the one which is passed from the engine as a parameter of this function


All times are GMT +2. The time now is 18:58.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.