[Info] Silent Gun? - Adding a Silencer
Select messages from
# through # FAQ
[/[Print]\]

DieHard Wolfers -> Code Crackers

#1: [Info] Silent Gun? - Adding a Silencer Author: Guest PostPosted: Thu Apr 17, 2003 9:40 pm
    —
Thanks BrotherTank for all your help(all work perfectly) But do you know how to do a Silent Weapon??

#2: Re: Silent Gun? Author: BrotherTankLocation: Ontario PostPosted: Thu Apr 17, 2003 9:53 pm
    —
DemolitionDerby wrote:
Thanks BrotherTank for all your help(all work perfectly) But do you know how to do a Silent Weapon??


Yep.... You would create a silencer object and if you had it you could edit in the wl_agent.c file, the sub routine :

Void GunAttack (objtype *ob)

and look for the line that says madenoise = true;

Then change it to read something like:

if (!silencer) madenoise = true; else madenoise = false;

That will stop the guards from reacting to sound... Basically the above says "If NOT Silencer make a noise else shoot quiet with no alert.

You could also edit the GunAttack to allow for special gun types ... but my favorite is to use just the basic gun... so mine is:

if (!silencer)
{ madenoise = true; }
else
{
if (gamestate.chosenweapon = wp_pistol )
{ madenoise = false; }
else
{ madenoise = true; }
}

That's about it... of course I do count shots and the silencer does wear down over time... so it starts to get louder the more you use it... Smile
Until eventually its no good... And you need to find another...

Hope that helps...

Greg
BrotherTank

#3: Re: [Info] Silent Gun? - Adding a Silencer Author: Guest PostPosted: Fri Apr 18, 2003 12:06 am
    —
That's a good idea, Greg.

Alternatively, if you just want a gun that is always silent, you could simply comment out the line in GunAttack that says "madenoise = true," and then add "madenoise = true" under the "SD_PlaySound" for each gun EXCEPT the one that is silenced.

Here's a little code from Operation Heimzahlung under "void GunAttack" in WL_AGENT.C:

::: CODE :::

   switch (gamestate.weapon)
   {
   case wp_pistol:
      SD_PlaySound (ATKPISTOLSND);
      madenoise = true;
      break;
   case wp_machinegun:
      SD_PlaySound (ATKMACHINEGUNSND);
      madenoise = true;
      break;
   case wp_chaingun:
      SD_PlaySound (ATKGATLINGSND);
      madenoise = true;
      break;
   case wp_sten:
      SD_PlaySound (ATKSTENSND);
      break;
   }

//   madenoise = true;


Notice that every "case wp_" has a "madenoise = true" except for wp_sten, which is silent. The madenoise statement at the bottom has been commented out.

Also, make sure that you remove the "madenoise = true" line from the DamageActor function in WL_STATE.C.

#4: Re: [Info] Silent Gun? - Adding a Silencer Author: Guest PostPosted: Fri Apr 18, 2003 8:31 am
    —
Thanks for all your answers ???D???D

#5: Re: [Info] Silent Gun? - Adding a Silencer Author: BrotherTankLocation: Ontario PostPosted: Fri Apr 18, 2003 8:34 am
    —
WSJ wrote:
That's a good idea, Greg.

Alternatively, if you just want a gun that is always silent, you could simply comment out the line in GunAttack that says "madenoise = true," and then add "madenoise = true" under the "SD_PlaySound" for each gun EXCEPT the one that is silenced.


That works as well... but mine was set as you pick up a silencer for your pistol.... but thanks for the compliment.

WSJ wrote:

Also, make sure that you remove the "madenoise = true" line from the DamageActor function in WL_STATE.C.


That is true, except that when a guard is shot, even with a silencer, he's bound to make some noise.... With this particular statement, I use the knife for silent attack. Because the knife is a close combat weapon, the first thing most attackers do in movies and probably real life, is somehow disable the person attacked from making noise... Once again, I look at the fine details... I try to make it realistic.

Greg
BrotherTank



DieHard Wolfers -> Code Crackers


output generated using printer-friendly topic mod. All times are GMT

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group