MCS' Coding Tips
                 "Success!"



  
Stationary dogs

   Written by MCS
   


   
Main Page

News

Wolfenstein 3D
Texture Library


MCS' Coding
Tips - "Success"!


Utilities

Spear
Resurrection


Wolfendoom

Wolf
Collection


Original Wolf 3D

Doom/Duke
maps


Other Stuff

Links

Questions?
Email us!
The latest version of Mapedit (8.4) comes with an excellent document called "Tips for creating / editing Wolf3d & Spear of Destiny designs" by Warren Buss (if you're new at designing levels for Wolf, this one is a must, it can be downloaded from our Utilities page).

At page 5 of this document, you can read the following:

By the way, Guard Dogs are always on the move - there are no stationary dogs. (I guess ID didn't want to design a graphic of a  dog sitting and panting for water or food - ever notice how many  rooms dogs are in that have no food or water in them? - It's a  wonder the animal rights activists haven't been on their case <g>).

Well, this may be true, but some code snippets for those stationary dogs were really included in the original released source!

Open
WL_GAME.C and locate the following lines:

  
case 134:
   case 135:
   case 136:
   case 137:
    SpawnStand(en_dog,x,y,tile-134);
    break;


There you are! Now open
WL_ACT2.C and have a look at the SpawnStand() function:

void SpawnStand (enemy_t which, int tilex, int tiley, int dir)
{
unsigned far *map,tile;

switch (which)
{
case en_guard:
  SpawnNewObj (tilex,tiley,&s_grdstand);
  new->speed = SPDPATROL;
  if (!loadedgame)
    gamestate.killtotal++;
  break;

case en_officer:
  SpawnNewObj (tilex,tiley,&s_ofcstand);
  new->speed = SPDPATROL;
  if (!loadedgame)
    gamestate.killtotal++;
  break;

case en_mutant:
  SpawnNewObj (tilex,tiley,&s_mutstand);
  new->speed = SPDPATROL;
  if (!loadedgame)
    gamestate.killtotal++;
  break;

case en_ss:
  SpawnNewObj (tilex,tiley,&s_ssstand);
  new->speed = SPDPATROL;
  if (!loadedgame)
    gamestate.killtotal++;
  break;
}


You'll see, a case statement for the
en_dog enemy wasn't included. But it's easy to add one yourself, by just copying a case section from another enemy and adjusting the speed value:

case en_dog:
  SpawnNewObj (tilex,tiley,&s_dogstand);
  new->speed = SPDDOG;
  if (!loadedgame)
    gamestate.killtotal++;
  break;


Codewise, there are some more things you'll have to do, like adding new sprite definitions in
WL_DEF.H and adding a statetype definition to the dog's section in WL_ACT2.C
Just search the code for any occurrence of
s_grdstand and you'll see what I mean.
Oh, and of course you'll have to add extra sprites to the VSWAP (unless you want to use the existing dog sprites, that's up to you).
In case you'd like to know, we used all of this for the stationary "Suicide Clone" in Spear Resurrection.

I really have no idea why ID started to code the stationary dogs, but they never took the trouble to complete the code. If anybody knows, give us a holler :-)

Enjoy,
MCS.

P.S. In order to use those stationary dogs in your levels, you'll have to add the object values 134 up to 137 to your map editor definitions.
For example, if you're using MapEdit, you will add the following lines to your OBJDATA.WL6 file:

0086 600D Dog 1/S/E
0087 600D Dog 1/S/N
0088 600D Dog 1/S/W
0089 600D Dog 1/S/S


This way, you'll have the definitions for stationary dogs facing east, north, west and south respectively.

If you're using another map editor such as FloEdit, ChaosEdit or WDC, please refer to the manual or help text that came with these programs.

Thanks to Andy_Nonymous who pointed out that this information was missing.