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       

[Info] Zombies Making Sounds (Mutants)
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
wolf3dbreaker
I am Death Incarnate
I am Death Incarnate


Joined: 09 Jun 2003
Last Visit: 29 Sep 2009

Topics: 31
Posts: 196
Location: Philippines
philippines.gif

PostPosted: Wed Aug 06, 2003 9:07 pm
   Subject: [Info] Zombies Making Sounds (Mutants)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

You know Haunted House Demo? the zombies like moan when they chase you. Does anyone know how to do that?And CodeTech, please don't Brag about it. if you know how to do it, please tell me. please?

thanks!

_________________
Gone from the community for a while. Will be back on July
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Thu Aug 07, 2003 2:12 am
   Subject: Re: Enemy shouting
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I'll get a piece of the code:

Place this in WL_ACT2.C, before this function is used.
::: CODE :::
void    ZombieIdle (objtype *ob);


This also goes to WL_ACT2.C:

::: CODE :::
///////////////////////////////////////////
// ZombieIdle
///////////////////////////////////////////

void ZombieIdle (objtype *ob)
{
      int   dx,dy,dist;

      dx = abs(ob->tilex - player->tilex);
      dy = abs(ob->tiley - player->tiley);
      dist = dx>dy ? dx : dy;
 
      if (areabyplayer[ob->areanumber])
   if (US_RndT() < 0.5 && !DigiPlaying  && dist < 4)
   {
          PlaySoundLocActor (SCHEISTSND,ob);
   }
   if (US_RndT() < 0.5 && !DigiPlaying && dist < 4)
   {
        PlaySoundLocActor (MECHSTEPSND,ob);
   }
   if (US_RndT() < 0.5 && !DigiPlaying && dist < 4)
   {
        PlaySoundLocActor (SLURPIESND,ob);
   }
}


Place this in the actors chase state(s). I suggest you put in only one of the chase frames so it won't be repeated too often:

::: CODE :::
ZombieIdle
You know were this goes don't you... Wink

Oh, and those were taken directly from Haunted House source code.
As you see the propability is very small, this way I could avoid too fast repetition. Please bare in mind that this is very old code, it dates back to the days when I was a newbie...
*sigh* Crying or Very sad

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
thellt
Bring 'em On
Bring 'em On


Joined: 21 Jan 2008
Last Visit: 12 May 2009

Topics: 11
Posts: 85
Location: bloodgulch
usa.gif

PostPosted: Fri Feb 29, 2008 1:39 pm
   Subject: Re: [Info] Zombies Making Sounds (Mutants)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

i think all you need is the sd playsound thingy when he hears you... or is this something else?... maybe it is kind of actor speak sounds... can we make a guard threaten you if you run away? (haha!) or make an "ouch!" sound? maybe we are on to something big... Smile


@codetech
sorry for bumping i just thought as i was reading this that that might be a good idea... Sad

_________________
}{even or }{ellt?

look for helt3d


Last edited by thellt on Mon Mar 03, 2008 11:47 am; edited 1 time in total
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Sat Mar 01, 2008 1:03 am
   Subject: Re: [Info] Zombies Making Sounds (Mutants)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Why did you have to bump this age old code, it's outdated and the logic is all wrong... Sad


I didn't want to edit my old post but here's some updated code...

It should have the effect I wanted back in the day but since I messed up the logic in the previous version this might have completely different effect that I was aiming for. Atleast the logic is corrected (I guess) and it looks cleaner.

::: CODE :::
void ZombieIdle (objtype *ob)
{
      int   dx,dy,dist;

      if (!DigiPlaying && areabyplayer[ob->areanumber] && US_RndT() == 0)
      {
         dx = abs(ob->tilex - player->tilex);
         dy = abs(ob->tiley - player->tiley);
         dist = dx>dy ? dx : dy;

         if (dist >= 4)
            return;

         switch ((US_RndT()%3))
         {
            case 0: PlaySoundLocActor (SCHEISTSND,ob); break;
            case 1: PlaySoundLocActor (MECHSTEPSND,ob); break;
            case 2: PlaySoundLocActor (SLURPIESND,ob); break;
         }
      }
}

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook


Last edited by Codetech84 on Sat Mar 01, 2008 12:08 pm; edited 1 time in total
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 13 Jun 2018

Topics: 46
Posts: 2313
Location: USA
usa.gif

PostPosted: Sat Mar 01, 2008 11:57 am
   Subject: Re: [Info] Zombies Making Sounds (Mutants)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

@Codetech: When you %2, the value 2 will never be an answer... you'd need %3 for that.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Sat Mar 01, 2008 12:07 pm
   Subject: Re: [Info] Zombies Making Sounds (Mutants)
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Yes you are right, I updated the code.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
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 
No new posts [Info] Main Menu Colours Explanation
Author: KyleRTCW
0 1021 Sat Jan 24, 2004 1:20 pm
KyleRTCW View latest post
No new posts [Info] Giving a Guard a Rocket Launcher
Author: Guest
4 193 Fri Jan 23, 2004 1:58 pm
Guest View latest post
No new posts [Info] Changing debug mode command line parameter
Author: CoolMario
2 128 Sun Aug 03, 2003 2:46 pm
Codetech84 View latest post
No new posts [Info] VL_FadeOut - Function Explanation
Author: TheTalentedMrLeo
1 1347 Sat May 03, 2003 2:36 pm
Codetech84 View latest post
No new posts [Info] Mirrored Images - walls that are reversed on one side
Author: Guest
4 294 Sat May 03, 2003 12:57 pm
jamez 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