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] Vertically scrolling walls.
Page 1 of 1
DieHard Wolfers Forum Index -> 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
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 17 Jun 2019

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

PostPosted: Fri Mar 04, 2005 10:11 pm
   Subject: [Code] Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

We had walls that scrolled horizontally. Here's how to make them scroll vertically. I didn't tack this to the end of the other tutorial because this is done with a slightly different technique.

First off, if you haven't done so already, add the Wall Patches tutorial to your code.
http://diehardwolfers.areyep.com/viewtopic.php?t=2433

First, go to GetPatchNum and change it to return an int instead of unsigned. You also need to change "spot" to an int.
change the line that says "return 0;" to the following:
::: CODE :::
   {
      if (spot >= 13 && spot <= 16)
      {
         // For this example, the vertical
         //   scroll object codes are #13-16.
         // A negative spot is returned to indicate that
         //   the wall is to be scrolled vertically.
         return -spot;
      }
      return 0;
   }


Now go to ApplyPatch. Change "spot" to an int and add the following line right below it:
::: CODE :::
      byte scanpos,x,y;

Go to the last to lines, which read
::: CODE :::
   lastpatchnum = 0;
   return false;

and add this code immediately BEFORE those two lines:
::: CODE :::
   if (wallpic < DOORWALL)
   {
      switch (-spot)
      {
         case 13: // top down, fast
            scanpos = (frameon/2)%64;
            goto doverticalscroll;
         case 14: // top down, medium
            scanpos = (frameon/3)%64;
            goto doverticalscroll;
         case 15:
            scanpos = -((frameon/2)%64);
            goto doverticalscroll;
         case 16:
            scanpos = -((frameon/3)%64);
doverticalscroll:
            lastpatchnum = spot;
               scan = PM_GetPage(wallpic);
               for (x=0; x<64; x++)
                for (y=0; y<64; y++)
                   patchedwall[x+y*64] = *(scan+((64+x+scanpos)%64)+y*64);
             return true;
      }
   }


And you're done. To use these scrolling textures, place object codes 13, 14, 15 or 16 in the wall tile.
As BrotherTank mentioned, if you use MapEdit, you have to place the object before you place the wall, or it won't let you.

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


Last edited by Adam Biser on Thu Sep 14, 2006 9:27 pm; edited 2 times in total
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 5:20 ago.

Topics: 108
Posts: 1713
Location: A hole in the wall
australia.gif

PostPosted: Sat Mar 05, 2005 9:10 pm
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Cool Adam. This is something I have to put in Extremeties. I have some questions though:
Does this get rid of the garbled static that appeared in the other tutorial? I suppose thats why you've done this though.
How come this has to be put in the Wall Patches tutorial?

_________________
WolfSource - Your news source since the beginning of time (2019)
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 17 Jun 2019

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

PostPosted: Sat Mar 05, 2005 10:07 pm
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I use the wall patch tutorial so that you need a "built on the fly" wall texture in order to scroll vertically. You have to wrap each column individually. See what I mean? The wall patch tutorial gives you all the basic stuff you need, so all you have to do is those fwe changes. If you don't use wall patches, you can just edit out that part of the code.

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


Joined: 28 May 2004
Last Visit: 29 Mar 2008

Topics: 15
Posts: 263
Location: :noitacoL
blank.gif

PostPosted: Sun Mar 06, 2005 11:56 am
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

i'm not sure what you mean when you say making the walls scroll vertically. do you mean an animation? or are the walls actually moving?

_________________
z2 - ZZT Archive
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 17 Jun 2019

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

PostPosted: Sun Mar 06, 2005 12:51 pm
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The textures on walls will scroll up or down. The walls stay in the same spot, on the texture moves.

I also forgot to mention, this is controlled by placing an object inside the wall, in this example, the object codes are 13-16.

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


Joined: 12 Oct 2004
Last Visit: 5:20 ago.

Topics: 108
Posts: 1713
Location: A hole in the wall
australia.gif

PostPosted: Sun Mar 06, 2005 10:10 pm
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'm confused, so if your already using Wall Patches, do you add the functions again and rename them, or is this an addon to it? Does it allow you to use both Wall Patches and vertical scrolling?

_________________
WolfSource - Your news source since the beginning of time (2019)
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 17 Jun 2019

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

PostPosted: Mon Mar 07, 2005 6:21 am
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No, if you have wall patches in there already, don't re-add the code, just change what you have. Without some code changes, neither type of scrolling will work on a wall with patches. You can use them all on different walls, though. See what I mean?
This code is just an add-on for the wall patch code.

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


Joined: 12 Oct 2004
Last Visit: 5:20 ago.

Topics: 108
Posts: 1713
Location: A hole in the wall
australia.gif

PostPosted: Tue Mar 08, 2005 1:09 am
   Subject: Re: [Tutorial]Vertically scrolling walls.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Thank's Adam. That explains alot.

_________________
WolfSource - Your news source since the beginning of time (2019)
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> 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 Sticky: [Info] Help for newbie coders! C++ Tutorial
Author: Dugtrio17
20 11128 Sun Jan 10, 2010 12:26 pm
Fragstein3D View latest post
No new posts [Info] Fun with Textures - CFTextures/Sky/Rain/Snow Merge
Author: BrotherTank
25 9205 Wed Dec 20, 2006 2:30 pm
Rux View latest post
No new posts [Info] Black & White Effect - Tutorial
Author: Guest
10 299 Thu Mar 17, 2005 6:24 pm
Dugtrio17 View latest post
No new posts [Code] Run with Stamina - TekZK
Author: BrotherTank
8 3735 Sun May 16, 2004 12:54 am
Codetech84 View latest post
This topic is locked: you cannot edit posts or make replies. [Info] Source code for Darkone's NewWolf Classic
Author: Raistlin
1 2044 Tue Feb 10, 2004 10:18 am
BrotherTank 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