![]() |
Re: draw beam
1 Attachment(s)
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. |
Re: draw beam
Superb! Once you guys find a clean way to do that, ------------> wikiwikiwiki plz :)
|
Re: draw beam
You can get the player 'head' vector by using the Ear position, lemme search the correct line of code:
Code:
// position of ears (= eyes) 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 :D |
Re: draw beam
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 |
Re: draw beam
ah, thanks for the tip botman, that will make it easier then using an ugly timer.
|
Re: draw beam
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 ;) |
Re: draw beam
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 ?? |
Re: draw beam
heres how to get the very centre origin of any entity
Code:
Vector entityOrigin ( edict_t *pEntity ) |
Re: draw beam
w0h00! :D
* 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? |
Re: draw beam
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 ;) |
All times are GMT +2. The time now is 08:26. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.