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       

How difficult would it be to add a "super locked"
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
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 01 May 2018

Topics: 64
Posts: 566

blank.gif

PostPosted: Sun Jun 19, 2016 6:38 pm
   Subject: How difficult would it be to add a "super locked"
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

If I wanted to add a new locked door that required all four keys to open instead of just one key, using the existing locked door graphic, how difficult would that be? If its too difficult, I probably won't want to do it for Wolf Forever Phase 1 since it's so close to release, but if it's simple, it would be perfect for a map I just finished.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 23 Sep 2018

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

PostPosted: Sun Jun 19, 2016 8:06 pm
   Subject: Re: How difficult would it be to add a "super locked"
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hi Barry,

You could try this: Open WL_DEF.H and add this in purple (including the comma after dr_elevator):

::: CODE :::
typedef enum {
   dr_normal,
   dr_lock1,
   dr_lock2,
   dr_lock3,
   dr_lock4,
   dr_elevator,
   dr_super

} door_t;

Then open up WL_GAME.C and in the spawn doors section of SetupGameLevel() change tile <= 101 to 103 and add two cases:

::: CODE :::
         tile = *map++;
         if (tile >= 90 && tile <= 103)
         {
         // door
            switch (tile)
            {
            case 90:
            case 92:
            case 94:
            case 96:
            case 98:
            case 100:
            case 102:

               SpawnDoor (x,y,1,(tile-90)/2);
               break;
            case 91:
            case 93:
            case 95:
            case 97:
            case 99:
            case 101:
            case 103:

               SpawnDoor (x,y,0,(tile-91)/2);
               break;
            }
         }

Then open up WL_DRAW.C and add a dr_super case into both HitHorizDoor() and HitVertDoor() so it shows the right texture:

::: CODE :::
      switch (doorobjlist[doornum].lock)
      {
      case dr_normal:
         doorpage = DOORWALL;
         break;
      case dr_lock1:
      case dr_lock2:
      case dr_lock3:
      case dr_lock4:
      case dr_super:

         doorpage = DOORWALL+6;
         break;
      case dr_elevator:
         doorpage = DOORWALL+4;
         break;
      }

Then add this 'else if' into OperateDoor() of WL_ACT1.C so it checks if all 4 keys have been acquired before opening:

::: CODE :::
   lock = doorobjlist[door].lock;
   if (lock >= dr_lock1 && lock <= dr_lock4)
   {
      if ( ! (gamestate.keys & (1 << (lock-dr_lock1) ) ) )
      {
         SD_PlaySound (NOWAYSND);      // locked
         return;
      }
   }
   else if (lock == dr_super && gamestate.keys != 15)
   {
      SD_PlaySound (NOWAYSND);      // locked
      return;
   }



   switch (doorobjlist[door].action)

Then add the map defines for the new super door somewhere into the MAPDATA file for Mapedit so it can be used:

::: CODE :::
0066 d070 Super Locked N/S
0067 d060 Super Locked E/S

I think that's it. gamestate.keys == 15 is the equivalent of key1 (1) + key2 (2) + key3 (4) + key4 (8) as they're saved in bits.
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 01 May 2018

Topics: 64
Posts: 566

blank.gif

PostPosted: Sun Jun 19, 2016 10:30 pm
   Subject: Re: How difficult would it be to add a "super locked"
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

That worked!! Thanks a lot!!

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
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 Guards using other weapons...
Author: andy3012
19 3596 Fri Feb 25, 2005 9:48 am
andy3012 View latest post
No new posts Altering the "This Episode is not in the shareware!&quo
Author: Guest
1 71 Mon Aug 30, 2004 1:16 am
TexZK View latest post
No new posts [Info] Which Guards can/can't open doors
Author: Ringman
2 1459 Sat Feb 07, 2004 11:38 am
Codetech84 View latest post
No new posts [Help] New locked door that only opens once?
Author: nova
2 107 Mon Nov 03, 2003 2:21 pm
jamez View latest post
No new posts [Info] Adding Locked Doors
Author: Guest
3 244 Thu Apr 17, 2003 6:30 am
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