Thanks for the info. I realize I could do most of this in the SDK with
minimal effort, but I'd like to be able to do it in a server plugin
for mod independance, if that's not possible theres little point in
having the half-assed bot functionality in there to begin with.
I understand not giving the plugin access to CBaseEntity or global
entity list, but IBotController and/or IPlayerInfo provide methods of
getting viewangles, position, angles, so it seems logical that there
should be an accessor for velocity in there as well.
And it's very bad that IBotController::SetActiveWeapon creates a new
weapon every time it's called. Seems like the main things missing from
full bot support would be relatively trivial to add to the SDK classes
so that mods get them for free, and therefor allow server plugin bots
to be made without hacking.
1) IPlayerInfo::GetAbsVelocity()
2) Add IPlayerInfo::HasWeapon(const char *), and fix SetActiveWeapon
so that it switches to the requested weapon only if the bot has it in
their inventory. Alternatively, give some read-only access to the bots
weapon list to get the proper numbers suitable to pass as the
CBotCmd.weaponselect.
3) Add IPlayerInfo::HasItem(const char *), return true/false if player
has a specific non-weapon item. Mods could extend this to support
their specific functionality
4) Also preferably some access to arbitrary entity info, similar to
IPlayerInfo, like IEntityInfo, so I could get
position/orientation/velocity of props, projectiles,...
5) Perhaps Ammo access could be handled through an event. Something like
Event "player_addweapon"
{
"userid" (TYPE_SHORT)
"weapon" (TYPE_BYTE)
"clipamountleft" (TYPE_SHORT)
}
Maybe this could fire when a weapon is picked up to give a snap shot
of the current state of the weapons ammo, and maybe the Event
"player_shoot" event could have a "clipamountleft" (TYPE_SHORT)
added to it. Just some ideas.
1-3 and 5 would probably take valve 10-20 minutes to implement and
roll it out in the next sdk update. #4 is a bit more complex, and I
have doubts on whether they would even consider providing such access.
A bot could maybe make do without #4, at the expense of being
vulnerable to players blocking them with props, not being able to
dodge projectiles, not being able to 'see' the wall mounted
armor/health dispensers or any other non player entity.,...
I'm hoping to get valves attention and hopefully get these last
remaining accessors. They were kind enough to do a v2 of the
IPlayerInfo to give us more than what we had originally, but we're
still missing these last few things.
Pretty please ? :)
J
On 5/31/05, David Anderson <[EMAIL PROTECTED]> wrote:
> Jeremy Swigart wrote:
> > I don't see from my(admittedly limited) looking at source metamod that
> > it helps in many of the cases that I need.
>
> No, it won't. I can try to answer your questions though, in the ways
> you probably won't like :p
>
> 1) You can try to do this in a "hacky" way that relies on the base SDK.
> For example, CBaseCombatCharacter defines m_hMyWeapons in its data
> table, so you can probably extract it by enumerating the datamap or
> sendtables.
>
> 2,3) Again, velocity is defined in the datamap of CBaseEntity.
>
> 4) Valve won't do this, I guarantee it.
>
> 6) Not needed, CGameTrace/trace_t has m_pEnt which you can convert to an
> edict_t. It's defined in the Engine like that for niceness -- the
> Engine can't see CBaseEntities like the gamedll.
>
> 7) The reason: Valve doesn't want you changing them. That would be
> hacking, cheating, heresy, and terrorism. <-- add something else in for
> extra credit
>
> 8) Possibly same rule for #1-3, but in the way I've done it in my
> plugins, I used much hackier ways that aren't mod independent at all.
>
> 9) SetModel() is a virtual function in CBaseEntity. If you're pretty
> sure the mod doesn't change the virtual order of CBaseEntity, you can
> just try calling it. Otherwise, you must get creative.
>
> If you're doing this for HL2DM, you have the source code, so you can do
> just about anything you want. For other mods, you must be prepared to
> write very ugly things.
>
> Hope this helps,
>
> ---BAILOPAN
> http://www.sourcemod.net/
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders