Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
iori

Door Code Question

Recommended Posts

Ok, so I'm messing with the doom source, and I have a predicament: I cannot find where the code for the Door topwait ( or topcountdown) is. In the door thinker, if the entry

bob->topwait = TIME
is present, the door will close after the time has passed.
A simple search of all the files in the source only point to 12 occurances, 11 of which are thinkers using topwait in either p_doors.c or p_genlin.c. The 12th is the definition for topwait, in p_spec.h.
typedef struct
{
    thinker_t   thinker;
    vldoor_e    type;
    sector_t*   sector;
    fixed_t     topheight;
    fixed_t     speed;

    // 1 = up, 0 = waiting at top, -1 = down
    int             direction;

    // tics to wait at the top
    int             topwait;
    // (keep in case a door going down is reset)
    // when it reaches 0, start going down
    int             topcountdown;

    //SoM: 3/6/2000: the line that triggered the door.
    line_t *line;
} vldoor_t;
So great, all this has shown me so far is that the integer 'topwait' is used to tell the door how long to stay open for. But Where is the code that counts the tics and tells the door to close after x time has passed? I am still fairly new at this, and I fear that I might not be in the right frame of mind. If anyone could lend a hand, it would be greatly appreciated.

FYI, what I am trying to accomplish here is to create some effects using floors and ceiling planes, and I want to apply a wait to ceiling thinker of this effect. I have spent enough time around the code to know how this aspect works, at least, but this wait time deal escapes me.

Share this post


Link to post

Heh, I've been trying to figure it out myself. But it has something to do with its thinker and topcountdown. But really can't say for sure... Quasar? Help?

Share this post


Link to post

I asked Quasar, but he told me to root through p_spec.c and look for EV_VerticalDoor. Well fine, that's all well and great, but it says nothing about the timing, so I guess I was unclear what I meant when I asked him. Oh well, hopefully I will get a response ^_^.

Share this post


Link to post

heh, EV_VerticalDoor isn't even in p_spec.c.. though its in p_spec.h which is stored for p_doors.c

Share this post


Link to post

I was going to tell Quasar that in IRC, but who am I to argue with the creator of Eternity, heh.
Anyway, it just does what all the rest of them do.. well, its cases anyway: thinker->topwait = x, which I already know.
At least it helps knowing that someone else has the same problem as me.

Share this post


Link to post

topwait is transferred to topcountdown which is the one which actually counts down. Both occur in p_doors.c (in the original source, could be different in ports).

Share this post


Link to post

Arg, I see, staring me straight in the face. Thanks a lot, I'll play with this tomorrow.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×