So I've been trying to create a custom HUD button that uses a .vtf that I have, and executes a command connecting me to my scrim server. Also uses a custom sound for sound_released.
Here's what I had put in GameMenu.res
"scrimButton"
{
"label" ""
"command" "engine scrim"
"subimage" "scrimimage"
"OnlyAtMenu" "1"
}
Here's the segment from MainMenuOverride.res
I'm not at my desktop so I don't have the exact code, but I reproduced it as best as I can here.
"scrimButton"
{
"ControlName" "CExImageButton"
"fieldName" "scrimButton"
"xpos" "c-131" //arbitary for issue?
"ypos" "447" //arbitrary for issue?
"zpos" "2" //what does this position, exactly?
"wide" "30" //arbitrary for issue?
"tall" "25" //arbitrary for issue?
"autoResize" "0"
"pinCorner" "2"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
"labelText" ""
"font" "HudFontSmallBold"
"textAlignment" "center"
"dulltext" "0"
"brighttext" "0"
"default" "1"
"Command" "engine scrim"
"sound_depressed" "UI/buttonclick.wav"
"sound_released" "UI/customSound.wav"
"image_drawcolor" "235 226 202 255"
"SubImage"
{
"ControlName" "ImagePanel"
"fieldName" "SubImage"
"xpos" "6" //these position values i think are all arbitrary to my issue
"ypos" "5"
"zpos" "1"
"wide" "15"
"tall" "15"
"visible" "1"
"enabled" "1"
"image" "scrimimage"
"scaleImage" "1"
}
The problem I'm running into is if I omit the command from GameMenu.res, the image and sounds work, but the command doesn't run. And if I include the command from GameMenu.res, the image displays and the command executes, but sound_released doesn't play. I have tried it with UI/buttonclickrelease.wav and it doesn't play either, so I don't feel that it's an issue with a custom sound file.
So my question is for a fix, or maybe if someone could school me on how to work this HUD stuff I'd appreciate it. I've looked through Doodles' Guide and Flama's Guide but they haven't offered much insight.
So I've been trying to create a custom HUD button that uses a .vtf that I have, and executes a command connecting me to my scrim server. Also uses a custom sound for sound_released.
Here's what I had put in GameMenu.res
[code]"scrimButton"
{
"label" ""
"command" "engine scrim"
"subimage" "scrimimage"
"OnlyAtMenu" "1"
}[/code]
Here's the segment from MainMenuOverride.res
I'm not at my desktop so I don't have the exact code, but I reproduced it as best as I can here.
[code]"scrimButton"
{
"ControlName" "CExImageButton"
"fieldName" "scrimButton"
"xpos" "c-131" //arbitary for issue?
"ypos" "447" //arbitrary for issue?
"zpos" "2" //what does this position, exactly?
"wide" "30" //arbitrary for issue?
"tall" "25" //arbitrary for issue?
"autoResize" "0"
"pinCorner" "2"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
"labelText" ""
"font" "HudFontSmallBold"
"textAlignment" "center"
"dulltext" "0"
"brighttext" "0"
"default" "1"
"Command" "engine scrim"
"sound_depressed" "UI/buttonclick.wav"
"sound_released" "UI/customSound.wav"
"image_drawcolor" "235 226 202 255"
"SubImage"
{
"ControlName" "ImagePanel"
"fieldName" "SubImage"
"xpos" "6" //these position values i think are all arbitrary to my issue
"ypos" "5"
"zpos" "1"
"wide" "15"
"tall" "15"
"visible" "1"
"enabled" "1"
"image" "scrimimage"
"scaleImage" "1"
}
[/code]
The problem I'm running into is if I omit the command from GameMenu.res, the image and sounds work, but the command doesn't run. And if I include the command from GameMenu.res, the image displays and the command executes, but sound_released doesn't play. I have tried it with UI/buttonclickrelease.wav and it doesn't play either, so I don't feel that it's an issue with a custom sound file.
So my question is for a fix, or maybe if someone could school me on how to work this HUD stuff I'd appreciate it. I've looked through Doodles' Guide and Flama's Guide but they haven't offered much insight.
What I did was make an alias and then bind it to a key for eg:
alias Server "connect <whatever>; password <pw>"
bind F10 "Server"
What I did was make an alias and then bind it to a key for eg:
alias Server "connect <whatever>; password <pw>"
bind F10 "Server"
have you tried replacing "scrim" with the actual command? connect ip;password ???;
have you tried replacing "scrim" with the actual command? connect ip;password ???;