Author: MrCook
Author Website:

Requirements: No addons required

Version: 2.0

Short description:

Date: 2010-04-19 18:12


Comments: (0)
Rating:



 





Silence
by
MrCook


Description:
This script allows you to put silencers on or take silencers off of weapons while playing. This only works with weapons that already have a counterpart defined (i.e. "M9" and "M9SD" or "M4A1_Aim_camo" and "M4A1_Aim_SD_camo" )


Usage:
It comes with a mission as a demo version. Extract the folder to your ArmA2\other Profiles\Yournick\Missions and load it in the editor.

Your own mission:
Extract "Silence" folder to your ArmA2\other Profiles\Yournick\Missions\YourMissionName and load it in the editor.

In a trigger or somewhere (can only appear once), put
[] exec "Silence\InitSilence.sqs"

If unit is holding a weapon that has a silenced counterpart or vice versa (and is annotated in the script), an action will appear in the scroll list to Silence/Unsilence Rifle/Handgun.

I found this most useful in my old Capture the Island games in OFP where I would make every player-controllable unit run this script. I didn't like the idea of paying more money for a silenced weapon from the barracks and then being stuck with it until I had to pay again for the unsilenced version. Also, this is the only game-type where you are very likely to be changing weapons over and over.

This script could also be modified to swap out weapons with different sights, like an M4 with Aimpoint to M4 with ACOG and back so you are not limited just to CQB. You hereby have permission to mod these scripts as much as you want, but if you come up with something really cool involving this, please give me some credit.


Known Issues:
1. Unit will automatically reload to a full magazine without playing the animation once the switch is completed.

2. If unit1 is running the script and unit2 is not, unit2 can come up to unit1 and force him to silence a weapon by choosing the action (not an issue in single player). In the case of two units being very close to each other that are both running the scripts, each unit will show theirs and each other's actions.

3. I did not try different animations depending on what stance the unit is in (standing, kneeling, prone). As of right now, if the unit is prone and chooses to silence their handgun, no animation is played and a silencer magically appears on their pistol.

4. When silencing/unsilencing rifles, you will have a full mag swapped in for any of your old rifle magazines that had any bullets in it. So if you only have one magazine with one bullet left and you decide to silence your weapon, you will then have one full magazine once the weapon is silenced.

This will NOT add a silencer to any weapon that you just feel like adding a silencer to! It only works with pre-made (addons) and pre-defined (in the script) weapons!


Notes:
Sorry I've release versions 1.0 thru 2.0 within a week. Version 1.0 and 1.1 were always good enough for me because I knew what needed to be done. Once I released them into the wild and saw how much they were getting downloaded, I couldn't stop thinking about how to make it better and easier to use.

I made this script for OFP Resistance years ago and never released it because I assumed someone would release something better or no one would be interested in it. I always thought it kind of lame that I could not take a silencer off of my weapon or put one on for that matter. I found much better animations in OFP for the characters to play while changing silenced status. I have not had the same luck with ARMA2 while I was updating the script and I lack the skill to design my own animations. The handgun version is a bit more complicated in the scripting due to the fact that there is no function like primaryWeapon to see what a unit's handgun is. This does not affect anything in-game.

For a long time, I have been downloading many things from the community but I have never contributed. I searched for something similar to this but haven't found anything, so I am here to release this into the great community to see what they can come up with. The script works for all intensive purposes now, but I have some suggestions for anyone that might like to take this and evolve it.


Future Suggestions:
1: Design some sweet animations for the unit to play while putting on/taking off the silencer.
2: Develop a sound to accompany it.
3: Figure out a way where only the unit with the option can activate the action to silence.
4: Find a way around the publicvariables so it is not necessary to have 3 scripts for one action and not necessary to have all those scripts per unit --DONE!!
5: Make unit addons incorporating this or even something more global where infantry do this already internally, so you don't have to type the [] exec "script" ever.
6: If someone makes their own Silenced MP5, make an MP5 with a silencer attached to the front versus the MP5SD6 with integral suppressor for use with this script, please. Otherwise, if you swap out the MP5 with the SD version, it's actually a totally different weapon and doesn't look right.

Had MANY more rifles in OFP due to an abundance of addons, but I have only just begun to download addons for ARMA2. The pistols seem to be more popular when it comes to making silenced versions of them, so my handgun silencing script has more options (currently with the game's defaults and pistols from the RH pistol pack--this will still work and give you NO error messages if you do not have the RH pistol pack).


Change log:
v2.0
- Added more weapons because it needed them, but some of them don't look like their counterparts exactly (i.e. MP5A5 vs. MP5SD6)
- Made the weapons arrays public variables so they would only need to be defined in one place.
- Finally made it where only one set of scripts (7 total) work for EVERY unit that was placed at the start of the mission. May change later on to include units as they are created, if necessary.
- Had to bring back the magazine swapping for the rifles because some weapons (like the silenced M4 with holographic sight and grenade launcher) will only shoot from SD mags.
- FIXED: Mag swapping for rifles. This was messed up in v1.1 because I wasn't removing the mags properly, so it would always add as many mags as it was supposed to be replacing. So it would go from 6 SD mags (6 total) to 6 SD mags and 6 regular mags (12 total).

v1.1
- Added more weapons because it needed them, but some of them don't look like their counterparts exactly (i.e. MP5A5 vs. MP5SD6)
- Made the weapons arrays public variables so they would only need to be defined in one place. I felt this was very important for someone that might want to add many weapons. Before, you would have to add them to each unit's scripts.
- Had to bring back the magazine swapping for the rifles because some weapons (like the silenced M4 with holographic sight and grenade launcher) will only shoot from SD mags.
- Made many copies of the scripts, applying critical changes for use with multiple units.


Usermade Addons Compatibility:
It doesn't need any addon. You can put as many weapon names into the script as you feel like, regardless of what addon they come from. The script only checks to see if the weapon the unit has matches one in the array from the script. If you get a new addon with weapons that have silenced and unsilenced versions, be sure to add those to this script.


Credits & Thanks:
to BIS for making these awesome games. I try to get everyone I know to play them. And also everyone who would have helped if I had asked for it!


Forum topic:
- Armaholic forums




Enable javascript to be able to download from Armaholic please!



Tags: No tags