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

you think? i am writing the waypoint system from scratch, but i am talking about 20 wpts to be needed to be drawn. It somehow does not get drawn! here is my beam code:

Code:
void WaypointDraw(edict_t *pEdict)
{
	// When gWaypointSprite failed, try again here
	if (engine->IsModelPrecached(PHYSGUN_BEAM_SPRITE) || gWaypointSprite < 0)
	{
		// Precache sprite
		gWaypointSprite = engine->PrecacheModel(PHYSGUN_BEAM_SPRITE);
	}
	int iIndex=0;
	for (iIndex; iIndex < MAX_WAYPOINTS; iIndex++)
	{
		// every waypoint that has Vector != 0,0,0
		if (gWaypoints[iIndex].Origin != Vector(0,0,0))
		{
			// Draw beam
			//engine->
			effects->Beam(gWaypoints[iIndex].Origin + Vector(0,0,-128),
						  gWaypoints[iIndex].Origin, 
						  gWaypointSprite, 
						  0, 
						  0, 0, 10, 1, 1, 1, 0, 
						  255,255,255,255,5);
/*
				virtual void Beam( const Vector &Start, const Vector &End, int nModelIndex, 
  int nHaloIndex, unsigned char frameStart, unsigned char frameRate,
  float flLife, unsigned char width, unsigned char endWidth, unsigned char fadeLength, 
  unsigned char noise, unsigned char red, unsigned char green,
  unsigned char blue, unsigned char brightness, unsigned char speed) = 0;*/
		}
	}
}


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

could be the "fadeLength" parameter, try making it 255. Maybe make the width a bit more to see it easier too

heres what i use for drawing a waypoint (try copying the values)
Code:
	g_pEffects->Beam( m_vOrigin - Vector(0,0,WAYPOINT_HEIGHT/2), m_vOrigin + Vector(0,0,WAYPOINT_HEIGHT/2), CWaypoints::waypointTexture(), 
	0, 0, 1,
	1, WAYPOINT_WIDTH, WAYPOINT_WIDTH, 255, 
	1, 0, 0, 255, 200, 10);
the waypoint origin is in the center so i draw from -36units to + 36units
  
Reply With Quote
Re: draw beam
Old
  (#23)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: draw beam - 06-01-2005

well, ok, the width is abit thin, but i like slim wpts

i will try the fadelength.


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

okay looks as though I can't edit my old posts :'(

anyway.

this code works for bots and players and maybe even ohter entities which I havne't been able to test with yet (works with players and bots).

you may need GetIServerEntity

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]);

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

rofl, i somehow remember that you said that could be left out? well i changed it into the above code and i will try it asap.


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

yeah I thought that because it would still compile and thought it would do basically the same thing but never actually tested it. Better look before i leap
  
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