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       

Enemy Blocking Object - By MCS
Page 1 of 1
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: 13 Sep 2017

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

PostPosted: Sun Aug 07, 2005 6:28 pm
   Subject: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

With this code change, guards (or any enemy) can't cross the blocking code....

Make the routines in WL_State.C look like the following:

::: CODE :::

#define CHECKDIAG(x,y)                  \
{                        \
   if (*(mapsegs[1]+farmapylookup[y]+x) == BLOCKGUARD) \
      return false;               \

   temp=(unsigned)actorat[x][y];            \
   if (temp)                  \
   {                      \
      if (temp<256)               \
         return false;            \
      if (((objtype *)temp)->flags&FL_SHOOTABLE)   \
         return false;            \
   }                     \
}

#define CHECKSIDE(x,y)                  \
{                        \
   if (*(mapsegs[1]+farmapylookup[y]+x) == BLOCKGUARD) \
      return false;               \

   temp=(unsigned)actorat[x][y];            \
   if (temp)                  \
   {                     \
      if (temp<128)               \
         return false;            \
      if (temp<256)               \
         doornum = temp&63;         \
      else if (((objtype *)temp)->flags&FL_SHOOTABLE)   \
         return false;            \
   }                     \


Then in WL_DEF.H we add:

#define BLOCKGUARD 100

The number 100 is the define number that must be added in your favorite map editor program as well. Then when placed on the floor (like a sprite object) the guards will not be able to cross that point.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 3:20 ago.

Topics: 160
Posts: 8008
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Aug 07, 2005 8:27 pm
   Subject: Re: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

While this keeps the enemies from ambushing and opening doors they shouldn't, it also stops enemies from coming after you through the doors with Block Codes in front of them.

What I'd like to do is have a map set up so the doors in question can be opened, but the player has to open it first. Say, the unlocked door is "locked" with an invisible key. Once that door is "unlocked", it stays unlocked, and only the player of the game has this invisible key.

I'd like that setup a lot better. How would one go about coding it?
Airslide
Don't Hurt Me
Don't Hurt Me


Joined: 08 Aug 2005
Last Visit: 02 Jan 2011

Topics: 8
Posts: 60

blank.gif

PostPosted: Mon Aug 08, 2005 1:53 pm
   Subject: Re: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I don't know, but couldn't you make it so that guard don't open locked doors if the player doesn't have the key? So if the door is locked and the player doesn't have the key, the enemy just turns around. That way, if the enemy is placed right, when you get a certain key he will come out of the door.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 3:20 ago.

Topics: 160
Posts: 8008
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Mon Aug 08, 2005 7:55 pm
   Subject: Re: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes, but it also keeps several of my "Locked Door traps" from working right. Besides, it's unlocked doors that ambushing guards are opening that I don't want them to. An "anti-ambush object" might work in that case, though. Hmmm ... Think
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

Topics: 45
Posts: 510
Location: Ohio
usa.gif

PostPosted: Thu Aug 18, 2005 1:07 pm
   Subject: Re: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I remember I had a issue with this feature in todpfad that it blocked rockets from missle launchers too (adam helped me fix it). But I only tested it with player shot rockets. Does this code allow missile launchers to shoot rockets through it?

_________________
Steam: http://steamcommunity.com/id/stormx312
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 3:20 ago.

Topics: 160
Posts: 8008
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Thu Aug 18, 2005 6:56 pm
   Subject: Re: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Probably not. However, I don't think adding extra code to let the rockets through would be terribly, terribly hard. I mean, you've already got the player-related code there as a reference. Very Happy
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Thu Aug 18, 2005 7:08 pm
   Subject: Re: Enemy Blocking Object - By MCS
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

@Tricob: Don't use it where you are creating a "Locked Door Trap".... this was just a good piece of code that MCS came up with a long while back to allow people to stop guards from entering certain places... (PS... you can always put the blocking code on the other side of the door... so that the enemy keeps opening the door trying to get at the player... Smile ). It's just another option to allow people to enhance the maps so that it changes players strategies...

@Kyle: I'll look into it... If it does block the "Missles and Fireballs" it can be easily modified to allow them through but block everything else....

Greg
BrotherTank
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 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 2381 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 1703 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 1969 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 2700 Sun Oct 26, 2003 1:21 am
Guest View latest post
No new posts [Help] Different Enemy Dying Frames/Views
Author: Guest
7 607 Tue Jul 29, 2003 3:00 pm
Codetech84 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