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] Doors close automatically
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
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:32 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Mon Aug 12, 2013 6:11 pm
   Subject: [Help] Doors close automatically
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I'm currently trying to enable a check for doors that won't close automatically, and so far it seems to of worked, but while the code does work, it doesn't work completely.

My Automatic Door Closing code looks like this:

::: CODE :::
/*
===============
=
= DoorOpen
=
= Close the door after three seconds
=
===============
*/

void DoorOpen (int door)
{
    // This splits up doors to either open/close automatically
    // or they have to be closed by hand
    switch (door)
    {
        case dr_normal:
        case dr_elevator:
            if ( (doorobjlist[door].ticcount += (short) tics) >= OPENTICS)
                CloseDoor (door);
            break;
        case dr_lock1:
        case dr_lock2:
        case dr_lock3:
        case dr_lock4:
            // Do not close door automatically
            break;
    }
    //if ( (doorobjlist[door].ticcount += (short) tics) >= OPENTICS) // These two lines of code behave normally when activated
        //CloseDoor (door); // These two lines of code behave normally when activated
}

The original code works fine, but when I toggle this code, the game behaves very oddly (such as specific doors closing when supposed to, and others not even though they're the same type of door and facing the same direction).

I've witnessed this odd behavior:
1. Doors I've set to close automatically don't while others that I've set to never close will (such as a locked door).
2. Doors facing specific angles will close, but oddities occur even amongst those (The Northern-most doors will close, but the southern-most won't).
3. It seems that according to how the game likes to spawn the Doors, even if I try to set dr_normal to close and dr_elevator to stay open, the opposite will be true (The elevator door will close and the regular door will stay open).

Can someone help me out, or provide a working code string to fix my problem?

_________________
- Taking a hiatus from Wolfenstein for a while...

...But I'll be back, you can count on it!
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 13 Sep 2018

Topics: 55
Posts: 2139
Location: Canada
blank.gif

PostPosted: Mon Aug 12, 2013 8:04 pm
   Subject: Re: [Help] Doors close automatically
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If you change your switch line to this it should behave better:

::: CODE :::
    switch (doorobjlist[door].lock)
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 8:32 ago.

Topics: 95
Posts: 911
Location: California
usa.gif

PostPosted: Mon Aug 12, 2013 11:22 pm
   Subject: Re: [Help] Doors close automatically
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Thanks. That seems to have done the trick.

_________________
- Taking a hiatus from Wolfenstein for a while...

...But I'll be back, you can count on it!
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 10853 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 2998 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 3286 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3204 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 3264 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