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       

[Code] Easy Automated Intermission Screens
Page 1 of 1
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: 13 Sep 2017

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

PostPosted: Wed Sep 01, 2004 8:39 am
   Subject: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Auto Intermission Screens by BrotherTank

Many people have asked about intermission screens and there have been at least 1 or two ways of achieving them. In those cases, things were hard coded into the exe file. Well here is a fully tested and working tutorial on Automated Intermission Screens. What do I mean by Automated? Well, it checks to see if the file exists... If it does, it shows the screen... If not.. then the game just goes on as normal.

Here's the code to achieve it:

Open WL_DEF.H and at the end of the file add this:

::: CODE :::

extern   void   IntermissionScreens (void);



Now open WL_TEXT.C and at the end of the file add this:

::: CODE :::

/*
======================
=
= Intermission Screens by BrotherTank
=
======================
*/
void IntermissionScreens (void)
{
   struct ffblk f;
   int         artnum;
   char far    *text;
   memptr      layout;
   
   char intfilename[13] = "INTART00.";
   strcat(intfilename,extension);
   intfilename[6] = '0' + (gamestate.episode+1);
   intfilename[7] = '0' + (gamestate.mapon+1);

   if (!findfirst(intfilename,&f,FA_ARCH))
   {
      CA_UpLevel ();
      MM_SortMem ();

      CA_LoadFile (intfilename,&layout);
      text = (char _seg *)layout;
      MM_SetLock (&layout, true);

      ShowArticle (text);

      MM_FreePtr (&layout);

      VW_FadeOut();

      FreeMusic ();
      CA_DownLevel ();
      MM_SortMem ();

   }
}


Now Open WL_GAME.C and search down to the last function in the file "void GameLoop (void)" and look for the following lines in red and add the lines in blue:

::: CODE :::

   int i,xl,yl,xh,yh;
   char num[20];
   boolean   died;

restartgame:
   ClearMemory ();

   VW_FadeOut();
   ClearMScreen();
   IntermissionScreens (); // Intermission Text - Shown when starting new game

   SETFONTCOLOR(0,15);
   DrawPlayScreen ();
   died = false;
restart:


Again a little further in the same routine - Look for the lines in red, and add the lines in blue....

::: CODE :::

         //
         // GOING TO NEXT LEVEL
         //
            gamestate.mapon++;

         IntermissionScreens (); // Intermission Screen If file exists
         DrawPlayScreen ();
         break;


Again a little further in the same routine - Look for the lines in red, and add the lines in blue....

::: CODE :::

         Died ();
         died = true;         // don't "get psyched!"

         if (gamestate.lives > -1)

         {
            VW_FadeOut();
            ClearMScreen();
            ClearMemory ();
            IntermissionScreens (); // Intermission Text
            DrawPlayScreen ();
            break;            // more lives left
         }

         VW_FadeOut ();

         ClearMemory ();



That's all there is to the code.... Now, how it works...

If you want an intermission screen, or level briefing, or whatever you call it in your game, then you just create a file for that level. ie: Lets say we wanted intermissions on Episode 1 Levels 1 - 3 and 7.... You would create the following files:

INTART11.WL6 <- 1 = Episode 1 - 1 = show before level 1
INTART13.WL6 <- 1 = Episode 1 - 3 = show before level 3
INTART17.WL6 <- 1 = Episode 1 - 7 = show before level 7

Then within each file, you must format the text within it to suit not only your needs, but also the screen within the game. To do that, you use the following codes (as per MCS's Readthis Tutorial):

Now you can add your own text, graphics and colors. To do so, you'll need the following:

TEXT FORMATTING COMMANDS

^C<hex digit> Change text color
^E[enter] End of layout (all pages)
^G<y>,<x>,<pic>[enter] Draw a graphic and push margins
^P[enter] Start new page, must be the first chars in a layout
^L<x>,<y>[ENTER] Locate to a specific spot, x in pixels, y in lines

The <pic> value follows the order in which the graphics appear in VGAGRAPH. Open FloEdit, connect to your project and choose Graphics-Images. Note that values 1 and 2 are reserved for internal use, so if you want the first image in VGAGRAPH to appear in your helptext, enter 3 as a <pic> value, etc.
Just experiment a little with this, until you'll get the hang of it. It's not that difficult.


So, I hope you like this tutorial and find it useful. Take advatage of it when you need intermission screens. As always... When using any tutorial in your code, Remember to give credit to the people who created it.

Greg
BrotherTank


Last edited by BrotherTank on Wed Sep 01, 2004 9:50 am; edited 1 time in total
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Wed Sep 01, 2004 8:46 am
   Subject: Re: Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This is a simple sample of the INTART files (named INTART11.WL6 in my game directory):

^P
^G32,144,91
^C7d Welcome To INTART11.WL6...

^C47 Episode/Mission 1

^C77 And the episode briefing goes here!

^E

---------------------------------------------------------
Notice the ^P - That tells it that this is a new page - even if you only use 1 page you must tell the engine it's a new page.... Also, the very last line of your file must contain the "^E" on a seperate line from any other codes/text. This tells the engine to STOP reading and display the pages you have defined.

Greg
BrotherTank
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Wed Sep 01, 2004 9:26 am
   Subject: Re: Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Other commands from the source seem to be:
^B<y>,<x>,<w>,<h>[enter]
  
  
does a VWB_Bar(x,y,w,h, BACKCOLOR);
;
  
  
comment a line.
>
  
  
move to the center of the current line.
^Tyyy,xxx,ppp,ttt
  
  
waits ttt tics, then draws pic

I've not tested any of these commands personally, but the code seems to be in there for them.
^T can be used to make your ENDART animated and was used in Command Keen.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Ringman
DieHard Wolfer
DieHard Wolfer


Joined: 31 Jul 2003
Last Visit: 14 Dec 2016

Topics: 54
Posts: 1165
Location: up my nose
usa.gif

PostPosted: Thu Sep 02, 2004 5:48 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Once again, a smashing job Greg. I can definitely seeing using this. You've been doing a lot of code tinkering lately haven't you? You seem rather prolific this week. Smile

_________________
One day I saw upon a stair a little man who wasn't there. He wasn't there again today. My gosh I'd wish he'd go away.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Thu Sep 02, 2004 9:31 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ringman wrote:
Once again, a smashing job Greg. I can definitely seeing using this. You've been doing a lot of code tinkering lately haven't you? You seem rather prolific this week. Smile


Actually, I've had this for some time as it is part of Wolfenstein Plus... Smile I've just been releasing the little things and things I promised to release when I had finished what I was working on. Well, I'm just about finished and awaiting the release of EoD as I promised to do. Because it has been delayed, I was adding a few more things to the Wolfenstein Plus... Anyhow... Glad you liked the tutorials.

Greg
BrotherTank
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 13 Aug 2016

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Sun Sep 05, 2004 10:38 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

How would we do this when using seemless level progression, as the episode is always 0, so if we had intart07.wl6, it would show on level 7, 17, 27, 37, 47 and 57. I tried a few things, but how would we get it to show intart47 or level 47, or intart60 on level 60, etc...

Thanks all Smile

_________________
~ James
ZuljinRaynor
DieHard Officer
DieHard Officer


Joined: 17 Jan 2004
Last Visit: 30 Apr 2011

Topics: 19
Posts: 559
Location: New Jersey, USA
usa.gif

PostPosted: Sun Sep 05, 2004 10:42 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm. I'm using Sod and 02 makes it show up on level 2 only. I don't see why seamless whould have a problem.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Sun Sep 05, 2004 8:12 pm
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

jamez wrote:
How would we do this when using seemless level progression, as the episode is always 0, so if we had intart07.wl6, it would show on level 7, 17, 27, 37, 47 and 57. I tried a few things, but how would we get it to show intart47 or level 47, or intart60 on level 60, etc...

Thanks all Smile


2 ways...

1> divide the mapon by 10 gives the episode.. use modulus divison for the map... Smile

2> Convert the mapon to a string and truncate the first character as it's a blank (pos/neg value holder) and then add string "INTART" + new string...

Greg
BrotherTank
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Fri Sep 10, 2004 9:26 pm
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

For anyone having problems with "Out of Memory" errors....

Especially when you have died and have to start the level over...

Add a "ClearMemory ();" after the Intermission call.

That's the only difference between the code I posted above and my own personal code (and when the game loads I have less that 256k available and everything works with the intermission screens - No errors).

Greg
BrotherTank
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Wed Oct 27, 2004 7:48 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

where do i get these intart(n).wl6 things or how do i make them, sorry im a bit dense... Crying or Very sad
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Wed Oct 27, 2004 10:27 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
where do i get these intart(n).wl6 things or how do i make them, sorry im a bit dense... Crying or Very sad


You make your own.. ie:

INTART11.WL6 wrote:
^P
^G32,144,91
^C7d Welcome To INTART11.WL6...

^C47 Episode/Mission 1

^C77 And the episode briefing goes here!

^E


This file would show on Episode 1 Level 1

Using the commands:
::: CODE :::

TEXT FORMATTING COMMANDS
------------------------
^C<hex digit>           Change text color
^E[enter]            End of layout (all pages)
^G<y>,<x>,<pic>[enter]   Draw a graphic and push margins
^P[enter]            start new page, must be the first chars in a layout
^L<x>,<y>[ENTER]      Locate to a specific spot, x in pixels, y in lines
^>[ENTER]             Tab to Middle of Screen


There are other commands within the source, but for the most part, these are the ones that you will be needing the most. Hope that helps...

Greg
BrotherTank
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 10 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Wed Oct 27, 2004 10:29 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

They are just text files. There are some formating commands with them though, which are mentioned in earlier posts.
For an example, see BrotherTank's second post in this thread.

EDIT: OK, posted at the same time as BrotherTank...

Quote:
^>[ENTER] Tab to Middle of Screen

Actually, the [ENTER] isn't necessary because there's no RipToEOL() while processing the command in WL_TEXT.C.
So you can have
Quote:
^>This starts in the middle

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Wed Oct 27, 2004 10:54 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

so i just make a new notepad document with the extension .wl6?
Hair Machine
DieHard SS
DieHard SS


Joined: 24 Nov 2003
Last Visit: 08 Jul 2017

Topics: 8
Posts: 431
Location: editing my profile
uk.gif

PostPosted: Wed Oct 27, 2004 11:37 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes. Wink

_________________
Rar rar fiddle di dee
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

Topics: 29
Posts: 292
Location: England
uk.gif

PostPosted: Wed Oct 27, 2004 11:47 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

fort so and it works sorry for being a dumb ass you guys Sad
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 04 Dec 2017

Topics: 58
Posts: 581
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Wed Oct 27, 2004 12:04 pm
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
fort so and it works sorry for being a dumb ass you guys Sad

You're only a dumb ass if you don't ask.

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Wed Dec 01, 2004 9:47 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

For those that didn't understand my response to Jamez....

If you are using seamless or the spear side of the code you have to change these two lines:

::: CODE :::
   intfilename[6] = '0' + (gamestate.episode+1);
   intfilename[7] = '0' + (gamestate.mapon+1);


to use integer and modulus division...

Thus is becomes:

::: CODE :::
   intfilename[6] = '0' + ((gamestate.mapon+1)/10);
   intfilename[7] = '0' + ((gamestate.mapon+1)%10);


Hope that makes things a little clearer....

Greg
BrotherTank
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 13 Aug 2016

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Thu Jan 18, 2007 10:41 pm
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

BrotherTank wrote:
jamez wrote:
How would we do this when using seemless level progression, as the episode is always 0, so if we had intart07.wl6, it would show on level 7, 17, 27, 37, 47 and 57. I tried a few things, but how would we get it to show intart47 or level 47, or intart60 on level 60, etc...

Thanks all Smile


2 ways...

1> divide the mapon by 10 gives the episode.. use modulus divison for the map... Smile

2> Convert the mapon to a string and truncate the first character as it's a blank (pos/neg value holder) and then add string "INTART" + new string...

Greg
BrotherTank


When I look back, it's funny to see how I never looked at a problem sometimes! :p

_________________
~ James
Ultimator
Registered User
Registered User


Joined: 30 Oct 2005
Last Visit: 17 Jun 2008

Topics: 2
Posts: 22

usa.gif

PostPosted: Thu Jun 21, 2007 2:04 pm
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quick question:

How do I get this to show up on the secret floor, say, Episode 1? I've tried INTART20.WL6 and INTART10.WL6, but I can't seem to figure it out. It works fine for the other floors.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Thu Jun 21, 2007 3:33 pm
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You have to remember that when the player sees '1' on the screen, the program is thinking '0'. So if your secret level is on level 10, then it's really map 09... so the filename would be INTART09.??? where ??? is you games extension.... if you want it to show on level 1 the filename would be INTART00.???

Hope that helps...

Greg
BrotherTank
Ultimator
Registered User
Registered User


Joined: 30 Oct 2005
Last Visit: 17 Jun 2008

Topics: 2
Posts: 22

usa.gif

PostPosted: Fri Jun 22, 2007 8:28 am
   Subject: Re: [Code] Easy Automated Intermission Screens
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I went ahead and just removed the "+1" from the "gamestate.episode" and "gamestate.mapon" variables. This way, INTART00.WL6 does the introduction for E1L1, while INTART09.WL6 does the secret level.

I think it didn't make any real difference, however: I discovered that by warping to levels to try to test out the intermission screens, I'd skip them entirely. Since I hadn't yet created an entrance to the secret level, I created an entrance to it, tried it out in the game, and lo and behold, intermission screen, exactly where it was supposed to be!

A very nice tutorial as always, BrotherTank. I hadn't taken a look at the entering/exiting level stuff before, but now that you've gotten me started, there's a lot I want to look at.
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 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Add Text to Screen at Skill Level select - Chris
Author: Chris
3 2438 Tue Sep 28, 2010 6:59 pm
Tricob View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 2381 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 1969 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 2700 Sun Oct 26, 2003 1:21 am
Guest View latest post
No new posts [Code] Removing Signon, PG13, or Intro Screens - Chris
Author: Chris
6 1723 Thu Oct 16, 2003 1:43 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 subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group