Sur “ArmA 2”, pas mal de level designer en herbe se demandent comment générer un effet de feu dans un niveau, voici une solution clé en main. D’abord, le fichier de script, nommé fx.fire.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 |
// File written by Julien V. // www.arma3.fr - www.tom4897.info #define posNul [0,0,0] #define mNbr2 [1,1,1,-1] #define partRandom1 [1.51, [1,1,0.3], [0.2, 0.2, 0.2], 0, 0.8, [0.05, 0.05, 0.05, 0], 0, 0] #define partRandom2 [0.2, [1, 1, 0.15], [0.3, 0.3, 1], 0, 0.3, [0, 0, 0, 0], 0, 0] #define ORANGE1 [1, 0.5, 0.4] #define ORANGE2 [0.8, 0.6, 0.2] _obj = _this select 0; _fire1 = "#particlesource" createVehicleLocal getpos _obj; _fire1 setdropinterval 0.03; _fire1 setParticleParams [["CaDataParticleEffectsUniversalUniversal", 16, 10, 32], "", "Billboard", 1, 0.7, posNul,[0, 0, 0.6], 0, 10, 7.9, 1, [2, 0.3], [[1,1,1,-0], mNbr2, mNbr2, mNbr2, mNbr2, [1,1,1,0]], [1], 1, 0, "", "", ""]; _fire1 setParticleRandom partRandom2; _smoke = "#particlesource" createVehicleLocal getpos _obj; _smoke setDropInterval 0.1; _smoke setParticleParams [["CaDataParticleEffectsUniversalUniversal", 16, 7, 48], "","Billboard",1, 5, posNul,[0, 0, 0.6], 0, 0.05, 0.04, 0.05, [0.5, 5], [[0.5, 0.5, 0.5, 0.1],[0.6, 0.6, 0.6, 0.2],[0.7, 0.7, 0.7, 0.08],[1,1,1, 0]], [0.8,0.3,0.25], 1, 0, "", "", _obj]; _smoke setParticleRandom partRandom1; _light = "#lightpoint" createVehicleLocal getpos _obj; _light setLightBrightness .048641; _light setLightAmbient ORANGE2; _light setLightColor ORANGE1; _light lightAttachObject [_obj, posNul]; _sound = createSoundSource ["Sound_Fire", getpos _obj, [], 0]; if (true) exiwith {}; |
Notre script créé, la suite est on ne peut plus simple, il suffit d’ajouter le code suivant dans l’init […]