I made this script a long time ago and I can't help but feel a little guilty for not releasing it sooner.
I have noticed in this site that many people have asked how to detect explosions, people have tried the following:
- Crater Object Detection
- Particle Detection
- Effect Adaption
All of these are reasonable but they each come with their own side effects.
After a long time to trail and error I found the perfect way to detect an explosion, but its more of a trick than detection.
Influenced by the Suppression script I decided to use the method of a looping detection of bullets in a radius using nearestObject in the same way to detect shells, rockets, missiles, specific grenades, mines and bombs.
But this doesn't really explain it. So the way the effect works for when these projectiles blow up is to use a hundredth of a second loop to; firstly detect the projectile and secondly for the projectile to disappear.
This however would mean that the effect happens when the projectile leaves the radius, but this script is tuned so that it only activates the effects when the projectile disappears 'whilst' it was inside the radius.
So behold the script you have all been dying for, you can now relive the epic effects from Call of Duty, Medal of Honour, Vietcong and a ton of other games you know and love.
Credit for designing the script goes to me, however credit also goes to Gielovic for simplifying the script into a more tidy and compact final version.
// call {[A] execVM "nearExp.sqf"}
// A - Target Radius.
// 20 is best.
_d = _this select 0;
NearExp =
{
private["_ammo"];
_ammo = _this select 0;
_projectile = nearestObject [player, _ammo];
while {(_projectile distance player) < _d} do
{
sleep 0.01;
_projectile = nearestObject [player, _ammo];
if (isnull _projectile) then
{
if (alive player) then
{
sleep 0.1;
titlecut ["","WHITE IN",2];
0.5 fadesound 0;
playsound "PSFX_RINGING";
setAccTime 0.5;
sleep 2;
2 fadesound 1;
setAccTime 0.75;
sleep 0.75;
setAccTime 1;
};
};
};
};
while {alive player} do
{
sleep 0.01;
["RocketCore"] call NearExp;
["MissileCore"] call NearExp;
["ShellCore"] call NearExp;
["MineCore"] call NearExp;
["TimeBombCore"] call NearExp;
["G_40mm_HE"] call NearExp;
["G_30mm_HE"] call NearExp;
["G_40mm_HE_6G30"] call NearExp;
["GrenadeHandTimed"] call NearExp;
["GrenadeHand"] call NearExp;
};
exit;
I would like you to take notice of this section:
if (alive player) then
{
sleep 0.1;
titlecut ["","WHITE IN",2];
0.5 fadesound 0;
playsound "PSFX_RINGING";
setAccTime 0.5;
sleep 2;
2 fadesound 1;
setAccTime 0.75;
sleep 0.75;
setAccTime 1;
};
This is the effect, i have created my own while sets of a ringing sound, flashes and slows down time, but in this section you can create any effect you desire, including linking other scripts to it.
Additionally to the script i have included a sound which works with this version's effects, simply place it into your mission folder and update your description.ext.
Additional Additional, there is a short video attachment so you can view this in effect, don't mind the jumpy sound, its just the video quality.
Please tell me if you experience any problems with this script because although it is tested to work, untested modifications might have produced bugs.
Other than everything I have told you, please enjoy this script, starting off by tossing a grenade 10 feet from your current position.
Unbacked Copyrighted by Surdus Priest for the use of ArmA:Armed Assault and Queens Gambet. Any violation of this decree will be subject for the Middle Finger Electronic Mail signed by the owner of this product. For your own protection do not use this script for anything other than admiration of the creator and the creator of this script in it's entirety. For further information on this policy, please speak with Surdus Priest's Solicitor who can be contacted on the dark side of Neptune (telephone number not included), calling times are between 9:00am and 5:00pm except on Bank Holiday Mondays and Boxing Day.OFPEC DOWNLOAD