![]() |
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 !! |
All times are GMT +2. The time now is 14:53. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.