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       

[Help] Animated Floor
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
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 0:24 ago.

Topics: 97
Posts: 1506
Location: New Jersey
usa.gif

PostPosted: Mon Nov 02, 2009 11:30 pm
   Subject: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Is there any way to Animate The Floor Like Some mods i've played like Doom legion of Hell?

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Tue Nov 03, 2009 6:21 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It's probably possible using a modified version of the "Wall" animation tutorials, and also look into Tek-Zk's tutorial that makes the floor move as well.. That one is more of an overall swaying motion, but it's animated just the same...

Greg
BrotherTank
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 0:24 ago.

Topics: 97
Posts: 1506
Location: New Jersey
usa.gif

PostPosted: Tue Nov 03, 2009 7:52 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Nvm i figured it out last night.sry

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
lilmanjs
Bring 'em On
Bring 'em On


Joined: 27 May 2008
Last Visit: 30 Jul 2012

Topics: 5
Posts: 114

usa.gif

PostPosted: Tue Nov 03, 2009 2:27 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

could you post how its done for those who might want to do it in their mods

_________________
Leader of Team Aardwolf
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 0:24 ago.

Topics: 97
Posts: 1506
Location: New Jersey
usa.gif

PostPosted: Tue Nov 03, 2009 2:39 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

ok in wl_floorceiling.cpp do a search for

::: CODE :::
unsigned curbottex = curtex & 0xff;               
                    if (curbottex != lastbottex)
                    {
                        lastbottex = curbottex;
                        bottex = PM_GetTexture(curbottex);
                    }


add this under the "unsigned curbottex = curtex & 0xff;"

::: CODE :::
if (curbottex==151) // Whatever your wall ID is
                       curbottex+= (frameon>>2)&5;

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Nembo
Can I Play Daddy
Can I Play Daddy


Joined: 26 Feb 2006
Last Visit: 10 Jan 2018

Topics: 5
Posts: 35

usa.gif

PostPosted: Thu Nov 05, 2009 6:00 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You mean it should look like so...

::: CODE :::

unsigned curbottex = curtex & 0xff;               
                  if (curbottex==151) // Whatever your wall ID is
                       curbottex+= (frameon>>2)&5;
   
                    if (curbottex != lastbottex)
                    {
                        lastbottex = curbottex;
                        bottex = PM_GetTexture(curbottex);
                    }
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 0:24 ago.

Topics: 97
Posts: 1506
Location: New Jersey
usa.gif

PostPosted: Thu Nov 05, 2009 7:54 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Mine is close together..but it still works

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Nembo
Can I Play Daddy
Can I Play Daddy


Joined: 26 Feb 2006
Last Visit: 10 Jan 2018

Topics: 5
Posts: 35

usa.gif

PostPosted: Thu Nov 05, 2009 9:21 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Is there anything else that goes along with that code? Because it doesn't seem to do anything.
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 0:24 ago.

Topics: 97
Posts: 1506
Location: New Jersey
usa.gif

PostPosted: Thu Nov 05, 2009 9:23 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Nope this is my routine

::: CODE :::

unsigned curbottex = curtex & 0xff;               
                  if (curbottex==151) // Whatever your wall ID is
                       curbottex+= (frameon>>2)&5;
                    if (curbottex != lastbottex)
                    {
                        lastbottex = curbottex;
                        bottex = PM_GetTexture(curbottex);
                    }

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 22:23 ago.

Topics: 163
Posts: 8146
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Fri Nov 06, 2009 7:56 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Nembo wrote:
Is there anything else that goes along with that code? Because it doesn't seem to do anything.
Nembo, there are two things you should know about Richter's code. Smile

First, the tile is animated only if you use Wallnum 151 in floor textures. If it's in the ceiling, it won't be animated. Second, if you want it to use a Wallnum value other than 151, you'll have to change "151" to whatever Wallnum you choose. For example, if the Wallnum you wanted animated is 256, change the code to this:

::: CODE :::
unsigned curbottex = curtex & 0xff;               
                  if (curbottex==256) // Whatever your wall ID is
                       curbottex+= (frameon>>2)&5;
                    if (curbottex != lastbottex)
                    {
                        lastbottex = curbottex;
                        bottex = PM_GetTexture(curbottex);
                    }


Edit: Oh, yeah. "Frameon" needs to be initiated, as well. In WL_DRAW.CPP, search for "GLOBAL VARIABLES". You should find something like this:

::: CODE :::
/**************************************************************************
**                          GLOBAL VARIABLES                             **
**************************************************************************/

static byte *vbuf = NULL;
unsigned    vbufPitch = 0;
int32_t     lasttimecount;

Right below that, add this:
::: CODE :::
int32_t     frameon;

Then do a search for "Players Vision". You should be brought to something like this:

::: CODE :::
void DrawScaleds (void)  // Draw Sprites in Players Vision (line of sight)
{
    int       i,least,numvisable,height;
    byte      *tilespot,*visspot;
    unsigned  spotloc;
    statobj_t *statptr;
    objtype   *obj;
    int       spriteadd=0;

    visptr = &vislist[0];

Below that, add this:
::: CODE :::
// Animated Objects code
    frameon+=tics;
    frameon%=2520;  // remember 70 tics/second
// End Animated Objects code
I chose the number 2520 because it's evenly divisible by all numbers from One to Ten.

Now go to WL_PLAY.CPP. In "PlayLoop", look for the code:

::: CODE :::
    lasttimecount = GetTimeCount();

Below that, add:
::: CODE :::
    frameon = 0;

Lastly, in WL_DEF.H, do a search for "lasttimecount". You should see something like this:
::: CODE :::
extern  int32_t   lasttimecount;

Add this right below it:
::: CODE :::
extern  int32_t   frameon;
I believe that should do it. Smile


Last edited by Tricob on Fri Nov 06, 2009 8:13 pm; edited 1 time in total
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 0:24 ago.

Topics: 97
Posts: 1506
Location: New Jersey
usa.gif

PostPosted: Fri Nov 06, 2009 8:11 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

hmm I can be a SDL coder wiz....lol no I wont make it tho..lol

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Nembo
Can I Play Daddy
Can I Play Daddy


Joined: 26 Feb 2006
Last Visit: 10 Jan 2018

Topics: 5
Posts: 35

usa.gif

PostPosted: Fri Nov 06, 2009 10:17 pm
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Thanks tricob, I was missing the part under players vision.
Fragstein3D
DieHard Guard
DieHard Guard


Joined: 06 Dec 2009
Last Visit: 17 Mar 2010

Topics: 13
Posts: 200


PostPosted: Thu Jan 14, 2010 9:28 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

unsigned curbottex = curtex & 0xff;
if (curbottex != lastbottex)
{
lastbottex = curbottex;
bottex = PM_GetTexture(curbottex);
}

could someone explain those things in laymans terms? Razz
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 12 Jun 2018

Topics: 87
Posts: 756
Location: Wisconsin
usa.gif

PostPosted: Thu Jan 14, 2010 10:31 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

unsigned curbottex = curtex & 0xff;

well this line is saying that curbottex is equal to curtex shifted to low bit

if (curbottex != lastbottex)

if curbottex is not equal to lastbottex

then do this:

lastbottex = curbottex;
bottex = PM_GetTexture(curbottex);

making lastbottex equal to curbottex
and bottex is assigned the texture curbottex

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 4:11 ago.

Topics: 72
Posts: 3750

blank.gif

PostPosted: Thu Dec 28, 2017 7:23 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
::: CODE :::
unsigned curbottex = curtex & 0xff;               
                  if (curbottex==256) // Whatever your wall ID is
                       curbottex+= (frameon>>2)&5;
                    if (curbottex != lastbottex)
                    {
                        lastbottex = curbottex;
                        bottex = PM_GetTexture(curbottex);
                    }



How can I make it display 5 frames? When it's '&3' it cycles through 4 frames on my end, but when I change it to '&4' it all of a sudden only shows 2 frames.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 22:23 ago.

Topics: 163
Posts: 8146
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Thu Dec 28, 2017 9:32 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

What happens if you change ">>2" instead of "&5"? If the animation speed is too high, it'll skip frames when the game's framerate drops.
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 4:11 ago.

Topics: 72
Posts: 3750

blank.gif

PostPosted: Thu Dec 28, 2017 10:43 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The animation cycles more slowly, but I still get the same problem: at &3 it cycles through 4 frames, at &4 only 2.
Aryan_Wolf3D
I am Death Incarnate
I am Death Incarnate


Joined: 21 Jul 2011
Last Visit: 22 Jun 2018

Topics: 6
Posts: 182

blank.gif

PostPosted: Thu Dec 28, 2017 10:44 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@ronwolf1705 Try changing the "&" to "%".

_________________
"Way too many #ifdefs in the code!" - John Carmack
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 4:11 ago.

Topics: 72
Posts: 3750

blank.gif

PostPosted: Fri Dec 29, 2017 3:47 am
   Subject: Re: [Help] Animated Floor
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

That did the trick, thanks! Smile
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 [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 9682 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 2780 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 2996 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 2953 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 3006 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