News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Debug HUD?

Started by bitterman, January 16, 2017, 10:41:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitterman

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.

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


argoon

#1
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.

bitterman

#2
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).

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:
text "gui::viewpos"
text "gui::version"
text "gui::entityName"


code:
// 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() );

bitterman

#3
For D3:

gui:
text "gui::saveGameName"


code:
guiActive->SetStateString( "saveGameName", saveName );


Note: Most SetStateString wich used by "gui::" in mainmenu GUI are located into Session_menu.cpp.

argoon

#4
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  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 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!

bitterman

#5
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?):

rect 0,0,60 * ("gui::time_totalframe" / 100),10

BielBdeLuna

is there a way to download that file again?

The Happy Friar

Quote from: BielBdeLuna on February 04, 2017, 06:10:45 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