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] Textured Floor/Ceiling - By Darkone
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: Sat Apr 19, 2003 7:45 pm
   Subject: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Darkone's Textured Floor/Ceiling Mod - Edited for Understanding

The purpose of this tutorial is to make textured floor/ceiling in Wolf3D. This feature will give your engine the best boost in visual quality, so let’s get to work:

Open the WL_DRAW.C file and find the following line:

::: CODE :::

unsigned  wallheight[MAXVIEWWIDTH];


And modify it to look like this:

::: CODE :::

unsigned  wallheight[MAXVIEWWIDTH], min_wallheight;


Then edit the CalcHeight (void) function to look like:

::: CODE :::

int   CalcHeight (void)
{
   int   transheight;
   int ratio;
   fixed gxt,gyt,nx,ny;
   long   gx,gy;

   gx = xintercept-viewx;
   gxt = FixedByFrac(gx,viewcos);

   gy = yintercept-viewy;
   gyt = FixedByFrac(gy,viewsin);

   nx = gxt-gyt;

  //
  // calculate perspective ratio (heightnumerator/(nx>>8))
  //
   if (nx<mindist)
      nx=mindist;  // don't let divide overflow

   asm   mov   ax,[WORD PTR heightnumerator]
   asm   mov   dx,[WORD PTR heightnumerator+2]
   asm   idiv   [WORD PTR nx+1]         // nx>>8
// Darkone's Textured Ceiling Floor Addtional Code

// update min_wallheight
  asm mov bx,[min_wallheight]
  asm cmp ax,bx
  asm jae noupdate:
  asm mov [min_wallheight],ax
  noupdate:;
// End Addtional Code

}


Then add the following macro declaration just before the start of vgaCeiling array declaration:

::: CODE :::


#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/



Now we are about to write the main texturing code....

Add this function just after vgaCeiling array declaration:

::: CODE :::
 
// ------------------------- * Textured flats * -------------------------
/*
** Draw Textured Floor/Ceiling
*/

void DrawFlats(unsigned tex_f, unsigned tex_c)
{
  int x, y, y0, halfheight;
  unsigned top_offset0, bot_offset0, top_offset, bot_offset;
  unsigned top_add, bot_add;
  byte p, color;
  byte far *src_bot, far *src_top;
  fixed dist;            // distance to row projection
  fixed tex_step;        // global step per one screen pixel
  fixed gu, gv, du, dv; // global texture coordinates
  int u, v;              // local texture coordinates

// ------ * prepare * --------

  halfheight=viewheight>>1;
  y0=min_wallheight>>3;      // starting y value
  if(y0>halfheight) return;  // view obscued by walls
  if(y0==0) y0=1;           // don't let division by zero
  top_offset0=80*(halfheight-y0-1);  // and will decrease by 80 each row
  bot_offset0=80*(halfheight+y0);  // and will increase by 80 each row

  src_bot=PM_GetPage(tex_f); // load floor texture
  src_top=PM_GetPage(tex_c); // load ceiling texture

// draw horizontal lines

  for(p=0; p<4; p++)
  {
    asm mov ax,0x0102
    asm mov cl,[p]
    asm shl ah,cl
    asm mov dx,0x3c4
    asm out dx,ax

    for(y=y0, top_offset=top_offset0, bot_offset=bot_offset0; y<halfheight; y++, top_offset-=80, bot_offset+=80)
    {
      dist=(heightnumerator/y)<<5;
      gu= viewx+FixedByFrac(dist, viewcos);
      gv=-viewy+FixedByFrac(dist, viewsin);
      tex_step=(dist<<8)/viewwidth/175;
      du= FixedByFrac(tex_step, viewsin);
      dv=-FixedByFrac(tex_step, viewcos);
      gu-=((viewwidth>>1)-p)*du;
      gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
      du<<=2; // 4pix step
      dv<<=2;
      for(x=p, top_add=top_offset, bot_add=bot_offset; x<viewwidth; x+=4, top_add++, bot_add++)
      {
        if(wallheight[x]>>3<=y)
        {
          u=(gu>>10)&63; v=(gv>>10)&63;
          color=*(src_top+((63-u)<<6)+(63-v));

// draw top pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[top_add]
          asm mov al,[color]
          asm mov es:[di],al

          color=*(src_bot+(u<<6)+(63-v));

// draw bottom pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[bot_add]
          asm mov al,[color]
          asm mov es:[di],al
        }
        gu+=du; gv+=dv;
      }
    }
  }
}



Be careful with it entering the above routine as it’s big and it’s easy to miss something.

After that change VGAClearScreen from:

::: CODE :::

void VGAClearScreen (void)

to:
::: CODE :::

void VGAClearScreen(unsigned ceiling)

and then comment out or remove this next line:
::: CODE :::

unsigned ceiling=vgaCeiling[gamestate.episode*10+mapon];

As you see I’ve removed ceiling variable from the function and added a parameter with the same name.

The last thing we will modify is ThreeDRefresh function (Be Careful) so it looks like this:

::: CODE :::

void ThreeDRefresh (void)
{
    int tracedir;
    unsigned ceiling;
    boolean flats;

<..stuff skipped..>

//
// follow the walls from there to the right, drawwing as we go
//

    ceiling=vgaCeiling[gamestate.episode*10+mapon];
    if((ceiling>>8)==(ceiling&0xFF))
    {
          VGAClearScreen(ceiling);
          flats=false;
    }
    else
    {
          flats=true;
          ceiling=((ceiling&0xFF)-1)<<1;
    }

    WallRefresh();

    if(flats)
          DrawFlats(ceiling, ceiling+1); // draw textured floor/ceiling

<..stuff skipped to end of routine..>



Ok, enough coding, let’s learn how to use this feature. First you should find a pair of images: one for floor, one for ceiling texture. They should look like texture, of course this is not a must, but it would look silly. Then I used FloEdit to import them to my data files. I used indexes 62 and 63 (note that first index must be even and second index must be equal to first plus 1. This would make MAP-ID the same for both of them!), and remembered MAP-ID, 32 in this case.

Then I’ve chosen a level(s) to be textured using these textures (for simplicity it would be e1m1).

So I modified vgaCeiling array like that:
::: CODE :::

unsigned vgaCeiling[]=
{
#ifndef SPEAR
 USE_TEX(32),0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd

#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};



Note that I used MAP-ID, I remembered!
That’s all. I’ve built .exe and started it.

If you've done things correctly, you will now have ceiling and floor textures.

Voila! That’s it!

I hope this thing helped you on your way to create the best Wolf3D conversion ever made. If so, just drop me a line on DarkOne@navigators.lv. I wish to see your work!


----------------------

Enjoy

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: Sat Jul 17, 2004 9:39 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

lol sorry, i know it all goes into wl_draw, but where i put it, doesnt seem to work, like give me a clue where to put it.
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 12 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Sat Jul 17, 2004 9:53 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Put the macro declaration into the code as follows:

"}
#endif
//==========================================================================

#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/


unsigned vgaCeiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,

0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd
#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};

/*
====================="

Then place the funtion here:

"}
#endif
//==========================================================================

#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/


unsigned vgaCeiling[]=
{
#ifndef SPEAR
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,

0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd
#else
0x6f6f,0x4f4f,0x1d1d,0xdede,0xdfdf,0x2e2e,0x7f7f,0x9e9e,0xaeae,0x7f7f,
0x1d1d,0xdede,0xdfdf,0xdede,0xdfdf,0xdede,0xe1e1,0xdcdc,0x2e2e,0x1d1d,0xdcdc
#endif
};

// ------------------------- * Textured flats * -------------------------
/*
** Draw Textured Floor/Ceiling
*/

void DrawFlats(unsigned tex_f, unsigned tex_c)
{
int x, y, y0, halfheight;
unsigned top_offset0, bot_offset0, top_offset, bot_offset;
unsigned top_add, bot_add;
byte p, color;
byte far *src_bot, far *src_top;
fixed dist; // distance to row projection
fixed tex_step; // global step per one screen pixel
fixed gu, gv, du, dv; // global texture coordinates
int u, v; // local texture coordinates

// ------ * prepare * --------

halfheight=viewheight>>1;
y0=min_wallheight>>3; // starting y value
if(y0>halfheight) return; // view obscued by walls
if(y0==0) y0=1; // don't let division by zero
top_offset0=80*(halfheight-y0-1); // and will decrease by 80 each row
bot_offset0=80*(halfheight+y0); // and will increase by 80 each row

src_bot=PM_GetPage(tex_f); // load floor texture
src_top=PM_GetPage(tex_c); // load ceiling texture

// draw horizontal lines

for(p=0; p<4; p++)
{
asm mov ax,0x0102
asm mov cl,[p]
asm shl ah,cl
asm mov dx,0x3c4
asm out dx,ax

for(y=y0, top_offset=top_offset0, bot_offset=bot_offset0; y<halfheight; y++, top_offset-=80, bot_offset+=80)
{
dist=(heightnumerator/y)<<5;
gu= viewx+FixedByFrac(dist, viewcos);
gv=-viewy+FixedByFrac(dist, viewsin);
tex_step=(dist<<Cool/viewwidth/175;
du= FixedByFrac(tex_step, viewsin);
dv=-FixedByFrac(tex_step, viewcos);
gu-=((viewwidth>>1)-p)*du;
gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
du<<=2; // 4pix step
dv<<=2;
for(x=p, top_add=top_offset, bot_add=bot_offset; x<viewwidth; x+=4, top_add++, bot_add++)
{
if(wallheight[x]>>3<=y)
{
u=(gu>>10)&63; v=(gv>>10)&63;
color=*(src_top+((63-u)<<6)+(63-v));

// draw top pixel using <color>

asm mov es,[screenseg]
asm mov di,[bufferofs]
asm add di,[top_add]
asm mov al,[color]
asm mov es:[di],al

color=*(src_bot+(u<<6)+(63-v));

// draw bottom pixel using <color>

asm mov es,[screenseg]
asm mov di,[bufferofs]
asm add di,[bot_add]
asm mov al,[color]
asm mov es:[di],al
}
gu+=du; gv+=dv;
}
}
}
}


/*
====================="

Perhaps not the best way to display the positions for code insertion, but it's the best I can do for now.

The blue colour signifies the current insertion.
The red colour signifies a previous insertion.

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

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

PostPosted: Sat Jul 17, 2004 10:53 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

hmmm now how do i get the textures too show Confused or should i say i don't understand the last bit... sorry im only a dumb @ss
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 08 Feb 2010

Topics: 56
Posts: 563
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Sun Jul 18, 2004 6:59 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wolfenstein is nothing without an odd dumbass now and then. Twisted Evil

andy3012 wrote:
how do i get the textures too show


Ok if you look at the following inserted information:
::: CODE :::
#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/

It tells you exactly how to display your floor & ceiling textures, it's even explained in the tutorial it self. It took me quite a bit of time before I understood on how to display the textures, so I suggest go through tutorial again and use your noggen(head) and none of us are going to spoon feed you the info you need, unless you really don't know how to think Too Cool

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

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

PostPosted: Sun Jul 18, 2004 8:33 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Crying or Very sad i still don't understand, what do i do

#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/

where it says Use_TEX(N) do i put the number of my floor, or the level i want to use it in.

and here #define USE_TEX(page) (0x0000|(page)) what do i do? I don't understand sorry folks
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 12 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Sun Jul 18, 2004 9:59 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Just think - Haasboy is right here. Whenever you get stuck programming, the first thing you will want to do is to at least attempt to solve the problem alone, but it's all in black and white:

unsigned vgaCeiling[]=
{
#ifndef SPEAR
USE_TEX(32),0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xbfbf,
0x4e4e,0x4e4e,0x4e4e,0x1d1d,0x8d8d,0x4e4e,0x1d1d,0x2d2d,0x1d1d,0x8d8d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x1d1d,0x2d2d,0xdddd,0x1d1d,0x1d1d,0x9898,
0x1d1d,0x9d9d,0x2d2d,0xdddd,0xdddd,0x9d9d,0x2d2d,0x4d4d,0x1d1d,0xdddd,
0x7d7d,0x1d1d,0x2d2d,0x2d2d,0xdddd,0xd7d7,0x1d1d,0x1d1d,0x1d1d,0x2d2d,
0x1d1d,0x1d1d,0x1d1d,0x1d1d,0xdddd,0xdddd,0x7d7d,0xdddd,0xdddd,0xdddd


That is the ceiling colour code. Sixty levels. Sixty colours. One "USE_TEX" command. Just remeber what wall Ids are...

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

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

PostPosted: Sun Jul 18, 2004 10:39 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Confused still don't get it lol
Guest




Last Visit:





PostPosted: Sun Jul 18, 2004 10:48 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@andy3012: If you can't get these floor/ceiling to work, then it is not worth to do this thing and forget about this function! That's alot of waste your time to ask someone to help you out...

FOLLOW THE STEP BY STEP OF FLOOR / CEILING TUTORIAL BEFORE YOU CAN UNDERSTAND Wink

I did it before and failed 100 times, forget it for now.. then I did the Outside atmosphere tutorial and got it work w/o any problem. Neutral
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 08 Feb 2010

Topics: 56
Posts: 563
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Sun Jul 18, 2004 11:47 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

sentenced wrote:
Haasboy is right here

Thank You.

It's irritating when you get a newbie who tries a code out that 1000s others tried successfully and then you get one person who is to lazy to try and ready/understand how a code works, but since we're spoon feeders, I might as well as help andy out, ok now open your mouth for some spoon feeding;


The USE_TEX(n) is used instead of the 0x0000 code (ceiling colour), the "n" is the number of the wall graphics you be using for the floor and ceiling textures you'll be using. So if you used USE_TEX(0) you be using the first two images









NB - Brothertank don't delete it'll save time when another newbie asks another stupid question

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

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

PostPosted: Sun Jul 18, 2004 11:48 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

well even tho im almost there, ill do as u say. Hmmm I doubt if i'll continue my project, because every single code i try add to my game never works!!! apart from the odd things, like death artifact. and summat else...
sentenced
DieHard SS
DieHard SS


Joined: 13 Mar 2004
Last Visit: 12 Oct 2009

Topics: 5
Posts: 381
Location: Liverpool, England
sao_tome.gif

PostPosted: Sun Jul 18, 2004 1:04 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
well even tho im almost there, ill do as u say. Hmmm I doubt if i'll continue my project, because every single code i try add to my game never works!!! apart from the odd things, like death artifact. and summat else...


At least be grateful that somebody has spent the effort to help you out! "Every single code" you add to your game never works because you have made a mistake when following the tutorial. My advice to you:

Read everything carefully, execute everything carefully and work out mistakes in your own time.

_________________
"Listen and exchange with me, as we both share in common a different value system."
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

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

PostPosted: Sun Jul 18, 2004 2:52 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I am greatful, I just wish i could put all these codes into my game... I soon hope with experience ill grow to learn, but thanks for helping anyway

EDIT: DUDE Oh my god, i just got it to work, I realised on the ThreeD bit I erased something that i displays stuff, dude thank you guys Ever so Much!


Last edited by andy3012 on Sun Jul 18, 2004 3:17 pm; edited 1 time 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: Sun Jul 18, 2004 3:10 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

andy3012 wrote:
I am greatful, I just wish i could put all these codes into my game... I soon hope with experience ill grow to learn, but thanks for helping anyway


I guess the problem here is that you want to install these modifications to the code and you don't understand them or the original code.

Andy, The "unsigned VGACeiling[]" is an array. It holds the ceiling colours for the game. Each one of the values ie: 0x1d1d is a colour for a floor. The first 60 definitions are for the Wolfenstein side of the code, and the second 21 are for the Spear of Destiny side of the code.

What Darkone did in this tutorial is the following:

If you want a colour for the ceiling for a particular level, then you leave that array pointing to the colour... ie 0x1d1d (gray). If you want to have a texture, then you replace the colour code with "USETEX (number)" - where the number refers to a texture in your vswap. In his example he used "USETEX (1)" which replaced the first floor colour of 0x1d1d.

If you have entered everything properly, and it compiles properly, then you should get the gray stone wall as you floor and ceiling texture on level 1.

If it compiled properly, but you didn't get the texture when you run your game, chances are that you left the original "unsigned vgaCeiling[]" array in your code. Replace (read remove) the original with the new one he provided. Compile and try again.

This tutorial does work, and has been proven to work. But my first suggestion would be to learn more about the code itself. I would suggest going to the Dome or somewhere where they have basic tutorials on changing things within the code. Start with the basics, and learn the code. When you are done, these more difficult tutorials will still be here, waiting for you to install.

Greg
BrotherTank
JackaL
DieHard SS
DieHard SS


Joined: 25 Jun 2004
Last Visit: 25 Sep 2006

Topics: 29
Posts: 333
Location: Marton, New Zealand
newzealand.gif

PostPosted: Wed Feb 23, 2005 7:54 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmmm, I have inserted the stars/snow effect in the 1st and 20th level, then how can I make the texture just display on the floor of those levels, as it displays on ceiling also, but I need that for the stars. Is there a way around this? Ther would be because its done in EoD.

_________________
Hate is anger. Anger gives you strength. Strength makes you powerful...
Haasboy
DieHard Officer
DieHard Officer


Joined: 23 Jul 2003
Last Visit: 08 Feb 2010

Topics: 56
Posts: 563
Location: South Africa, Johannesburg
southafrica.gif

PostPosted: Wed Feb 23, 2005 5:21 pm
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

A Tutorial has been replaced for combining both of these tutorials, I would give a direct link, but I don't have the link on hand. The tutorial can be found in the "Code Tutorials" section.

_________________
Haasboy Engine - Currently under construction (To be used with future mods - F.A.D.E.D. - Mansion X - Rising Evil Series)
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 10:49 pm
   Subject: Texture Terror
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Quote:
#define USE_TEX(page) (0x0000|(page))
/*
** use USE_TEX(n) to use floor/ceiling textures for given level
** n should be 1..255 !!!
** it is MAP-ID (from FloEdit). First texture goes to floor, second to ceiling
*/



I don't have FloEdit. Will this tutorial work anyway, or I'll have change some things in it?
I'm confused now :S

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
andy3012
DieHard Guard
DieHard Guard


Joined: 02 Jul 2004
Last Visit: 15 Feb 2008

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

PostPosted: Wed Mar 30, 2005 9:22 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes the code will work, Darkone just left a comment saying in Floedit the first texture goes to the floor and the second goes to the ceiling, So its like your Light blue wall will go on the floor and your Dark blue wall will go on the ceiling.
Reactor
DieHard Guard
DieHard Guard


Joined: 17 Mar 2005
Last Visit: 06 Feb 2010

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

PostPosted: Wed Mar 30, 2005 9:51 am
   Subject: Texture terror act 2.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm, okay. So no problem with that.
And how can I insert floor and ceiling graphics, like in End of Destiny? It's a bit idiotic to have just a deep blue ceiling with a cyan floor. Do I need to make something else with the source code?

_________________
INCOMING TRANSMISSION
"Marine! Er....never mind..."
TRANSMISSION ENDS
Guest




Last Visit:





PostPosted: Wed Mar 30, 2005 10:41 am
   Subject: Re: [Code] Textured Floor/Ceiling - By Darkone
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

What do you mean like EOD? Do you want map control?

The code Brother Tank wrote on map control is for solid ceiling and floor but should tell you how to make it with texture floor and ceiling.
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