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       

[Code] Armour Effectiveness Update - BrotherTank
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: 2248
Location: Ontario
canada.gif

PostPosted: Thu Apr 17, 2003 7:02 pm
   Subject: Armor Characteristics
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I won't go into the actual setup of adding the armor to your game other than to say you need to add it like you would any item you are adding to the game. This routine below, handles the effectiveness of the armor differently than most of the tutorials out there. A more practical way of doing things is to handle things as percentages.

ie:
::: CODE :::

void TakeDamage (int points,objtype *attacker)
{
  int hpoints;
  LastAttacker = attacker;
  if (gamestate.victoryflag) return;
  if (gamestate.difficulty==gd_baby) points>>=2;

  if (!godmode)
   {
      If (gamestate.armor >=1)
        {
           hpoints = (gamestate.armor * points) / 100;
           points -= hpoints;
           gamestate.armor -=hpoints;
           if (gamestate.armor < 0 ) gamestate.armor = 0;
           DrawArmor (); // Your routine to update armors value on status bar
        }
      gamestate.health -= points;
      StartDamageFlash (points);
   }

  if (gamestate.health<=0)
   {
      gamestate.health = 0;
      playstate = ex_died;
      killerobj = attacker;
   }
  gotgatgun=0;
  DrawHealth ();
  DrawFace ();
}


Now that's a little more efficient for Armor and how it should act. So now if the user gets hit with 80 hit points and he has 70 percent armor / 100 percent health... he gets 56 hitpoints on the armor and 24 to his health... Armor is now 14% and 76%.... A much nicer way of handling things and makes the armour both usefull and appropriate.

At least that is how I've been handling hitpoints and the armor in my routines. And should you decide to use this method, as will all tutorials, be them mine or anyone elses, please give credit to the author.
That's only fair...

Greg
BrotherTank

A complete set of tutorials using both my additions and corrections to others, will be available shortly on the DieHard Wolfers homepage.


Last edited by BrotherTank on Fri Jan 30, 2004 9:04 am; edited 1 time in total
Zach
DieHard Guard
DieHard Guard


Joined: 11 Mar 2003
Last Visit: 17 Mar 2018

Topics: 30
Posts: 257

blank.gif

PostPosted: Fri Apr 18, 2003 5:43 am
   Subject: Re: [Code] Armour Effectiveness Update - BrotherTank
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow thanks Brothertank... I've noticed in a lot of add-ons with armor that the armor is almost completely useless... this should certainly help.
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

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

PostPosted: Fri Apr 18, 2003 9:10 am
   Subject: Re: [Code] Armour Effectiveness Update - BrotherTank
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Zach Attack wrote:
Wow thanks Brothertank... I've noticed in a lot of add-ons with armor that the armor is almost completely useless... this should certainly help.


You are more than welcome. That is why I did the changes that I did... While David Gelbers original tutorial on adding armor was nice, it did have it's faults. It was when I was working on the "Vapourware" source for Quinnsey that I developed the properties shown above for handling the armor when attacked (the routine is now copied to it's own post).

And while Jamez's post was probably not complete (which is another pet peeve - don't leave people hanging by not pointing out that this only replaces a certain part of the routine), his attempt at making the armor functional was yet another hack like Gelbers.

I try to make things more realistic in the stuff I do. Hence, why you haven't seen my work (a complete TC) as I'm still tweaking and modifying my code. I've been watching the comments people make about different mods, and I try to make the necessary changes to make it partially fit their needs, but also to make it real... Which is one of the things I see most people say about additions/tutorials. It's the realism and attention to detail....

It's easy to make a mod for the engine, but it's more difficult to make it realistic and useful in the game. That's where the challenge is... Just ask MCS, Ripper, Darkone.... I'm sure they would agree...

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 
This topic is locked: you cannot edit posts or make replies. Announcement: Code Tutorials Listing
Author: BrotherTank
3 9447 Sun Feb 20, 2005 9:58 pm
BrotherTank View latest post
No new posts [Code] Make BJ Hurt Sound when Hit
Author: BrotherTank
7 2372 Thu Nov 25, 2004 10:23 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 2408 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 2707 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 3620 Sun Oct 26, 2003 1:21 am
Guest 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