.:: 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
entity origin?
Old
  (#1)
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 entity origin? - 24-01-2005

Okay, I have an edict_t pointer.

edict_t *pEdict;

It can be anything, a player OR not. How can I determine the entity's origin ? I tried pEdict->GetCollideable()->GetCollisionOrigin() but that doesn't seem to be it. I know how to do it for players (although it seems to be the feet origin, watch the bbmin and bbmax), but does that mean that the new entities have no "origin" anymore ?

Accessorily, one second question: with this new engine, is the edict_t pointer still the best way to keep track of an entity ?



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: entity origin?
Old
  (#2)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: entity origin? - 24-01-2005

I used this

PHP Code:
 Vector entityOrigin edict_t *pEntity )
{
    static 
float *fOrigin;
    
    
fOrigin pEntity->GetIServerEntity()->GetNetworkable()->GetPVSInfo()->m_vCenter;

    return 
Vector(fOrigin[0],fOrigin[1],fOrigin[2]);

assuming that you're in a network game (since it reads it's networkable object)
  
Reply With Quote
Re: entity origin?
Old
  (#3)
SteveC
Member
 
Status: Offline
Posts: 37
Join Date: Jan 2005
Location: UK
Default Re: entity origin? - 24-01-2005

I have found that not all entities work in the same way, much like you say the entity collision origin doesn't quite seem right all the time. But for 'box' like entities e.g. the bomb_zone entity, the line
Quote:
pEdict->GetCollideable()->WorldSpaceSurroundingBounds(&vMins, &vMaxs);
Works well.
If it returns vMins==vMaxs then the ->GetCollisionOrigin() is normally correct.

As to traking an entity, I don't know, especailly for 'created' entities. For map entities I just keep track of them in the list passed here, which seems to work so far;
Quote:
void CSCBotPlugin::ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
  
Reply With Quote
Re: entity origin?
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: entity origin? - 25-01-2005

thanks a lot both of you, that seems to work indeed. I find it weird to need to navigate through completely different classes to get the info I want, especially Cheeseh's PVS kludge... wow. Scary. Now on for the cleanest way to draw beams...



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: entity origin?
Old
  (#5)
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: entity origin? - 25-01-2005

ok, great.

Now does any of you know how to SET an entity's origin ? (teleporting a player). There's something related to props, but it looks scary and I don't want to include 50 header files again

Am I missing a simple way ?



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: entity origin?
Old
  (#6)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: entity origin? - 25-01-2005

Did you try looking at the teleporter code? trigger_teleport


sfx1999.postcount++
  
Reply With Quote
Re: entity origin?
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: entity origin? - 25-01-2005

They use SetAbsoluteOrigin on a CBaseEntity. The thing is, I don't WANT to access CBaseEntity, because it's mod specific.



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: entity origin?
Old
  (#8)
SteveC
Member
 
Status: Offline
Posts: 37
Join Date: Jan 2005
Location: UK
Default Re: entity origin? - 25-01-2005

Keep looking, but don't rule out CBaseEntity. If a mod were to change this then a lot of other things would need to change. CBasePlayer on the other hand... well even I'm avoiding it at all costs.
  
Reply With Quote
Re: entity origin?
Old
  (#9)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: entity origin? - 25-01-2005

you might be able to do it through the new infoplayermanager interface (it has since been updated too along with the new bot stuff)
edit: -- ok no!

You can teleport a bot using it's "bot controller" object though

Last edited by Cheeseh; 25-01-2005 at 22:13..
  
Reply With Quote
Re: entity origin?
Old
  (#10)
pinworm
Member
 
Status: Offline
Posts: 3
Join Date: Jul 2007
Default Re: entity origin? - 11-07-2007

has anyone found a solution to this problem, it doesnt seem like u can change players location thru a plugin?
  
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