Author Topic: Debug HUD?  (Read 415 times)

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Debug HUD?
« on: January 16, 2017, 10:41:29 AM »
Is D3 have an analogue of Quake 4 Debug Hud?
https://www.iddevnet.com/quake4/DebugHud

I check it and IMHO it's a simple GUI script with Code interaction.

Code: [Select]
text "gui::viewpos"
gui::physics_rotations
gui::physics_render_model_traces

Looks like C++ variables with transition to GUI script via "::".

Perhaps I saw on this forum screenshots from BFG with debugHUD alike.

Or I'm looking for how to see this part of the code.

Thanks for any information. Sorry for writing style ))
 
« Last Edit: January 16, 2017, 10:44:40 AM by bitterman »

argoon

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +21/-81
  • Doom Newbie
    • View Profile
Re: Debug HUD?
« Reply #1 on: January 16, 2017, 12:10:44 PM »
Don't know about BFG but vanilla afaik has not, it has plenty of debugging commands but not in similar .gui form like that of Quake 4, only console text/numbers and ingame special visualizations, but you could do your own has you have discovered, Quake4 Debug Hud is just a normal .gui file.

Is a petty that GUI scripting documentation/tutorials is very lacking.
« Last Edit: January 16, 2017, 12:12:15 PM by argoon »

bitterman

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: Debug HUD?
« Reply #2 on: January 21, 2017, 09:30:00 AM »
argoon thanks for advice.

Something strange is going with ID's ftp.
I hope somebody makes the mirror.

About D3: It is possible to change cvars from ingame (world) gui through choiceDef.
If you know how it can be used - let me know also ;)

Still not sure how it's working in D3 vs Q4 (expression "text "gui::somename" in GUI script).

Code: [Select]
windowDef Desktop
{
rect 0 ,0 ,640 ,480
matcolor 0.6, 0.9, 1, 0.8
visible 1

choiceDef choiceCvar
{
rect 178,199,361,82
choices "g_showHud 0;g_showHud 1"
cvar "g_showHud"
choiceType 0
font "fonts/bank"
textscale 1
textaligny 1
forecolor 0.6, 0.8, 0.8, 1
visible 1
       
         onAction
                {
// without 'onAction' we don't see cursor
}
}
}

See pics below.

About Q4: I think it's realized with code below.

gui:
Code: [Select]
text "gui::viewpos"
text "gui::version"
text "gui::entityName"

code:
Code: [Select]
// Update the current debug hud if the cvar has changed
if ( g_showDebugHud.IsModified() || !
...
// Automatically add some basic entity information
if ( focusEntity ) {
SetInt ( "entityNumber", focusEntity->entityNumber );
SetInt ( "entityHealth", focusEntity->health );
SetString ( "entityName", focusEntity->name );
SetString ( "entityClass", focusEntity->GetClassname ( ) );
}

// General map information
SetString ( "mapname", gameLocal.GetMapName ( ) );
SetString ( "version", cvarSystem->GetCVarString ( "si_version" ) );
if ( gameLocal.GetLocalPlayer() ) {
SetString ( "viewpos", gameLocal.GetLocalPlayer()->GetPhysics()->GetOrigin().ToString() );
« Last Edit: January 21, 2017, 09:47:53 AM by bitterman »

bitterman

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: Debug HUD?
« Reply #3 on: January 21, 2017, 10:01:45 AM »
For D3:

gui:
Code: [Select]
text "gui::saveGameName"

code:
Code: [Select]
guiActive->SetStateString( "saveGameName", saveName );

Note: Most SetStateString wich used by "gui::" in mainmenu GUI are located into Session_menu.cpp.
« Last Edit: January 21, 2017, 10:13:49 AM by bitterman »

argoon

  • Sr. Member
  • ****
  • Posts: 275
  • Karma: +21/-81
  • Doom Newbie
    • View Profile
Re: Debug HUD?
« Reply #4 on: January 24, 2017, 03:36:02 PM »
No problem but it was not a really usefull advice  :P sorry for that.

BTW thanks for providing that Quake 4 link to the GUI system i didn't new that even existed, the documentation on GUI editing there is much better.

Also it seams this kind of code 
Code: [Select]
set "cmd" "play guisounds_menuclickup" ; doesn't work, it doesn't play the sound just shows a message on the console.

In the other end this
Code: [Select]
localSound guisounds_menuclickup; works as intended, what I find strange is that the Doom 3 main menu code uses the previous one and it works!
« Last Edit: January 24, 2017, 03:37:59 PM by argoon »

bitterman

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: Debug HUD?
« Reply #5 on: January 28, 2017, 11:07:30 AM »
About editDef:

Looks like there is unable to use editDef in world (ingame) GUIs.

I see the edit field, a text, a blinking cursor, even a scrollbar but can't type any symbol (WASD in game is for moving, not for typing). Perhaps it's working only for menugui (mainmenu, pda).
Don't remember about takenotes.

So editDef isn't an easy way to create in game passwords, spells, locks etc. Pity.

************************ upd ****************

It may be interesting (some GUI script from Q4. Is D3 can eat this?):

Code: [Select]
rect 0,0,60 * ("gui::time_totalframe" / 100),10
« Last Edit: January 29, 2017, 04:31:42 AM by bitterman »

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: Debug HUD?
« Reply #6 on: February 04, 2017, 06:10:45 AM »
is there a way to download that file again?

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 866
  • Karma: +42/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Debug HUD?
« Reply #7 on: February 04, 2017, 08:36:07 AM »
is there a way to download that file again?

file's there, link of the wiki is wrong: to many "p"'s in "zip".  https://www.iddevnet.com/quake4/download/debug_huds.zip

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: Debug HUD?
« Reply #8 on: February 05, 2017, 02:14:37 AM »
thanks