DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d 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       

[Code] Displaying Map Name on Get Psyched Screen -Adam Biser
Page 1 of 4 Goto page 1, 2, 3, 4  Next
DieHard Wolfers Forum Index -> Code Tutorials 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
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 07 Feb 2010

Topics: 142
Posts: 2071
Location: Ontario
canada.gif

PostPosted: Thu Mar 18, 2004 7:12 pm
   Subject: [Code] Displaying Map Name on Get Psyched Screen -Adam Biser
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Display the Map Name on Get Psyched Screen
by Adam Biser

Here's what I'm doing for Orb of Dilaaria.
Open WL_INTER.C and add the lines in 'Blue' to your code as shown:

::: CODE :::
void PreloadGraphics(void)
{
   DrawLevel ();
   ClearSplitVWB ();   // set up for double buffering in split screen
   VWB_Bar (0,0,320,200-STATUSLINES,127);

   //Add these 4 lines to draw the map name given in the GAMEMAPS file.
   SETFONTCOLOR(0xf,0x0);
   PrintY=2;
   US_CPrint("Now entering...");
   US_CPrint(mapheaderseg[gamestate.episode*10+gamestate.mapon]->name);


   ..etc..


Then you just name the maps whatever you want them to be called via your map editor program (ie Mapedit, WDC, Floedit).

EDIT: Cleaned up code comments...
Enjoy... Adam
EDIT 2: added gamestate.episode to the ->name line.
Guest




Last Visit:





PostPosted: Tue Oct 26, 2004 2:39 am
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What source file are we supposed to add this to?
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 1:44 ago.

Topics: 32
Posts: 1948
Location: Midsouth
usa.gif

PostPosted: Tue Oct 26, 2004 3:20 am
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

PreloadGraphics is in WL_INTER.C

_________________
My band, Odd Normality
Orb of Dilaaria
Star Wars: Bloodlines
lucky_foot
Don't Hurt Me
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 15 Mar 2007

Topics: 12
Posts: 67
Location: Pennsylvania
usa.gif

PostPosted: Fri Nov 05, 2004 4:34 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'm assuming that the name of the map is placed in from the name given in Mapedit 8.4?

If not, how do you name the maps?

_________________
JonathanS
Lucky foot Productions

www.luckyfootproductions.jtworld.net
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 1:44 ago.

Topics: 32
Posts: 1948
Location: Midsouth
usa.gif

PostPosted: Fri Nov 05, 2004 5:59 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@lucky_foot: Correct. Though I suppose you could also set up some form of string array in code if you wanted.

_________________
My band, Odd Normality
Orb of Dilaaria
Star Wars: Bloodlines
lucky_foot
Don't Hurt Me
Don't Hurt Me


Joined: 05 Nov 2004
Last Visit: 15 Mar 2007

Topics: 12
Posts: 67
Location: Pennsylvania
usa.gif

PostPosted: Sat Nov 06, 2004 11:58 am
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks.

I. myself, am i tutorial person who follows directions and has a slight knowledge of coding. Very Happy

_________________
JonathanS
Lucky foot Productions

www.luckyfootproductions.jtworld.net
Guest




Last Visit:





PostPosted: Thu Nov 18, 2004 3:23 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I've input the following code:

::: CODE :::
SETFONTCOLOR(0xf,0x0);
   PrintY=2;
   US_CPrint("Now entering...");
   US_CPrint(mapheaderseg[gamestate.mapon]->name);


in lines 1002-1005 on the WL_inter.C, I've doubel checked them several times (They are in the right places and I have no symbols or code missing) however I get an error when I compile.

"Error WL_Inter.C 1005: Statement missing;"
US_CPrint(mapheaderseg[gamestate.mapon]->name);

The first bracket in it is highlighted. Chances are that I've made a stupid mistake but I would be thankful of any help you can offer.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 07 Feb 2010

Topics: 142
Posts: 2071
Location: Ontario
canada.gif

PostPosted: Thu Nov 18, 2004 3:29 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Check the lines of code before the code added. Chances are there is something missing... a ";" semi-colon somewhere or bracket pair that is still open. What you posted looks right.

Greg
BrotherTank
Guest




Last Visit:





PostPosted: Thu Nov 18, 2004 3:37 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks for your help, I'd deleted one of the semi-colons from the code above by mistake and it has compiled this time. Thanks again for the help.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 07 Feb 2010

Topics: 142
Posts: 2071
Location: Ontario
canada.gif

PostPosted: Wed Dec 08, 2004 1:17 am
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Adam...

Don't know if you've found this or not... But this code works sometimes and others will throw wierd strings in the name. MCS found the problem when building EoD.. (which is one of the problems he is having now as he needs the string space back and wants to use this tutorial, but it sometimes throws the wierd characters).... And he's put it to me to figure out why this isn't working....

Here's what we've done so far...

Edit maps with Mapedit... change names to appropriate names... if the string entered isn't 16 characters before you hit enter, then the name will sometimes show properly, other times will add odd characters.

Edit the maps with WDC... This seems a little more stable, but will sometimes show blank or the odd time will add wierd or odd characters....

As an example... level 22 in EoD is called "Otto" ... 99% of the time it will show just Otto... but sometimes it will show "Otto ]$#%" or something to that effect. It does this more often when maps are named with Mapedit, but will do it as well with maps named with WDC.

The current problem with EoD is string space. MCS has run out... he was using an array to hard code the names (because he found this problem)... and now he needs for it to go back to using the variable from the mapheaderseg as in your tutorial.. This will save him close to 700bytes in string space (and hopefully fix the last of the problems in EoD).

So... I'm asking for your help in figuring out the problem... All EoD's maps were done with Mapedit... so if you can help with a fix, that would be greatly appreciated and help bring to an end the problems he's having fixing EoD.

Greg
BrotherTank
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 1:44 ago.

Topics: 32
Posts: 1948
Location: Midsouth
usa.gif

PostPosted: Wed Dec 08, 2004 5:02 am
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, you can try something like:
::: CODE :::
void PreloadGraphics(void)
{
   char      mapname[17];
   byte      pos=0;
...
   SETFONTCOLOR(0xf,0x0);
   PrintY=2;
   fontnumber=0; // WSJ->Chris->KyleRTCW's disappearing text bug fix.
   US_CPrint("Now entering...");
   while (mapheaderseg[gamestate.mapon+gamestate.episode*10]->name[pos]>=32 && pos<16)
   {
      mapname[pos] = mapheaderseg[gamestate.mapon+gamestate.episode*10]->name[pos];
      pos++;
   }
   mapname[pos] = 0;
   US_CPrint(mapname);

Seems like it needs the null terminator.
I haven't tried to duplicate your error, so this might not fix it, but it acts like this is the problem.

EDIT: Conner94 pointed out that it would display episode 1 titles for episodes 2-6, so I updated the code to use "gamestate.mapon+gamestate.episode*10" instead of just "gamestate.mapon". This code came from Orb, which doesn't have episodes.

EDIT 2: Fixed the disappear text bug by adding "fontnumber=0;" before the US_CPrint line as noted above.
EDIT 3: Fixed the credit for EDIT 2.
EDIT 4: Put setfontcolor and printy here again.

_________________
My band, Odd Normality
Orb of Dilaaria
Star Wars: Bloodlines


Last edited by Adam Biser on Sun Apr 16, 2006 9:14 pm; edited 4 times in total
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 07 Feb 2010

Topics: 142
Posts: 2071
Location: Ontario
canada.gif

PostPosted: Wed Dec 08, 2004 5:18 am
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks Adam... will pass it on to MCS to give it a test... As well as testing it here...

Greg
BrotherTank

Edit: Seems to work fine here.. Hope MCS has the same success...
MCS
Site Administrator
<B>Site Administrator</B>


Joined: 01 Mar 2003
Last Visit: 21 May 2009

Topics: 20
Posts: 243
Location: Amsterdam, the Netherlands
netherlands.gif

PostPosted: Wed Dec 08, 2004 9:49 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Works flawlessly... thanks! Smile
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 1:44 ago.

Topics: 32
Posts: 1948
Location: Midsouth
usa.gif

PostPosted: Wed Feb 09, 2005 2:06 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This code was updated to work with episode based games. See post #11 for details.

_________________
My band, Odd Normality
Orb of Dilaaria
Star Wars: Bloodlines
Reactor
DieHard Guard
DieHard Guard


Joined: 17 Mar 2005
Last Visit: 06 Feb 2010

Topics: 23
Posts: 274
Location: Hungary
hungary.gif

PostPosted: Tue Mar 29, 2005 6:55 pm
   Subject: Title Terror
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Greetings!
My problem is with my level titles. Some of them are too long for Wolfenstein Data compiler, I can't type them. I wonder if there is any way to enter longer level titles.

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 1:44 ago.

Topics: 32
Posts: 1948
Location: Midsouth
usa.gif

PostPosted: Tue Mar 29, 2005 7:09 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

16 characters is the limit of the GAMEMAPS structure. An idea for having a longer name might be to store all the map names in an ENDART chunk, load that chunk, find the name for the map and the display it. I've not tried this, and I don't have code for it, but it should be somewhat similar to the text grabbing stuff in WL_TEXT.C.

_________________
My band, Odd Normality
Orb of Dilaaria
Star Wars: Bloodlines
Reactor
DieHard Guard
DieHard Guard


Joined: 17 Mar 2005
Last Visit: 06 Feb 2010

Topics: 23
Posts: 274
Location: Hungary
hungary.gif

PostPosted: Tue Mar 29, 2005 8:02 pm
   Subject: Title Terror act 2.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Uh-oh,that sound so complicated to me! Sarcastic
Anyone has a small tutorial for me? I'll lose 50 life meter points! Smile

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
Tricob
DieHard Wolfer
DieHard Wolfer


Joined: 15 Mar 2005
Last Visit: 19:39 ago.

Topics: 95
Posts: 4447
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Wed Mar 30, 2005 3:52 am
   Subject: Re: Title Terror
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Reactor wrote:
I wonder if there is any way to enter longer level titles.

An alternative would be to have the longer name placed in the actual map, and have the code scan the map data to extract the level's name. But that means you can't use levels that cover up this area of the map.

In any case, that's a code trick that - once again - I don't completely know how to do. Shrug
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 2:04 ago.

Topics: 60
Posts: 1138
Location: Loppi - Finland
finland.gif

PostPosted: Tue Nov 29, 2005 4:26 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I have noticed that when you use the secret cheat (ILM, BAT, etc.),
then the map name isn't shown anymore in the Get Psyched screen
(To make it work again you must close the program and start again).

Is there anyway to prevent this?
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 1:44 ago.

Topics: 32
Posts: 1948
Location: Midsouth
usa.gif

PostPosted: Tue Nov 29, 2005 5:30 pm
   Subject: Re: [Code] Displaying Map Name on Get Psyched Screen -Adam B
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Don't cheat. Very Happy

Seriously, though, I've noticed it, too. I haven't really tried to hard to figure out why it happens. I thought that
::: CODE :::
SETFONTCOLOR(0xf,0x0);

would take care of it.

I'll do some testing tonight.

_________________
My band, Odd Normality
Orb of Dilaaria
Star Wars: Bloodlines
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 4 Goto page 1, 2, 3, 4  Next
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 830 Sat Feb 12, 2005 5:18 am
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 426 Sat Mar 13, 2004 10:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 570 Tue Jan 27, 2004 6:29 pm
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 902 Sun Oct 26, 2003 8:21 am
Guest View latest post
No new posts [Code] Add Text to Screen at Skill Level select - Chris
Author: Chris
1 569 Fri Oct 17, 2003 8:04 pm
Sockman 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 subSilver Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group