Wolf3d Haven Forum

Please log in or register. Smile
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


    [SDL CODE] Health shown as a message while using full screen mode.

    Share

    Raziel
    Seasoned Wolfer
    Seasoned Wolfer

    Male
    Number of posts : 361
    Age : 28
    Location : Israel
    Hobbie : Blasphemous Noise and Wolfenstein3D
    Registration date : 2007-07-08

    [SDL CODE] Health shown as a message while using full screen mode.

    Post by Raziel on Sun Jul 27, 2008 6:13 pm

    I think I have found a quick and nice solution for those who usually play
    with full screen mode and doesn't like to press "TAB" all of the time
    to check on their health.

    First off you need to input the in-game messages feature by WSJ.
    Second off you need to input those lines I'll put in this tutorial Wink

    in WL_DEF.H look for these lines:

    Code:

    void    GetMessage (char *lastmessage);
    void    DrawMessage (void);

    Underneath those lines put this line:

    Code:

    void DrawHltMessage (void);

    After that open WL_DRAW.CPP and locate these lines:

    Code:

    if (messagetime > 0)
    DrawMessage ();

    Underneath those lines add:

    Code:

       if(viewsize == 21 && gamestate.weapon != -1)
        DrawHltMessage ();

    After that you should go to the end of the WL_DRAW.CPP file and modify this function:

    Code:

    /*
    ========================
    =
    = DrawMessage
    =
    = displays ingame messages
    =
    ========================
    */

    void DrawMessage (void)
    {

      messagetime-=tics;
    fontnumber = 0;
    // message's shadow
      SETFONTCOLOR(0x0,0x1); // set the color
    PrintX=7; PrintY=1;
    US_Print(gamestate.message);

    SETFONTCOLOR(0x4,0x0); // set the color
    PrintX=8; PrintY=2; // position the message
    US_Print(gamestate.message); // print message
    DrawPlayBorderSides();
    }

    to look like this:

    Code:

    /*
    ========================
    =
    = DrawMessage
    =
    = displays ingame messages
    =
    ========================
    */

    void DrawMessage (void)
    {
    messagetime-=tics;
    fontnumber = 0;
    // message's shadow
    SETFONTCOLOR(0x0,0x1); // set the color
    PrintX=7; PrintY=1;
    US_Print(gamestate.message);

    SETFONTCOLOR(0x4,0x0); // set the color
    PrintX=8; PrintY=2; // position the message
    US_Print(gamestate.message); // print message
    DrawPlayBorderSides();
    }

    void DrawHltMessage (void)
    {
    fontnumber = 0;
    SETFONTCOLOR(0x0,0x1);
    PrintX=8; PrintY=14;
    US_Print("Health: ");
    US_PrintUnsigned (gamestate.health);
    SETFONTCOLOR(0x4,0x0);
    PrintX=9; PrintY=15;
    US_Print("Health: ");
    US_PrintUnsigned (gamestate.health);
    DrawPlayBorderSides ();
    }

    That's it!
    Now you can play in full screen mode without pressing the "TAB" key anymore!
    Hope anyone will ever use it. And if you do please don't forget to Credit WSJ for the in-game messages code.
    And yeah I wouldn't mind to get a little credit too...

    Just forgot onething though... Ammo. Yeah..
    Just repeat the steps. Just don't forget to modify the lines!
    Happy coding!


    Last edited by Raziel on Sun Jul 27, 2008 6:37 pm; edited 1 time in total (Reason for editing : Forgot something really important!)




    STORMING THE FRONT WITH A SCHMEISSER IN HAND!
    Raziel A.

      Current date/time is Sat Dec 10, 2016 12:46 am