Wolf Planet Forum Index Wolf Planet
We want you here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[code] Guard bleeds when shot (not killed)

 
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance
View previous topic :: View next topic  
Author Message
Deathshead
Corporal


Joined: 18 Feb 2005
Posts: 87

PostPosted: Mon Feb 21, 2005 1:25 am    Post subject: [code] Guard bleeds when shot (not killed) Reply with quote

Welcome to my second Tutorial for Wolfenstein at this forum. Here, I show you how to make a guard bleed when shot, but not killed.

Sadly, there is a bug. Sometimes, when a guard bleeds, he'll try to walk away from that spot, but will teleport back. It only does this once though so he'll walk after this happens. He may also walk away from you for a couple of tiles, bu this stupidity is probably due to blood loss Razz.

Open WL_STATE.C and Locate the DamageActor function, under KillActor. At the top of the function, it should read:
Code:

   madenoise = true;

Change this to:

Code:

   int   tilex,tiley;
   madenoise = true;

   tilex = ob->tilex = ob->x >> TILESHIFT;
   tiley = ob->tiley = ob->y >> TILESHIFT;

This is the code that allows enemies to drop things when they die. Now, go down a little until you get to the switch cases:

Code:

      switch (ob->obclass)      // dogs only have one hit point
      {

Then, in each enemies case that you want to bleed, put the following line:

Code:

         PlaceItemType (bo_gibs,tilex,tiley);

If you compile as is, you'll find the guards dropping bloody skeletons. This is because both the blood puddle and bones use bo_gibs. To change this, open WL_DEF.H and locate 'bo_gibs'. You should get:

Code:

typedef enum {
   dressing,
   block,
   bo_gibs,
   bo_alpo,

Underneath 'bo_gibs,', add 'bo_gibs2,'. Now, open WL_AGENT.C and search for 'bo_gibs:'. The search will take you to:

Code:

   case   bo_gibs:
      if (gamestate.health >10)
         return;

      SD_PlaySound (SLURPIESND);
      HealSelf (1);
      break;

Modify it to look like this:
Code:

   case   bo_gibs:
   case   bo_gibs2:
      if (gamestate.health >10)
         return;

      SD_PlaySound (SLURPIESND);
      HealSelf (1);
      break;

Here, we see the case for bo_gibs2 being added. Now, close that file and open WL_ACT1.C. Search for 'bo_gibs'. You should get this:
Code:

{SPR_STAT_33,bo_fullheal},      // one up          "
{SPR_STAT_34,bo_gibs},         // gibs            "
{SPR_STAT_35,block},         // barrel          "
{SPR_STAT_36,block},         // well            "
{SPR_STAT_37,block},         // Empty well      "
{SPR_STAT_38,bo_gibs},         // Gibs 2          "
{SPR_STAT_39,block},         // flag            "

Notice that both sprite 38 and 34 use bo_gibs? Change sprite 34 to read:
Code:

{SPR_STAT_34,bo_gibs2},         // gibs            "

Save and compile. Now, when a guard is shot, he bleeds!

There you go
-Deathshead
_________________
Myspace
VampireFreaks
Music4Life
Wolfing Time
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Conner94
Moderator


Joined: 15 Jan 2005
Posts: 249
Location: ???

PostPosted: Mon Feb 21, 2005 6:10 pm    Post subject: Reply with quote

Cool! I will consider this in War Storm (Once I get it running again)
_________________
My Wolfenstein Website:
http://www.wolf94.cjb.net

Status: Falling apart over a product I ordered that is taking forever to arrive.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Wolf Planet Forum Index -> Coding Alliance All times are GMT
Page 1 of 1

Jump to:  

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


Powered by phpBB © 2001 phpBB Group

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.