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       

Map names at Get Psyched in SOD Wolf4SDL -Help!
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
Biergut
Registered User
Registered User


Joined: 08 Mar 2019
Last Visit: 10 Mar 2019

Topics: 1
Posts: 6


PostPosted: Fri Mar 08, 2019 1:32 pm
   Subject: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I tried Brother Tanks code that's here: diehardwolfers.areyep.com/viewtopic.php?t=1603&postdays=0&postorder=asc&&start=30
I got it to compile and it displays the map name on the first level. Any other level accessed will cause the game to crash. Any ideas? I've looked all over the forums and haven't seen anything.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 15 Mar 2019

Topics: 55
Posts: 2180
Location: Canada
blank.gif

PostPosted: Fri Mar 08, 2019 4:12 pm
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hi Biergut,

Interesting that level 1 works but the others don't. I wonder if changing the name of level 2 to the same name as level 1 makes level 2 work? If not, it might have something to do with how the game caches and uncaches fontnumber=1. I believe Andy fixed something related to that in Spear in AlumiuN's updated version here: https://github.com/AlumiuN/Wolf4SDL
Biergut
Registered User
Registered User


Joined: 08 Mar 2019
Last Visit: 10 Mar 2019

Topics: 1
Posts: 6


PostPosted: Fri Mar 08, 2019 6:16 pm
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hi Chris. I changed the name of level 2, but the same thing happens. The source that I'm using is "Wolf4SDL v1.9R (rolling Github release)". It looks like the same one in the link. I guess I'll go over it again to make sure I didn't mess something up. I started my "patch" using SOD Demo version because I only wanted to do 2 levels, but I ended up tweaking the code to give me 11, plus all of the actors/bosses.
BTW, are you Chris Choken? Remember me (Colonel Bill) and my web page (Colonel Bill's Wolfenstein 3D Add-ons) back in the old days? Heh, heh.

Mike
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 6:37 ago.

Topics: 165
Posts: 8343
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Mar 09, 2019 7:11 am
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Aren't there two versions of the code - one in which it supports longer map names? I think a longer map name is being used in Level 2 (or the other way around), and that's when the crashing occurs.
Biergut
Registered User
Registered User


Joined: 08 Mar 2019
Last Visit: 10 Mar 2019

Topics: 1
Posts: 6


PostPosted: Sat Mar 09, 2019 7:44 am
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

First level is called "LEVEL EINS", second is called "LEVEL ZWEI". It displays the first level fine at Get Psyched! When it goes to the second, it displays Get Psyched and instantly crashes. I'm going to re-do the code very carefully and see what happens. Since I used the Spear Demo as a base, I'm wondering if there's a #ifndef statement for the demo version somewhere screwing it up. Here's the code I'm using:

From Brother Tank:

Anywhere in wl_def.h add this:
::: CODE :::

extern char currentmapname[16];
#define MAPNAMELOC              2       // Mapname Location on Screen


In the wl_inter.c file change the "PreloadGraphics" routine to look like this:
::: CODE :::

void
PreloadGraphics (void)
{
#ifdef MAPNAME
    char     mapname[17];
    char     mapn[15]="Now Entering:\n";
    int      pos=0;
#endif
    DrawLevel ();
    ClearSplitVWB ();           // set up for double buffering in split screen

    VWB_BarScaledCoord (0, 0, screenWidth, screenHeight - scaleFactor * (STATUSLINES - 1), bordercol);
    LatchDrawPicScaledCoord ((screenWidth-scaleFactor*224)/16,
        (screenHeight-scaleFactor*(STATUSLINES+48))/2, GETPSYCHEDPIC);

    VW_UpdateScreen ();
    VW_FadeIn ();
#ifdef MAPNAME
    while (currentmapname[pos]>=32 && pos<16)
    {
      mapname[pos] = currentmapname[pos];
      pos++;
    }
    mapname[pos] = 0;
    PrintX = 0;
    PrintY = MAPNAMELOC; // Location to write on Screen
    fontnumber = 0;
    SETFONTCOLOR(0xf,0x0);
    US_CPrint(mapn);
//    fontnumber = 1; // Will crash game when Debugmode is enabled
       fontnumber = 0; // Fix crash when Debugmode is enabled
    SETFONTCOLOR(0xe,0x0);
    US_CPrint(mapname);
#endif
//    PM_Preload (PreloadUpdate);
    WindowW = scaleFactor * 28 * 8;
    WindowH = scaleFactor * 48;
    WindowX = (screenWidth - scaleFactor*224)/2;
    WindowY = (screenHeight - scaleFactor*(STATUSLINES+48))/2;
    PreloadUpdate (10, 10);
    IN_UserInput (70);
    VW_FadeOut ();

    DrawPlayBorder ();
    VW_UpdateScreen ();
}


Open up id_ca.cpp and put this near the top of the file... in the global variables section..

::: CODE :::


#ifdef MAPNAME
char    currentmapname[16];
#endif


And then move down to the CA_CacheMap routine and add the red to the code like this:

::: CODE :::


//
// load the planes into the allready allocated buffers
//
    size = maparea*2;
#ifdef MAPNAME
    for (plane = 0; plane <= 16; plane ++)
      currentmapname[plane] = mapheaderseg[mapnum]->name[plane];
#endif



"With that done... you can you add #define MAPNAME to your version.h file to turn it on and off... and you can change the MAPNAMELOC in the wl_def.h file to move the position of the map name as to where it is placed on the screen...

Hope that helps...

Greg
BrotherTank

Edit: removed comment lines in the PreloadGraphics function.
Edit: put back in the comment lines that are from the original virgin code base"

Biergut edit: Changed "fontnumber = 1;" to "fontnumber = 0;" (Chris fix)


Last edited by Biergut on Sat Mar 09, 2019 10:52 am; edited 1 time in total
Biergut
Registered User
Registered User


Joined: 08 Mar 2019
Last Visit: 10 Mar 2019

Topics: 1
Posts: 6


PostPosted: Sat Mar 09, 2019 9:51 am
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ok, I found out it works if you havn't enabled debugmode. Did anyone find a fix for this?

Edit: I got it to work by changing the code above that reads "fontnumber = 1;" to fontnumber = 0;

Edit: After testing, the changes messed up the end level messages that come on the screen when a boss is defeated, plus it's throwing out 15,000 bonus points on random levels. Sad
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 5:03 ago.

Topics: 38
Posts: 2545
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sat Mar 09, 2019 4:09 pm
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Biergut wrote:
Edit: After testing, the changes messed up the end level messages that come on the screen when a boss is defeated, plus it's throwing out 15,000 bonus points on random levels. Sad


A fix for this shouldn't cause that to occur - I'd double check that there isn't something otherwise wrong with the code relating to the end screens.

On the subject of having uncached things crash the game - most of the time if I'm making any significant changes to the code base, I tend to just cache everything at startup and not worry about caching and uncaching things, as the amount of RAM used by doing this is extremely negligible, and it simplifies things like this.
Aryan_Wolf3D
DieHard Guard
DieHard Guard


Joined: 21 Jul 2011
Last Visit: 19 Mar 2019

Topics: 6
Posts: 220

blank.gif

PostPosted: Sun Mar 10, 2019 9:38 am
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:
On the subject of having uncached things crash the game - most of the time if I'm making any significant changes to the code base, I tend to just cache everything at startup and not worry about caching and uncaching things, as the amount of RAM used by doing this is extremely negligible, and it simplifies things like this.

+1

_________________
"Way too many #ifdefs in the code!" - John Carmack
Biergut
Registered User
Registered User


Joined: 08 Mar 2019
Last Visit: 10 Mar 2019

Topics: 1
Posts: 6


PostPosted: Sun Mar 10, 2019 11:01 am
   Subject: Re: Map names at Get Psyched in SOD Wolf4SDL -Help!
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I don't know. I can't get it to work right. I'm pretty sure it has something to do with the following code. This is the Spear Demo version, so I commented out some lines to get more features.
There are 11 floors with no secret levels. The last 5 levels have a boss. I made the Angel of Death just drop a key instead of ending the game. At this point, it only displays the first par time on all levels except the last level (11), which will only display 15000 bonus with no message "Angel of Death defeated". The code works perfectly without the map name mod.
In WL_INTER.CPP
::: CODE :::
#else
        //
        // SPEAR OF DESTINY TIMES
        //
        {5.5, "05:30"},
        {5.5, "05:30"},
        {5.5, "05:30"},
        {6.0, "06:00"},
        {6.0, "06:00"},
        {6.0, "06:00"},
        {0, "??:??"},          // Boss 1
        {0, "??:??"},          // Boss 2
        {0, "??:??"},          // Boss 3
        {0, "??:??"},          // Boss 4
        {0, "??:??"},          // Boss 5 final
//      {4.5, "04:30"},
//      {2.75, "02:45"},
//      {4.5, "04:30"},
//      {6, "06:00"},
//      {0, "??:??"},           // Boss 3
//      {6, "06:00"},
//      {0, "??:??"},           // Boss 4
//      {0, "??:??"},           // Secret level 1
//      {0, "??:??"},           // Secret level 2
#endif
    };


Below in the same file:

::: CODE :::
#else
    if (mapon != 6 && mapon != 7 && mapon != 8 && mapon != 9 && mapon < 10)


Then below that:

::: CODE :::
#ifdef SPEAR
// #ifndef SPEARDEMO
        switch (mapon)
        {
            case 6:
                Write (14, 4, " trans\n" " grosse\n" STR_DEFEATED);
                break;
            case 7:
                Write (14, 4, "barnacle\n" "wilhelm\n" STR_DEFEATED);
                break;
            case 8:
                Write (14, 4, "ubermutant\n" STR_DEFEATED);
                break;
            case 9:
                Write (14, 4, " death\n" " knight\n" STR_DEFEATED);
                break;
            case 10:
                Write (14, 4, " angel\n" "  of\n" " death\n" STR_DEFEATED);
                break;
//          case 18:
//              Write (13, 4, "secret tunnel\n" "    area\n" "  completed!");
//              break;
//          case 19:
//              Write (13, 4, "secret castle\n" "    area\n" "  completed!");
//              break;
        }
// #endif
#else
        Write (14, 4, "secret floor\n completed!");
#endif

        Write (10, 16, "15000 bonus!");

        VW_UpdateScreen ();
        VW_FadeIn ();

        GivePoints (15000);
    }
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 Announcement: Wolf4SDL released
Author: Ripper
522 248300 Mon May 22, 2017 2:04 pm
Tricob View latest post
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 14056 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 3562 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3852 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 4114 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