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       

[Solved] 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
Can I Play Daddy
Can I Play Daddy


Joined: 08 Mar 2019
Last Visit: 25 May 2019

Topics: 11
Posts: 48


PostPosted: Fri Mar 08, 2019 1:32 pm
   Subject: [Solved] 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.


Last edited by Biergut on Wed Mar 27, 2019 5:51 pm; edited 1 time in total
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 19 May 2019

Topics: 54
Posts: 2206
Location: Canada
blank.gif

PostPosted: Fri Mar 08, 2019 4:12 pm
   Subject: Re: [Solved] 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
Can I Play Daddy
Can I Play Daddy


Joined: 08 Mar 2019
Last Visit: 25 May 2019

Topics: 11
Posts: 48


PostPosted: Fri Mar 08, 2019 6:16 pm
   Subject: Re: [Solved] 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

Greetings Beer


Last edited by Biergut on Wed Mar 27, 2019 1:06 pm; edited 1 time in total
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 2:05 ago.

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

PostPosted: Sat Mar 09, 2019 7:11 am
   Subject: Re: [Solved] 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
Can I Play Daddy
Can I Play Daddy


Joined: 08 Mar 2019
Last Visit: 25 May 2019

Topics: 11
Posts: 48


PostPosted: Sat Mar 09, 2019 7:44 am
   Subject: Re: [Solved] 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;
    CA_CacheGrChunk (STARTFONT + 1);
    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: Updated code above to fix font issue


Last edited by Biergut on Wed Mar 27, 2019 1:03 pm; edited 3 times in total
Biergut
Can I Play Daddy
Can I Play Daddy


Joined: 08 Mar 2019
Last Visit: 25 May 2019

Topics: 11
Posts: 48


PostPosted: Sat Mar 09, 2019 9:51 am
   Subject: Re: [Solved] 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

EDIT: Fixed - see below


Last edited by Biergut on Wed Mar 27, 2019 1:04 pm; edited 1 time in total
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 18:20 ago.

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

PostPosted: Sat Mar 09, 2019 4:09 pm
   Subject: Re: [Solved] 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: 25 May 2019

Topics: 6
Posts: 242

blank.gif

PostPosted: Sun Mar 10, 2019 9:38 am
   Subject: Re: [Solved] 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
Can I Play Daddy
Can I Play Daddy


Joined: 08 Mar 2019
Last Visit: 25 May 2019

Topics: 11
Posts: 48


PostPosted: Sun Mar 10, 2019 11:01 am
   Subject: Re: [Solved] 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

Removed this message. This had nothing to do with the problem. Laughing


Last edited by Biergut on Fri Mar 29, 2019 6:34 am; edited 1 time in total
Biergut
Can I Play Daddy
Can I Play Daddy


Joined: 08 Mar 2019
Last Visit: 25 May 2019

Topics: 11
Posts: 48


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

Update: I tried it again and it seems to be working now. The only thing different I did was in ID_CA.CPP under the GLOBAL VARIABLES section, I inserted the 3 lines at the very bottom.

::: CODE :::
#ifdef MAPNAME
char    currentmapname[16];
#endif


I guess that was causing the problem?? Rolling Eyes
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 256213 Mon May 22, 2017 2:04 pm
Tricob View latest post
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 14389 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 3636 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3910 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 4169 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