![]() |
send debug to HUD text?
Hi guys
I noticed on some debug screenshots of some bots (especially JoeBot XP) that some of you were sending debug text to the HUD instead of the server console or the chat area. Currently when I want to see debug messages in game about my bots I send them all to the chat area but when I want to send a lot of text all the stuff starts scrolling up and I can't see anything :( What I saw on a JoeBot debug screenshot for example was quite amazing, there was a lot of text (with different colors), left/top aligned, some of it right aligned in the bottom of the screen, some of it centered, and every debug message had its location and was not overlapping another. I am utterly jealous! How do you guys do that ? I know how to send hudtextparms_t text to the HUD, but it's text that fades in and fades out, and I need to send it continuously if I want it to stay on the screen (and if I do that, it looks unclean). And although I can imagine how to split the screen coordinates into lines and coulumns I'm clueless on how to make it right-aligned or things like that. Any hint ? |
Re: send debug to HUD text?
The csstats module to Amx mod displays three boxes of different colored text in different locations on the screen when you die. It looks nice and is very readable.
The csstats mm plugin source is small. I don't think it would take you long to find the code that does this! http://sourceforge.net/projects/amxmod/ |
Re: send debug to HUD text?
it's just the normal hudparams_t stuff, like done in almost every bot to display welcome messages, birthday notifications, whatever :D
or are you referring to the picture below ? that's done with a new clientmessage - unfortunately only possible with hldm or any other open source mod :) but I think you know that ... somehow I didnt get your point I think ... http://joebot.bots-united.com/images...oebotxp005.jpg |
Re: send debug to HUD text?
|
Re: send debug to HUD text?
Thanks Austin, I'll give it a look :)
@Joe: a new network message ? I didn't know that. Clever ! Anyway I knew the basics about the hudtextparms stuff, but I'd want to know, is all that hudtextparms text on your picture a text that appears continuously during the game (being updated if necessary) or just a fixed text that is sent on request, fades in, stays a few second and fades out like a dumb welcome message? *EDIT* I checked your plugin, Austin, and the AMX plugins are written in Small, and they call functions in the AMX API that are completely different from the HL engine functions or the metamod API. The source code is of no use for me :( Joe, my dear Joe, my old friend Joe, may I dare to request to have a vvveryqik' look at the "normally closed" joebot XP source code that you use for displaying your stuff ? 9_9 |
Re: send debug to HUD text?
ah no pierre, that's totally secret code ...
Code:
that is pretty similar to the code in old joebot, it looks like I just copied it ... cause it's not yet incorporated in my game class ... and the client message idea was once again not mine, but killarunas .... |
Re: send debug to HUD text?
3 Attachment(s)
Hmm I just made something neat :)
I made a few classes so you can display text like the way you can do with cout. For example: Code:
rcout << "Max speed: " << bots[NearestBotInd].f_max_speed << "\n"; You can use it by adding(and adapting) the files in your project, then declare something like this in a file like dll.cpp: Code:
CBaseOutput cout; |
Re: send debug to HUD text?
sweet Rick, this is exactly what I need. You save me a lot of trouble, thanks a lot ! :)
...I will soon end up with more lines of credit than lines of code in this bot actually :D |
Re: send debug to HUD text?
No problem :)
I only never tested the coords with other resolutions then 1024*768. So you might have to change that. [EDIT] Seems i might forgot something to mention... You should call the display() function each frame. Like I do have in StartFrame: Code:
cout.Display(); |
Re: send debug to HUD text?
Can anyone provide any reference, or just the info, on how x/y applies the HUD ?
e.g. where is (x,y) = (0.0, 0.0) located (top left corner? top right corner? center?) What scale are the x, y stored in ( is it up to 1.0 for each, from -1.0 to 1.0, from 0.0 to 10,000.. ?) How does different resolution affect above ? Thanks in advance for any info !! |
Re: send debug to HUD text?
(0, 0) is the top left corner ; (-1, -1) is the center of the screen. For the rest I don't know exactly...
|
Re: send debug to HUD text?
To post a reply to my own question, just in case ..
think of x, y instead of coordinates, as a tri-state variable on the horizontal, 1 'right-align' the text 0 'left-align' the text -1 'center' the text (horizontally) and for the vertical: 1 'bottom' align the text 0 'top-align' the text -1 'center' the text (vertically) thanks for the basis ! |
Re: send debug to HUD text?
|
Re: send debug to HUD text?
what are the x/y values for each of those lil areas you're out'ing to ?
or are you just out'ing to each of the 9 'points' and spacing out with carriage returns ? also, have you found a max limit on the string that can be passed down here? Thanks in advance for any info ! :) |
Re: send debug to HUD text?
I just tried some values with a console command with my texts....and the limit for each frame is 512 bytes I think. Sometimes I had more and a msg box poped up saying that the text message was overflowed before it had end :)
|
Re: send debug to HUD text?
Actually you can only display 3 HUD texts at once (with different colors, different texts, at different locations). If you try to display more simultaneously, the oldest ones will disappear from the screen.
The maximum text length for a HUD text is 512 characters. To display text like in the picture, I use 3 channels, left, right and center, and I compose the text by adding carriage returns when needed. The X/Y values for the 3 channels are: left: 0, 0 middle: -1, 0 right: 1, 0 Inside the WRITE_SHORT()'s of the message, this gives: left: 0, 0 middle: -8192, 0 right 8192, 0 |
All times are GMT +2. The time now is 22:59. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.