Deathshead Corporal

Joined: 18 Feb 2005 Posts: 87
|
Posted: Mon Feb 21, 2005 1:25 am Post subject: [code] Guard bleeds when shot (not killed) |
|
|
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 .
Open WL_STATE.C and Locate the DamageActor function, under KillActor. At the top of the function, it should read:
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 |
|