.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
its driving me nuts !
Old
  (#1)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default its driving me nuts ! - 01-01-2005

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

Last edited by Rifleman; 01-01-2005 at 13:35..
  
Reply With Quote
Re: its driving me nuts !
Old
  (#2)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: its driving me nuts ! - 01-01-2005

look at engine.cpp and see which function actually has code
  
Reply With Quote
Re: its driving me nuts !
Old
  (#3)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: its driving me nuts ! - 01-01-2005

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]

Last edited by Rifleman; 01-01-2005 at 14:00..
  
Reply With Quote
Re: its driving me nuts !
Old
  (#4)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: its driving me nuts ! - 01-01-2005

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
  
Reply With Quote
Re: its driving me nuts !
Old
  (#5)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: its driving me nuts ! - 02-01-2005

no , when I uncommented the other functions , the game runs like normal
  
Reply With Quote
Re: its driving me nuts !
Old
  (#6)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: its driving me nuts ! - 02-01-2005

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
  
Reply With Quote
Re: its driving me nuts !
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: its driving me nuts ! - 02-01-2005

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



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 02-01-2005 at 17:00..
  
Reply With Quote
Re: its driving me nuts !
Old
  (#8)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: its driving me nuts ! - 03-01-2005

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

Last edited by Whistler; 03-01-2005 at 12:07..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com