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       

Statics that drain health
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
Barry
DieHard Officer
DieHard Officer


Joined: 27 Aug 2008
Last Visit: 28 Oct 2017

Topics: 64
Posts: 565

blank.gif

PostPosted: Tue Nov 29, 2016 10:17 am
   Subject: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

How would I create a static object that drains health when BJ walks over it but is not picked up by the player? I want it to function like the poison in Doom. I think I could use a Pac-Man ghost enemy by making it stationary, but I don't really want to do that unless it's the only way to do it. Thanks!

_________________
Atomprojekt Download: http://www.wolfenvault.com/files/barry/ATOM.3.zip
Passage to Hollenteufel Download: http://www.wolfenvault.com/files/barry/PTH.2.zip
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:03 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Tue Nov 29, 2016 1:24 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I think the easiest way to do this would be make a new pickup as normal, but in the piece for it in GetBonus use "return;" instead of "break;". This should prevent it being deleted. You might also want to add a timer so you can only take damage once every so often.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:36 ago.

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

PostPosted: Tue Nov 29, 2016 2:15 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

The problem with this type of coding is that - if you stand directly over it - it won't drain your health. You're better off scanning the Objects plane in DrawFace (WL_AGENT.CPP) and doing a TIC-based routine. Just make sure it's done at the very beginning of the code, or it'll be skipped every time the HUD is in FullScreen mode.
Chris
DieHard Wolfer
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 17 Dec 2017

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

PostPosted: Tue Nov 29, 2016 2:38 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

There's a thread about "lava tiles" here too:

http://diehardwolfers.areyep.com/viewtopic.php?t=7292
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:03 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Tue Nov 29, 2016 6:21 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
The problem with this type of coding is that - if you stand directly over it - it won't drain your health. You're better off scanning the Objects plane in DrawFace (WL_AGENT.CPP) and doing a TIC-based routine. Just make sure it's done at the very beginning of the code, or it'll be skipped every time the HUD is in FullScreen mode.


It should; placing the 'return' in place of the 'break' should stop it being deleted, which should trigger GetBonus every frame when it would have been picked up. It's not the best way of doing it though; damaging floors are a much better option.
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 10 Oct 2017

Topics: 91
Posts: 464

usa.gif

PostPosted: Sat Dec 03, 2016 3:08 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

AlumiuN wrote:
I think the easiest way to do this would be make a new pickup as normal, but in the piece for it in GetBonus use "return;" instead of "break;". This should prevent it being deleted. You might also want to add a timer so you can only take damage once every so often.


This wouldn't work well. In Wolf3D, the player can avoid picking up items by being at certain angles when moving over them.

On E2 L9 of Temporary Insanity, this allows you to avoid having to navigate the maze of blue keys.

The player can also pick up items without being directly over them.

On E2 L3 of Temporary Insanity, at one point, two Hans Grosses are triggered when you pick up a blue key. You are supposed to have to push a block to block a door to trap them. But if you're at certain angles, you can pick up the key without triggering them.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:36 ago.

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

PostPosted: Sat Dec 03, 2016 3:42 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Matthew wrote:
This wouldn't work well. In Wolf3D, the player can avoid picking up items by being at certain angles when moving over them.
In the DOS version, yes. But this is corrected in the SDL port.
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 2:03 ago.

Topics: 37
Posts: 2401
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sat Dec 03, 2016 7:01 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Matthew wrote:
AlumiuN wrote:
I think the easiest way to do this would be make a new pickup as normal, but in the piece for it in GetBonus use "return;" instead of "break;". This should prevent it being deleted. You might also want to add a timer so you can only take damage once every so often.


This wouldn't work well. In Wolf3D, the player can avoid picking up items by being at certain angles when moving over them.

On E2 L9 of Temporary Insanity, this allows you to avoid having to navigate the maze of blue keys.

The player can also pick up items without being directly over them.

On E2 L3 of Temporary Insanity, at one point, two Hans Grosses are triggered when you pick up a blue key. You are supposed to have to push a block to block a door to trap them. But if you're at certain angles, you can pick up the key without triggering them.


I never said it was the best way of doing it, only the easiest. Razz

The lava floor tiles code is a much better way of doing it.
Matthew
DieHard SS
DieHard SS


Joined: 02 Jul 2007
Last Visit: 10 Oct 2017

Topics: 91
Posts: 464

usa.gif

PostPosted: Sat Dec 03, 2016 8:23 pm
   Subject: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Tricob wrote:
You're better off scanning the Objects plane in DrawFace (WL_AGENT.CPP) and doing a TIC-based routine. Just make sure it's done at the very beginning of the code, or it'll be skipped every time the HUD is in FullScreen mode.


This doesn't make any sense.

You should do it in "PlayLoop" in "wl_play.cpp". If you want, you can create a separate function for it, which is called in "PlayLoop".

For anything that is done every frame, that is the way to do it.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 0:36 ago.

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

PostPosted: Sat Dec 03, 2016 8:33 pm
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It should've been UpdateFace, but yes - I'll agree yours is a better idea. I actually remember kind of scratching my head when I saw some code using UpdateFace instead of PlayLoop. I was thinking there was a better way of doing it, but then I quickly forgot about it. Smile
KyleRTCW
DieHard Officer
DieHard Officer


Joined: 30 Jul 2003
Last Visit: 09 Nov 2017

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

PostPosted: Tue Dec 27, 2016 5:04 am
   Subject: Re: Statics that drain health
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

This is implemented in EOD4SDL (both regen and damage). Check around lines 92, 1925-1937, 2829-2830 of wl_agent.cpp: https://github.com/kalbert312/eod4sdl/blob/master/wl_agent.cpp I think that's all there is to it. It's in T_Player because that's where the x/y/tilex/tiley values are updated for the player and it's done immediately after the update.

_________________
Steam: http://steamcommunity.com/id/stormx312
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] BrotherTank's Enemy Damage Tutorial: LOWERING Damage?
Author: StoneFrog
8 807 Wed Dec 10, 2008 7:51 pm
StoneFrog View latest post
No new posts [Solved] New Static Objects - odd error
Author: Tricob
2 636 Mon Oct 13, 2008 8:33 pm
Tricob View latest post
No new posts [help] making videos of SDL mods
Author: lilmanjs
15 1637 Mon Sep 22, 2008 2:21 pm
Zombie_Plan View latest post
No new posts [CODE] Health Shown as a message with full screen view
Author: Raziel
13 2111 Thu Jul 31, 2008 8:07 pm
Raziel View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 2335 Sat May 17, 2008 11:26 am
Mortimer 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