.:: 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
How to make my bots to work with metamod
Old
  (#1)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,619
Join Date: Jul 2004
Location: Bulgaria
Default How to make my bots to work with metamod - 18-10-2004

Hi all I'm the new bot coder of E[POD]bot and I need of some help.
I won to make the bots metamod completeble.Please someone to help me with that think.
  
Reply With Quote
Re: How to make my bots to work with metamod
Old
  (#2)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: How to make my bots to work with metamod - 19-10-2004

it's simple. just compare the HPB bot 4.0 vs. HPB bot 3.0
  
Reply With Quote
Re: How to make my bots to work with metamod
Old
  (#3)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,619
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to make my bots to work with metamod - 19-10-2004

Quote:
Originally Posted by Whistler
it's simple. just compare the HPB bot 4.0 vs. HPB bot 3.0
More information plese ???
  
Reply With Quote
Re: How to make my bots to work with metamod
Old
  (#4)
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: How to make my bots to work with metamod - 19-10-2004

First you need to understand well how a game DLL (like a bot DLL) works. What are the engine functions, what are the DLL functions, and which ones are internal functions the developer has added to make his programming easy. You also need to understand perfectly how the function interfacing is done between the HL engine and its game DLL.

Heavily simplified, engine functions are those in engine.cpp that start with "pfn". And DLL functions are those in dll.cpp that start with "pfn" too. They start with "pfn" because it stands for Pointer to FuNction. In a normal game DLL, these functions MUST be present.

In a metamod DLL, these functions need not be present if you don't use them (like, you don't need functions like pfnPlayerPostThink() or about 80% of the functions of the engine interface and the DLL interface, since you don't add code of yours in them). Metamod enables us to declare what functions we want to use in a struct, and throw the rest to oblivion.

The main difference also, is that at the end of a metamod-called game function, you don't call the other side of the interface like we would do in a normal DLL - example : (*g_engfuncs.pfnStartFrame) (); instead you let metamod do this for you. To do this use the macro RETURN_META (). Read up the metamod docs to understand what these macros do and how to use them right.

If you want to be quickstarted, download one of my simple plugins from the filebase and hack it away until you understand how it works. Notice the correspondence between game functions (like StartFrame) and their slot in GetEntityAPI2() and GiveFnptrsToDll(). You have to declare which functions you use there, before you can use them.

Anyway, don't forget to RTFM.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: How to make my bots to work with metamod
Old
  (#5)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,619
Join Date: Jul 2004
Location: Bulgaria
Default Re: How to make my bots to work with metamod - 20-10-2004

Thank you PMB but I won to ask you is there a way to make the bots to load metamod.dll instead of mp.dll if it exists(like your bots RACC).
  
Reply With Quote
Re: How to make my bots to work with metamod
Old
  (#6)
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: How to make my bots to work with metamod - 20-10-2004

oh, sure...

just do a test to see whether the metamod DLL exists, and if it does, load it instead of your mod's game DLL. That's all there is.

But I would highly recommend to make the bot a real metamod plugin instead. It's not that difficult, really.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: How to make my bots to work with metamod
Old
  (#7)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: How to make my bots to work with metamod - 21-10-2004

that's even more easy.
you can just cut'n'paste the GiveFnptrsToDll() function from RACC
but I think LightNinja has already done this. However he has commented it out. Just take a look at the GiveFnptrsToDll() function.
  
Reply With Quote
Reply


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

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