.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 2 SDK (http://forums.bots-united.com/forumdisplay.php?f=62)
-   -   HL2SDK: getting access to CBasePlayer (http://forums.bots-united.com/showthread.php?t=4880)

BotUser 21-01-2006 01:27

HL2SDK: getting access to CBasePlayer
 
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

DrEvil 04-02-2006 22:01

Re: HL2SDK: getting access to CBasePlayer
 
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.

BotUser 11-02-2006 19:34

Re: HL2SDK: getting access to CBasePlayer
 
Great! :unsure:

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

DrEvil 13-02-2006 23:24

Re: HL2SDK: getting access to CBasePlayer
 
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.

BotUser 16-02-2006 00:52

Re: HL2SDK: getting access to CBasePlayer
 
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 !

Austin 26-02-2006 02:43

Re: HL2SDK: getting access to CBasePlayer
 
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!

DrEvil 27-02-2006 13:14

Re: HL2SDK: getting access to CBasePlayer
 
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

Austin 28-02-2006 06:38

Re: HL2SDK: getting access to CBasePlayer
 
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.


All times are GMT +2. The time now is 05:42.

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