DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[HELP] Weird Bug
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Wed Jul 16, 2008 11:42 am
   Subject: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Everytime I get killed the games crashes.. any ideas what's causing this?
thanks in advance!

Err.. Fixed the problem.. It's because I removed this line:
::: CODE :::
if(Keyboard[sc_Tab] && viewsize == 21 && gamestate.weapon != -1)

why does it happen?? I want to have a full screen with a hud =\ without seeing that annoying cyan boarder... any way to move it??

_________________
Raziel A.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2248
Location: Ontario
canada.gif

PostPosted: Wed Jul 16, 2008 11:51 am
   Subject: Re: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Which game? Your own source? Need a little more info to go on..???

Greg
BrotherTank
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Wed Jul 16, 2008 12:00 pm
   Subject: Re: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

My game, and the source that's on chaos-software.. I'm just trying to remove that function. I want that statbar to appear even when I use full screen.
But when I put this code in:

::: CODE :::
 // if(Keyboard[sc_Tab] &&
(viewsize == 21 && gamestate.weapon != -1);


it works good but the game crushes everytime I get killed... And I wanted to know how to remove the blue boarder in the 20th viewsize. the 21st is the full screen that you need to press Tab to see the statbar..
Thanks in advance!

_________________
Raziel A.
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: Online Now

Topics: 110
Posts: 1748
Location: A hole in the wall
australia.gif

PostPosted: Thu Jul 17, 2008 5:50 am
   Subject: Re: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

by commenting off that line, whatever line was underneath it will be executed regardless of whether or not tab is pressed Razz I think that's what's going on anyway.

_________________
WolfSource - Your news source since the beginning of time (2019)
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Thu Jul 17, 2008 1:29 pm
   Subject: Re: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I don't think the last line has anything to do with the game crashing..
those are the last lines after:
::: CODE :::

//
// show screen and time last cycle
//

    if (fizzlein)
    {
        FizzleFade(screenBuffer, screen, 0, 0,
            screenWidth, screenHeight, 21, false);
        fizzlein = false;

        lasttimecount = GetTimeCount();          // don't make a big tic count
    }
    else
    {
#ifndef REMDEBUG
        if (fpscounter)
        {
            fontnumber = 0;
            SETFONTCOLOR(7,127);
            PrintX=4; PrintY=1;
            VWB_Bar(0,0,50,10,bordercol);
            US_PrintSigned(fps);
            US_Print(" fps");
        }
#endif
        SDL_BlitSurface(screenBuffer, NULL, screen, NULL);
        SDL_UpdateRect(screen, 0, 0, 0, 0);
    }

#ifndef REMDEBUG
    if (fpscounter)
    {
        fps_frames++;
        fps_time+=tics;

        if(fps_time>35)
        {
            fps_time-=35;
            fps=fps_frames<<1;
            fps_frames=0;
        }
    }
#endif
}


I just want to play the FULL SCREEN mode (view size 21) with the HUD :\
can anyone please help out here?
thanks.

_________________
Raziel A.
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Sun Jul 20, 2008 4:24 am
   Subject: Re: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

When you die the gamestate.weapon is set to -1.
When ShowActStatus() tries to draw that weapon it crashes.
That's why ShowActStatus() is only called when the player is not currently dying (gamestate.weapon != -1).

Your above code
::: CODE :::
 // if(Keyboard[sc_Tab] &&           // WRONG
(viewsize == 21 && gamestate.weapon != -1);
ShowActStatus();
always executes ShowActStatus().
You probably wanted it to be
::: CODE :::
if(viewsize == 21 && gamestate.weapon != -1)
    ShowActStatus();
which will only show the floating hud in full size mode and when the player is not dying.

If you want the hud to still be displayed, when the player dies, you have to use
::: CODE :::
if(viewsize == 21)
    ShowActStatus();
and the following changes:
::: CODE :::
Index: wl_game.cpp
===================================================================
--- wl_game.cpp   (revision 222)
+++ wl_game.cpp   (working copy)
@@ -1232,6 +1232,7 @@
         VW_FadeIn ();
     }
 
+    gamestate.diedweapon = gamestate.weapon;
     gamestate.weapon = (weapontype) -1;                     // take away weapon
     SD_PlaySound (PLAYERDEATHSND);
 
Index: wl_def.h
===================================================================
--- wl_def.h   (revision 222)
+++ wl_def.h   (working copy)
@@ -859,7 +859,7 @@
     short       health;
     short       ammo;
     short       keys;
-    weapontype  bestweapon,weapon,chosenweapon;
+    weapontype  bestweapon,weapon,chosenweapon,diedweapon;
 
     short       faceframe;
     short       attackframe,attackcount,weaponframe;
Index: wl_agent.cpp
===================================================================
--- wl_agent.cpp   (revision 222)
+++ wl_agent.cpp   (working copy)
@@ -570,7 +570,8 @@
 void DrawWeapon (void)
 {
     if(viewsize == 21 && ingame) return;
-    StatusDrawPic (32,8,KNIFEPIC+gamestate.weapon);
+    // gamestate.weapon is -1 if the player died. In this case diedweapon has been set to the last weapon.
+    StatusDrawPic (32,8,KNIFEPIC+(gamestate.weapon != -1 ? gamestate.weapon : gamestate.diedweapon));
 }
 
 
(lines prefixed by a "-" are to be removed, those prefixed by "+" must be added).

_________________
Life is an awful game, but the graphics resolution rocks ;D
Raziel
DieHard SS
DieHard SS


Joined: 03 Dec 2005
Last Visit: 03 Dec 2009

Topics: 49
Posts: 485
Location: Israhell
israel.gif

PostPosted: Sun Jul 20, 2008 7:22 am
   Subject: Re: [HELP] Weird Bug
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Thanks! it helped!!

_________________
Raziel A.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 15423 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 3801 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 4429 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 4071 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 4356 Tue May 06, 2008 1:15 pm
Ripper View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group