Arma 3 Black Fade-In Intro

Arma3 v1.50
Rip on the BIS forums had asked about a black fade in intro for his new mission. There’s countless ways of doing this but thanks to a hint from polpox I discovered that the new Bootcamp mission has introduced a function that makes a nice looking “infoText” effect. So I took some samples from the various ways I’ve done this before and came up with this.

Save the code as missionIntro.sqf. You can then call it from initPlayerLocal.sqf. There’s quite a few options you can set each with it’s own default. One “gotcha” is that if you don’t put anything in for any of the three first parameters the text typing effect will display %1, so if you want those blank put a space as in the examples.


	Author: kylania

	Fade in from black intro, with a quote and Arma 3 style SitRep Date/Time/Mission credits.  
	Run via execVM from playerInitLocal.sqf

	0: STRING - Name of the mission.  SemiBold font under date during sitrep typing effect. Default: "An Arma 3 mission"
	1: STRING - Author of the mission.  Displayed under the mission name in medium font. Use a " " for nothing. Default: "by a Community Author"
	2: STRING - Version of the mission.  Displayed under the mission author in a medium font. Use a " " for nothing. Default: "Version 1.0"
	3: STRING - Quote for center screen display on black screen.  Default: "Not so long ago, not so far away...\n\n-A quote"
	4: NUMBER - Duration of quote display.  Default: 9
	["Jungle Trek", "By Rip", "Version 1", '"A cat is a lion in a jungle of small bushes."\n\n-Indian proverb'] execVM "missionIntro.sqf";
	["A Mission", " ", " ", "", 0] execVM "missionIntro.sqf";

// Start with a silent black screen.
titleCut ["", "BLACK FADED", 999];
0 fadeSound 0;

// Spawn text effects.
_this spawn {

		["_missionName", "An Arma 3 mission"],
		["_missionAuthor", "by a Community Author"],
		["_missionVersion", "Version 1.0"],
		["_quote", "Not so long ago, not so far away...\n\n-A quote"],
		["_duration", 9]

	// Starting quote as volume fades in.
	titleText [_quote,"PLAIN"];
	titleFadeOut _duration;
	_duration fadeSound 1;
	sleep (_duration - 2);

	// New "sitrep style" text in bottom right corner, typed out over time.
		[_missionName,"font = 'PuristaSemiBold'"],
		[_missionAuthor,"font = 'PuristaMedium'"],
		[_missionVersion,"font = 'PuristaLight'"]
	]  execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf";

	// Fade from black, to blur, to clear as text types.
	sleep 3;
	"dynamicBlur" ppEffectEnable true;   
	"dynamicBlur" ppEffectAdjust [6];   
	"dynamicBlur" ppEffectCommit 0;     
	"dynamicBlur" ppEffectAdjust [0.0];  
	"dynamicBlur" ppEffectCommit 5;  
	titleCut ["", "BLACK IN", 5];

No Comments

Gather Data addAction

Arma3 v1.50
Here’s a method for collecting “data” to complete a task in ArmA 3 using some new commands which make this process so much easier than in ArmA 2. This assumes that you have set a task called getDataTask either via scripting or by placing down a CreateTask module.

First place your object. By default we’ll only remove the addAction from the object once the data is collected however the script also supports an option to delete the object. Use of the new remoteExec command means that this is multiplayer compatible without lots of tricks or extra code!

object’s init field:

this addAction ["Gather Data", "data.sqf", ["getDataTask"]];

This will add an action to the object allowing the player to use the item to gather data from it. “getDataTask” is the name of the task we’ll complete. data.sqf is the script which will run.


// this addAction ["Gather Data", "data.sqf", ["getDataTask"]]; 
// ["getDataTask", true] to optionally delete object.

// Grab input.
params ["_object", "_caller", "_id", "_args"];

// Grab arguments, task name String and optional Boolean to delete object.
_taskID = _args param [0];
_deleteObject = _args param[1, false];

// Remove addAction from object.
[_object, _id] remoteExec ["removeAction", 0, true];

// Have Base call out who found the intel.
[[side _caller, "base"], format["%1 gathered the data!", name _caller]] remoteExec ["sideChat", 0, true];

// Succeed the task.
[_taskID, "Succeeded", true] remoteExec ["BIS_fnc_taskSetState", 0, true];

// If optional delete flag set, remove the object where it's local.
if (_deleteObject) then {
	_object remoteExec ["deleteVehicle", _object];

The first two lines are comments showing how to use the script. To optionally delete the object change the arguments array to include the true statement as shown on the second line.

The input section is where we capture all the input from the addAction command and shows the use of the new (from v1.48) params and param commands. Here’s a comparison of the ArmA 2 vs ArmA 3 versions of this code:

ArmA 2:

private ["_object", "_caller", "_id", "_args", "_taskID", "_deleteObject"];
_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_args = _this select 3;
_taskID = _args select 0;
_deleteObject = if (count _args > 1) then {_args select 1} else {false};

ArmA 3:

params ["_object", "_caller", "_id", "_args"];
_taskID = _args param [0];
_deleteObject = _args param[1, false];

I love how much more compact the new code is!

One of the main problems with using addAction is that it’s effects are local, meaning things you did in the script would only apply to the player who activated the addAction. This meant that to remove an action you had to find a way to remove it on all players which was often headache causing. With the introduction of remoteExec commands with ArmA 3 version 1.50 it’s now very simple to do just that!

For the rest of the script all the commands will be executed via remoteExec to make sure all players execute the commands even though they were run from a local addAction. Here’s a comparison of how the remoteExec command works:

Previously you’d have to run this on all clients:

_object removeAction _id; 

Now the 0 on the right side means this will be run on all clients.

[_object, _id] remoteExec ["removeAction", 0, true];

Later on we use another feature of the remoteExec to delete an object where it’s local, again letting a local addAction control something nonlocal.

// Notice the 0 from before is replaced with an object, so only runs where _object is local
_object remoteExec ["deleteVehicle", _object];

In the script we also use some commands to make the “base” of whichever side found the items call out the name of the player who found it and use the BIS_fnc_setTaskState function to display a notification of the task succeeding and marking it as completed.

There’s been a ton of great new commands for ArmA 3 which really makes things a lot easier to code.

No Comments

LHD Anywhere via Function

Include an LHD anywhere, without addOns, with this simple trick!  Make sure you place the Functions Module on the map first.  Then place a Game Logic where you’d like your LHD and name it something like LHD1.  Then use this in your init.sqf:

waituntil {!isnil "bis_fnc_init"};
LHD1 call BIS_EW_fnc_createLHD;

No Comments

Mayhem and fire and smoke!

Some men just want to watch the world burn…

To make something burn via BIS_Effects_Burn we’ll need this code in our init.sqf:

BIS_Effects_Burn=compile preprocessFileLineNumbers "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";

Then to set something on fire we’ll use this command, either in a trigger or from it’s init or via a script:

[object, intensity, time, lifecheck, fade] spawn BIS_Effects_Burn;

Object: the name of the object that the fire will be attached to.
Intensity: the intensity of the fire.  Recommended to use values between 0.7 and 10, higher values may be used if desired though.
Time: the time that the fire started.  Use the global variable time.  This is used to keep effects synced for JIP players.
Lifecheck: if this is true then the unit will only burn as ling as it is dead (!alive unit).  Set to false to burn things like buildings and gamelogics.
Fade: if true then the fire will die down over time, eventually dying out.  Set to false if you want it to keep burning (affected by rain too).

If you want to kill a fire you can delete the object it is attached to.

Hint: you can attach a gamelogic to a moving object via the attachto command, and then make the gamelogic burn that way you can kill the fire without deleting the object.

To make a gamelogic named mygamelogic burn forever with a big fire:

[mygamelogic,10,time,false,false] spawn BIS_Effects_Burn

same with medium sized fire:

[mygamelogic,5,time,false,false] spawn BIS_Effects_Burn

To make a gamelogic burn and have the fire fade over time:

[mygamelogic,10,time,false,true] spawn BIS_Effects_Burn

To make it smoke, with no visible flame you can use an intensity of 3 or lower:

[mygamelogic,3,time,false,false] spawn BIS_Effects_Burn


Other forms of mayhem…

Thanks for F2k Sel for the following ideas:

While on the subject of wrecks and damage, if you use the effects_burn function you can still put some damage using setdamage or the sliders to make it look damaged.

Also you can have it totally wrecked at the start of the mission but setting damage to maximum and put this in the init line of the object.

this will stop the vehicle from burrning but look wrecked

car1 enablesimulation false;

this will put a vehicle on it’s side but you may have to play with the values depending on direction

car1 setvectorup [0,0.1,0.01]

or you can do it an easier way, place a function module on the map first
place in an unit init

[car1,0, 90] call bis_fnc_setpitchbank;

That will flip a vehicle onto it’s side in any direction, a value of 180 will put it on it’s roof.

this will wreck the vehicle with no flames, the driver and gunner will be killed and keep them in the car

car1d setdamage 1;car1g setdamage 1; car1 setdamage 0.9

this would kill all units including cargo

{_x setdamage 1;}forEach units car1

This will remove a tyre from a vehicle,

car1 setHit ["wheel_1_1_steering", 1];

other wheel values are :-
wheel_1_1_steering = Left front tire
wheel_1_2_steering = Left rear tire
wheel_1_3_steering = Left middle tire (trucks)
wheel_2_1_steering = Right front tire
wheel_2_2_steering = Right rear tire
wheel_2_3_steering = Right middle tire (trucks)

or you can just break the glass

car1 setHit ["Glass1", 1];
car1 setHit ["Glass2", 1];
car1 setHit ["Glass3", 1];
car1 setHit ["Glass4", 1];
car1 setHit ["Glass5", 1];
car1 setHit ["Glass6", 1];

this will damage just the motor on a car or aircraft,gets choppers down quickly.

heli1 setHit ["motor", 1]

This will damage the tail rotor

heli setHit ["mala vrtule", 0.95]

No Comments

Eagle Wing Effects


yogdogz on the BIS forums extracted and posted the effects that Gaia had used in the Eagle Wing single player campaign.  It’s a very cool post apocolyptic feel with wind blowing ash and dust clouds all around you, closed in darker corners of the screen and a very desolate atmosphere.


#include "\ca\missions_EW\campaign\description_mission.hpp"


execVM "screen.sqf";

"colorCorrections" ppEffectAdjust [2, 30, 0, [0.0, 0.0, 0.0, 0.0], [0.8*2, 0.5*2, 0.0, 0.7], [0.9, 0.9, 0.9, 0.0]];
"colorCorrections" ppEffectCommit 0;
//"colorCorrections" ppEffectAdjust [1, 1, 0, [0.0, 0.0, 0.0, 0.0], [0.8*2, 0.5*2, 0.0, 0.7], [0.9, 0.9, 0.9, 0.0]];
"colorCorrections" ppEffectAdjust [1, 0.8, -0.001, [0.0, 0.0, 0.0, 0.0], [0.8*2, 0.5*2, 0.0, 0.7], [0.9, 0.9, 0.9, 0.0]];  
"colorCorrections" ppEffectCommit 3;
"colorCorrections" ppEffectEnable true;
"filmGrain" ppEffectEnable true; 
"filmGrain" ppEffectAdjust [0.02, 1, 1, 0.1, 1, false];
"filmGrain" ppEffectCommit 5;

//--- Wind & Dust
[] spawn {
    waituntil {isplayer player};
    setwind [0.201112,0.204166,true];
    while {true} do {
        _ran = ceil random 5;
        playsound format ["wind_%1",_ran];
        _obj = vehicle player;
        _pos = position _obj;

        //--- Dust
            setwind [0.201112*2,0.204166*2,false];
        _velocity = [random 10,random 10,-1];
        _color = [1.0, 0.9, 0.8];
        _alpha = 0.02 + random 0.02;
        _ps = "#particlesource" createVehicleLocal _pos;  
        _ps setParticleParams [["\Ca\Data\ParticleEffects\Universal\universal.p3d", 16, 12, 8], "", "Billboard", 1, 3, [0, 0, -6], _velocity, 1, 1.275, 1, 0, [9], [_color + [0], _color + [_alpha], _color + [0]], [1000], 1, 0, "", "", _obj];
        _ps setParticleRandom [3, [30, 30, 0], [0, 0, 0], 1, 0, [0, 0, 0, 0.01], 0, 0];
        _ps setParticleCircle [0.1, [0, 0, 0]];
        _ps setDropInterval 0.01;

        sleep (random 1);
        deletevehicle _ps;
        _delay = 10 + random 20;
        sleep _delay;


//--- Ash
[] spawn {
    waituntil {isplayer player};
    _pos = position player;
    _parray = [
    /* 00 */        ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 8, 1],//"\Ca\Data\cl_water",
    /* 01 */        "",
    /* 02 */        "Billboard",
    /* 03 */        1,
    /* 04 */        4,
    /* 05 */        [0,0,0],
    /* 06 */        [0,0,0],
    /* 07 */        1,
    /* 08 */        0.000001,
    /* 09 */        0,
    /* 10 */        1.4,
    /* 11 */        [0.05,0.05],
    /* 12 */        [[0.1,0.1,0.1,1]],
    /* 13 */        [0,1],
    /* 14 */        0.2,
    /* 15 */        1.2,
    /* 16 */        "",
    /* 17 */        "",
    /* 18 */        vehicle player
    _snow = "#particlesource" createVehicleLocal _pos;  
    _snow setParticleParams _parray;
    _snow setParticleRandom [0, [10, 10, 7], [0, 0, 0], 0, 0.01, [0, 0, 0, 0.1], 0, 0];
    _snow setParticleCircle [0.0, [0, 0, 0]];
    _snow setDropInterval 0.01;

    _oldPlayer = vehicle player;
    while {true} do {
        waituntil {vehicle player != _oldPlayer};
        _parray set [18,vehicle player];
        _snow setParticleParams _parray;
        _oldPlayer = vehicle player;


screen = {

sqf = [true] spawn bis_ew_fnc_screen;


while {true} do {
    player spawn screen;
    sleep 5;

No Comments