.:: 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 > SDK Programming discussions > Half-Life 2 SDK
Half-Life 2 SDK For developments focused around the Half-Life 2 engine Half-Life 2

Reply
 
Thread Tools
HL2SDK: getting access to CBasePlayer
Old
  (#1)
BotUser
Member
 
Status: Offline
Posts: 39
Join Date: Jun 2004
Default HL2SDK: getting access to CBasePlayer - 21-01-2006

Hi,

I've been out of the loop for quite some while now with regard to the HL2 SDK.
I still have some old sources of a server plugin loitering around on my disk. To get access to CBasePlayer, I applied a hack quite common back then:

#define GAME_DLL 1
#include "cbase.h"
#include "networkvar.h"

and included networkvar.cpp to the project to make it link.

This worked up to some point when CS Source and the SDK got updated and all this broke.

Could somebody provide me some directions on how to properly access CBasePlayer in the current HL2 SDK ?

Thank you

BotUser
  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#2)
DrEvil
Member
 
DrEvil's Avatar
 
Status: Offline
Posts: 142
Join Date: Jan 2004
Location: Los Angeles, CA
Default Re: HL2SDK: getting access to CBasePlayer - 04-02-2006

You're not suppose to be able to access CBasePlayer from a plugin. It might work for a fresh server plugin and a clean hl2dm mod, but many mods add stuff to their player classes that would change the class memory footprint and make your server plugins representation all wrong from the actual representation, pretty much guaranteed to crash.


Omni-bot AI framework
http://www.omni-bot.com

Foxbot - for Team Fortress Classic
http://www.foxbot.net


  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#3)
BotUser
Member
 
Status: Offline
Posts: 39
Join Date: Jun 2004
Default Re: HL2SDK: getting access to CBasePlayer - 11-02-2006

Great!

So, how are we supposed to modify entity properties then ? if not via server plugins, how then ? Not at all or what ?!?

I'm really getting angry about this HL2 SDK. The problem of accessing base entity properties in HL2 has been around for so long, and Valve did not bother to include any interface to safely access those.
This sucks ! There's some HL1 code I wanted to make work in HL2 (CS:S),
but it seems that I can forget about that. Nice new world.

BotUser
  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#4)
DrEvil
Member
 
DrEvil's Avatar
 
Status: Offline
Posts: 142
Join Date: Jan 2004
Location: Los Angeles, CA
Default Re: HL2SDK: getting access to CBasePlayer - 14-02-2006

Yea you're right. Basically you're not suppose to have access to that stuff. HL2 castrated what was possible in HL1 via server plugins. In its place the interface server plugin system is pretty nice, but it seems very thrown together at that last minute, at least the bot interfaces exposed to the server plugin.

It's very unfortunate that a thriving bot community was basically brought to a half with HL2's limitations.


Omni-bot AI framework
http://www.omni-bot.com

Foxbot - for Team Fortress Classic
http://www.foxbot.net


  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#5)
BotUser
Member
 
Status: Offline
Posts: 39
Join Date: Jun 2004
Default Re: HL2SDK: getting access to CBasePlayer - 16-02-2006

Maybe I will go hacking and do some sigscanning to at least code some CS:S plugins for my personal use.

Man, how I loved HL1 for what you could do with it, coding-wise. Those were the times !
  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#6)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: HL2SDK: getting access to CBasePlayer - 26-02-2006

Quote:
Originally Posted by BotUser
Maybe I will go hacking and do some sigscanning to at least code some CS:S plugins for my personal use.

Man, how I loved HL1 for what you could do with it, coding-wise. Those were the times !
Have you seen the new "MetaMod for source"
http://www.sourcemod.net/forums/
It's been working super great for me.


My source server has:
Custom models for the bots.
No headshots to humans
Extra nades for humans.
A new version of stripper2 for source that is adding guns and stripping things out of the maps (using regx expressions to do the matching. cool)
Ability to switch teams for the bots/ humans in a couple of seconds.
And on and on and on....

Some would say "terrible hacking" is used to accomplish this.
For me it is a matter of
1) Being able to do what I want to do and ALREADY ENJOYING IT!
2) Waiting forever for something that will never arrive.


It works, works great and my source server almost NEVER crashes
Even when I am running 40 bots and 7 humans!
The last update did break some things but they were quickly fixed.
Woohoo fun fun fun!
  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#7)
DrEvil
Member
 
DrEvil's Avatar
 
Status: Offline
Posts: 142
Join Date: Jan 2004
Location: Los Angeles, CA
Default Re: HL2SDK: getting access to CBasePlayer - 27-02-2006

I specifically asked the metamod guys if it would provide access to what we are missing to make fully functional bots, and as I expected they said it wouldn't. Getting basic bots working with the plugin interface is very easy, but they are missing some important things that metamod doesn't even provide access to last I checked.

See this thread for more info.
http://forums.bots-united.com/showthread.php?t=3629

It even ended on a comment about MM


Omni-bot AI framework
http://www.omni-bot.com

Foxbot - for Team Fortress Classic
http://www.foxbot.net


  
Reply With Quote
Re: HL2SDK: getting access to CBasePlayer
Old
  (#8)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: HL2SDK: getting access to CBasePlayer - 28-02-2006

Yea, I didn't mean to imply you could effectively do bot development with it.
My point was it is extremely viable for plug in coding.
  
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