Re: [hlcoders] Problem with VGUI.
Since no one has replied I am going to give an update on this. Now I cant even do a m_pAmmo-setText(""); as that too crashes the game. Any ideas? Could my vgui.lib be bad? Sarge_Spankwww.illicitstudios.com - Original Message - From: Philip Plante To: [EMAIL PROTECTED] Sent: Friday, January 25, 2002 6:56 PM Subject: [hlcoders] Problem with VGUI. Ok here is what I am trying to do. I am trying to make a new VGUI hud, I have done many before. But this ones seeming to have a problem. When I make the ammo panel and try to set the text to the current ammo count the game will crash. I have declared a new varible in CHudAmmo called m_iAmmo1 for the primary ammo. But when I do the following code in my update function the game crashes. Code I am using: IN HUD: sprintf(PlayerAmmo, "%d",gHUD.m_Ammo.m_iAmmo1);m_pAmmo-setText(PlayerAmmo); IN CHUDAMMO: at the bottom of the draw function i have: // Ammo m_iClip = pw-iClip; m_iAmmo1 = gWR.CountAmmo(pw-iAmmoType); // Ammo Has anyone ever seen this or know whats wrong? Maybe another way to do it posibly? Thanks, Sarge_Spankwww.illicitstudios.com
Re: [hlcoders] Problem with VGUI.
Since no one has replied I am going to give an update on this. Now I cant even do a m_pAmmo-setText(); as that too crashes the game. Any ideas? Could my vgui.lib be bad? Sarge_Spank Have you looked at the stack traceback in the MSVC debugger (i.e. View-Debug Windows-Call Stack) to see what function in your code is causing the crash? Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Problem with VGUI.
Why do you use "%d" ??? If your var (m_iAmmo1) is declared as int, you must use "%i", otherwise, PlayerAmmo isn't valid :( Perhaps it's the bug... CortexHL Albator coder mapperwww.hlalbator.fr.stICQ : 71548738 - Original Message - From: Philip Plante To: [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 3:56 AM Subject: [hlcoders] Problem with VGUI. Ok here is what I am trying to do. I am trying to make a new VGUI hud, I have done many before. But this ones seeming to have a problem. When I make the ammo panel and try to set the text to the current ammo count the game will crash. I have declared a new varible in CHudAmmo called m_iAmmo1 for the primary ammo. But when I do the following code in my update function the game crashes. Code I am using: IN HUD: sprintf(PlayerAmmo, "%d",gHUD.m_Ammo.m_iAmmo1);m_pAmmo-setText(PlayerAmmo); IN CHUDAMMO: at the bottom of the draw function i have: // Ammo m_iClip = pw-iClip; m_iAmmo1 = gWR.CountAmmo(pw-iAmmoType); // Ammo Has anyone ever seen this or know whats wrong? Maybe another way to do it posibly? Thanks, Sarge_Spankwww.illicitstudios.com
Re: [hlcoders] Problem with VGUI.
Woops... Post updated :) Be sure your "m_pAmmo" pointer is set correctly... CortexHL Albator coder mapperwww.hlalbator.fr.stICQ : 71548738 - Original Message - From: Cortex To: [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 1:03 PM Subject: Re: [hlcoders] Problem with VGUI. Why do you use "%d" ??? If your var (m_iAmmo1) is declared as int, you must use "%i", otherwise, PlayerAmmo isn't valid :( Perhaps it's the bug... CortexHL Albator coder mapperwww.hlalbator.fr.stICQ : 71548738 - Original Message - From: Philip Plante To: [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 3:56 AM Subject: [hlcoders] Problem with VGUI. Ok here is what I am trying to do. I am trying to make a new VGUI hud, I have done many before. But this ones seeming to have a problem. When I make the ammo panel and try to set the text to the current ammo count the game will crash. I have declared a new varible in CHudAmmo called m_iAmmo1 for the primary ammo. But when I do the following code in my update function the game crashes. Code I am using: IN HUD: sprintf(PlayerAmmo, "%d",gHUD.m_Ammo.m_iAmmo1);m_pAmmo-setText(PlayerAmmo); IN CHUDAMMO: at the bottom of the draw function i have: // Ammo m_iClip = pw-iClip; m_iAmmo1 = gWR.CountAmmo(pw-iAmmoType); // Ammo Has anyone ever seen this or know whats wrong? Maybe another way to do it posibly? Thanks, Sarge_Spankwww.illicitstudios.com
RE: [hlcoders] Problem with VGUI.
Why do you use %d ??? If your var (m_iAmmo1) is declared as int, you must use %i, otherwise, PlayerAmmo isn't valid :( %i and %d are equivalent. Actually, %i is considered obsolete. Besides, all specifying an invalid format character will do is give you garbage. -James Corvidae Williams ([EMAIL PROTECTED]) Administrator, Wavelength Forums (http://www.planethalflife.com/wavelength) Co-Leader / Coder, Underhive (http://www.underhive.com) ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Problem with VGUI.
It is because when I use an alert it all works fine. Sarge_Spankwww.illicitstudios.com - Original Message - From: Cortex To: [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 11:26 AM Subject: Re: [hlcoders] Problem with VGUI. Woops... Post updated :) Be sure your "m_pAmmo" pointer is set correctly... CortexHL Albator coder mapperwww.hlalbator.fr.stICQ : 71548738 - Original Message - From: Cortex To: [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 1:03 PM Subject: Re: [hlcoders] Problem with VGUI. Why do you use "%d" ??? If your var (m_iAmmo1) is declared as int, you must use "%i", otherwise, PlayerAmmo isn't valid :( Perhaps it's the bug... CortexHL Albator coder mapperwww.hlalbator.fr.stICQ : 71548738 - Original Message - From: Philip Plante To: [EMAIL PROTECTED] Sent: Saturday, January 26, 2002 3:56 AM Subject: [hlcoders] Problem with VGUI. Ok here is what I am trying to do. I am trying to make a new VGUI hud, I have done many before. But this ones seeming to have a problem. When I make the ammo panel and try to set the text to the current ammo count the game will crash. I have declared a new varible in CHudAmmo called m_iAmmo1 for the primary ammo. But when I do the following code in my update function the game crashes. Code I am using: IN HUD: sprintf(PlayerAmmo, "%d",gHUD.m_Ammo.m_iAmmo1);m_pAmmo-setText(PlayerAmmo); IN CHUDAMMO: at the bottom of the draw function i have: // Ammo m_iClip = pw-iClip; m_iAmmo1 = gWR.CountAmmo(pw-iAmmoType); // Ammo Has anyone ever seen this or know whats wrong? Maybe another way to do it posibly? Thanks, Sarge_Spankwww.illicitstudios.com
Re: [hlcoders] Problem with VGUI.
If your VGUI.lib were corrupt, then you wouldn't be able to link. Trust me, I made the mistake of checking mine into CVS as a text file. It kept 'helping' me by converting all the \n characters to \r\n or whatever.. really useful in binary data ;) More than likely, it's just some little problem with the code itself. I've had no end of fun with VGUI, some pitfalls to avoid: - don't overlap labels - I can't seem to have a CTransparentPanel that starts at line 0 at the top of the display. If I start it at line 1, everything is kosher (weird). I only see this when I have two Transparent panels on screen at once tho. - Be sure to test your VGUI stuff in all video modes (software, openGL, DirectX). I had a VGUI menu that crashed only in software mode, but not in OpenGL/DirectX (I think that was the overlapping label thing tho). - setText can as easily be called in the Update function, as opposed the constructor/Create function. You may be trying to set text of something that is invisible, I don't know what that does, or maybe your label or whatever isn't created when you're trying to set its text. We also have this weird bug on Voodoo III cards where if you spawn after selecting team and class using a VGUI menu, and happen to spawn with a weapon with more than 8/9 animations in it, the game crashes. We switch to a non VGUI menu, no crash. Switch to a weapon with less animations, no crash. Weird. :( Yes I did and when it does it kicks be back to that stupid little setText() line, and when I comment that out everything works, just not the ammo panel. Sarge_Spank www.illicitstudios.com ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders