(Old code tutorial) Guard bleeds when shot (not killed) from Wolf Planet forum

View previous topic View next topic Go down

(Old code tutorial) Guard bleeds when shot (not killed) from Wolf Planet forum

Post by Officer-M. John (Admin) on Sun Mar 27, 2016 9:33 am

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 cas

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

Writte by Deathshead on Mon Feb 21, 2005 1:25 am
avatar
Officer-M. John (Admin)
Admin

Posts : 323
Join date : 2015-10-02
Age : 19

View user profile http://wolf3dfanboys.usersboard.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum