-
Notifications
You must be signed in to change notification settings - Fork 1
/
AmbientFlies2.sqf
61 lines (52 loc) · 1.67 KB
/
AmbientFlies2.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
private ["_pos", "_interval", "_size", "_source", "_sound"];
/*
Author: Karel Moricky & Tomas Pavlis (minor change by SaOk)
Description:
Spawns flies around position.
Parameter(s):
_this select 0: ARRAY - Position of flies
_this select 1 (Optional): NUMBER - area size
_this select 2 (Optional): NUMBER - number of crows
Returns:
ARRAY - list of all spawned crows
*/
_pos = _this select 0;
_interval = if (count _this > 1) then {_this select 1} else {-1};
_size = if (count _this > 2) then {_this select 2} else {-1};
if (_interval <= 0) then {_interval = 0.1;};
if (_size <= 0) then {_size = 1;};
// FIXED PARAMS
_source = createVehicle ["#particlesource",_pos, [], 0, "NONE"];
_source setParticleParams
/*Sprite*/ [["\ca\characters2\OTHER\FLY.p3d", 1, 0, 1, 0], "", // File, Ntieth, Index, Count, Loop(Bool)
/*Type*/ "spaceObject",
/*TimmerPer*/ 1,
/*Lifetime*/ 4,
/*Position*/ [0, 0, 0],
/*MoveVelocity*/ [0, 0, 0.5],
/*Simulation*/ 1, 1.30, 1, 0, //rotationVel, weight, volume, rubbing
/*Scale*/ [0.03, 0.03, 0.03, 0],
/*Color*/ [[1, 1, 1, 1],[1, 1, 1, 1]],
/*AnimSpeed*/ [1.5,0.5],
/*randDirPeriod*/ 0.01,
/*randDirIntesity*/ 0.08,
/*onTimerScript*/ "",
/*DestroyScript*/ "",
/*Follow*/ _this];
// RANDOM / TOLERANCE PARAMS
_source setParticleRandom
/*LifeTime*/ [2,
/*Position*/ [_size, _size, 0.25],
/*MoveVelocity*/ [0, 0, 0],
/*rotationVel*/ 1,
/*Scale*/ 0.02,
/*Color*/ [0, 0, 0, 0.1],
/*randDirPeriod*/ 0.01,
/*randDirIntesity*/ 0.03,
/*Angle*/ 10];
_source setDropInterval _interval;
_sound = createSoundSource["Sound_Flies",_pos,[],0];
sleep 70;
waituntil {sleep 15;((vehicle player) distance _source > 400)};
deletevehicle _source;
deletevehicle _sound;