OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Nirrum on 30 Mar 2011, 00:39:04

Title: Any simple Chaff/Flare scripts exist?
Post by: Nirrum on 30 Mar 2011, 00:39:04
Is there anyone who can help me with a simple script.   I am making an intro in my ARMA2 map, however I need a doomed helicopter to fire off some chaff and flare before I setDamage 0.8.

I've searched the forum and script downloads but cant find a script which suits.  I am assuming its a simple script by the way  ???

Basically I need the huey to fire off about 5 or 6 chaff/flares before it explodes.   I can attempt to script it myself but I just need pointing in the right direction  :blink:

Thanks
Title: Re: Any simple Chaff/Flare scripts exist?
Post by: Wolfrug on 30 Mar 2011, 11:51:45
Hi,

Moved your topic here since it's nothing to do with actual config scripting, I believe :)

Anyway, the easiest way I thought of doing this would be to simply add a "FlareLauncher" to the helicopter, and have it physically shoot that. So, something like this.

Code: [Select]
heli1 addmagazine "FlareLauncherMag";
heli1 addweapon "FlareLauncher";

for "_i" from 0 to 7 do
{
heli1 fire "FlareLauncher";
sleep 1;
};

heli1 setdamage 0.8;

The name of the helicopter being heli1. That -should- work. What I found was that, for some inexplicable reason, whenever you make the helicopter shoot flares using a script, it also gives an automatic hint which seems to be the position of the helicopter at the moment of shooting. Some old debug code or something from BIS, I'd wager, but it's very annoying. I don't think it should show when inside a cutscene though, so maybe that's okay? I'm really not sure how to get rid of it (maybe a spam of empty hint ""'s would be enough?)

Anyway, good luck!

Wolfrug out.
Title: Re: Any simple Chaff/Flare scripts exist?
Post by: h- on 30 Mar 2011, 15:04:40
Quote
What I found was that, for some inexplicable reason, whenever you make the helicopter shoot flares using a script, it also gives an automatic hint which seems to be the position of the helicopter at the moment of shooting. Some old debug code or something from BIS, I'd wager
Actually, it might be some debugging code from Maddmatt who made almost all (if not all) of the particle scripts, at least in a script called flares.sqf (found in Ca/data/particleEffects/scripts/muzzle) there is a line hint format ["%1",_flarevel]; that is not commented out :P
Title: Re: Any simple Chaff/Flare scripts exist?
Post by: VIPER[CWW] on 12 Apr 2011, 01:48:56
I made an example mission a while back which has now been added to the Script Snippets over @Armaholic by DarkXess, feel free to check out the example mission (http://www.armaholic.com/plug.php?e=faq&cid=7&o=order&w=asc&d=10)
Title: Re: Any simple Chaff/Flare scripts exist?
Post by: Nirrum on 14 Apr 2011, 17:44:19
Thanks Wolfrug  :good:

Works great, I had to paste 3 triggers in order to get the desired effect as the script only made it fire flare once.

I see what you mean about the hint sound, the "ding" kind of breaks the ambience of the intro, but hey im not Martin Scorsese  ::)

Cheers!
Title: Re: Any simple Chaff/Flare scripts exist?
Post by: VIPER[CWW] on 19 Apr 2011, 01:23:59
well if you use my example you only need one trigger and you dont get the hint sound... which can be removed by using hintSilent fyi.