Jump to content

How does Doom 3 connect options with cvars?


PKr

Recommended Posts

Long story short I want to add a new option item to the main menu to switch a newly added cvar. The problem is I can't understand how Doom 3 connects cvars with the options menu. I have checked a cstdoom3 code, and for example, you can switch cst_noStaminaDrop cvar there which affects a new menu item called "Stamina Drop" (it switches it to YES/NO). But I can't see a single reference of "cst_noStaminaDrop" being used anywhere outside of functions that affect stamina usage behavior.

 

Can somebody explain to me how Doom 3 draws its options menu, or give me a hint as to what functions to look at?

Share this post


Link to post

"guis\mainmenu.gui" Is where you'll find the definition of the main menu including the options menu (talking about vanilla doom 3 here), which you can find in pak000.pk4. There, you'll see some entries that use a "cvar" key to refer to the cvar the menu item changes.

 

Doom 3 comes with a GUI editor, which you can use by typing "editGUIs" in the console. Not sure how useful you'll find it. I can get it to open GUIs and browse the elements, but just get a blank window where it's supposed to visually show the gui (edit: turns out having r_multisampling set to non-zero was causing this).

 

I can't speak much for cstdoom3, it's packaged a bit strangely and I didn't bother to install it.

Edited by GuyMcBrofist

Share this post


Link to post

Thanks a lot! Wouldn't have figured this out without your help.

d3opts.jpg.902fc8873fb8fc1264a07d6b1e3f054b.jpg

Edited by PKr

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...