.:: 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
Re: draw beam
Old
  (#11)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: draw beam - 02-01-2005

yay, here are some waypoints in the game, they're a bit small and fat.. still to work out the best size for them
thanks all

edit:

seems as though the origin from the "CollideOrigin" returns a vector on the players feet, thats why the waypoints were small, had to move them up from the origin.

again though this seems to only work with all players at once, no input entity. I really need to get the TempEntity interface, but doesn't seem like its possibile to get that.
Attached Thumbnails
Click image for larger version

Name:	de_cbble0001.jpg
Views:	486
Size:	97.3 KB
ID:	568  

Last edited by Cheeseh; 02-01-2005 at 16:28..
  
Reply With Quote
Re: draw beam
Old
  (#12)
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: draw beam - 02-01-2005

Superb! Once you guys find a clean way to do that, ------------> wikiwikiwiki plz



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: draw beam
Old
  (#13)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: draw beam - 03-01-2005

You can get the player 'head' vector by using the Ear position, lemme search the correct line of code:

Code:
// position of ears (= eyes)
Vector UTIL_EarPosition( edict_t *pEdict )
{ 
	Vector *v = NULL;
 
	// Get vector
	gameclients->ClientEarPosition( pEdict, v );
 
	return *v;
}
it uses botmans template, so this *should* work.

THe only thing that still fails on me, is the code in the think function to get the first human players vector, as the plugin (and startframe code) runs while starting up the server, it crashes on init or something. As somehow the playerinfo or the other info from a client is not properly inited yet and i want to access it. Perhaps with a timer But i have to do this later, i have no time now


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me

Last edited by stefanhendriks; 03-01-2005 at 15:00..
  
Reply With Quote
Re: draw beam
Old
  (#14)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: draw beam - 03-01-2005

In your server plugin, use LevelInit() and LevelShutdown() to set a global flag that indicates whether a map is running or not.

If the map hasn't been initialized yet, you can skip over everything you added in the GameFrame() function.

P.S. Note that in Half-Life2, plugins get loaded by the engine BEFORE the game actually starts running. You r plugin will be running while the Half-Life2 main menu is displayed (since the menu actually loads a small map as the "background" image).

botman
  
Reply With Quote
Re: draw beam
Old
  (#15)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: draw beam - 03-01-2005

ah, thanks for the tip botman, that will make it easier then using an ugly timer.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: draw beam
Old
  (#16)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: draw beam - 03-01-2005

i tried it, but i still needed a timer to prevent it from crashing.

EDIT:
Correction, somehow the code crashed somewhere else, though the debugger in MSVC pointed to this line where you call the engine function. But, i did not really trust it, so i did not use my own function to return this vector, but using the engine function itself. It works flawlessley, yeey, i hate timers


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me

Last edited by stefanhendriks; 03-01-2005 at 17:17..
  
Reply With Quote
Re: draw beam
Old
  (#17)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: draw beam - 03-01-2005

It would be good to get the player Max's and min's, simply set up the waypoint size to be the player size at the time of creation (e.g. when crouched the size will be smaller so we can find the right size from it, sort of...)

Or does (CollideOrigin + EarPosition)/2 = center origin ??
  
Reply With Quote
Re: draw beam
Old
  (#18)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: draw beam - 05-01-2005

heres how to get the very centre origin of any entity

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

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

Last edited by Cheeseh; 05-01-2005 at 17:11..
  
Reply With Quote
Re: draw beam
Old
  (#19)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: draw beam - 05-01-2005

w0h00!

* i also tried drawing waypoints, and i got them drawing, they are thinner and such. But somehow it only draws a few. I don't know yet how to make it draw more waypoints. It looks like as if i can draw way less wpts then in the HL1 engine?


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: draw beam
Old
  (#20)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: draw beam - 05-01-2005

It draws all the waypoints for me, I think.

I think HL might be smart and cut some out if they aren't in your field of view.

I'm using a 3d hashtable for mine to draw the waypoints nearest the player so only those in the nearest buckets to me get drawn.

ps, just edited the code above, don't need GetServerEntity() it will work just from pEntity
  
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 - 2025, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com