StubbleHopper 0 Posted March 14, 2010 Anyone know where I should start looking for altering rifle fire and smoke particle effects, need it for a mod I'm working on, any help much appreciated. Share this post Link to post Share on other sites
ProfTournesol 956 Posted March 14, 2010 If the mod is the one i think about, try this sqf script that you must add to units through an eventhandler fired. It'll generate "old rifle" smoke : Comment { Smoke script by MrZig and Korax, Call via eventhandler (this addeventhandler ["FIRED",{_this call loadfile "smoke.sqf"}]) }; Private ["_X","_Y","_dir","_unit","_bullet","_pos","_max","_dist","_vel","_drop","_colorpool","_color","_vel","_newpos","_size1","_size2","_size","_randomdirintens"]; _unit = _this select 0; _gun = _this select 1; _bullet = nearestobject [_this select 0,_this select 4]; _dist = 0.2; _vel = [0,0,-0.1]; _drop = (-0.05) + (random 0.1); _colorpool = [[[0.8,0.8,0.8,0.5],[0.8,0.8,0.8,0.8],[0.8,0.8,0.8,0.5],[0.8,0.8,0.8,0]],[[0.9,0.9,0.9,0.5],[0.9,0.9,0.9,0.8],[0.9,0.9,0.9,0.5],[0.9,0.9,0.9,0]],[[0.85,0.85,0.85,0.5],[0.85,0.85,0.85,0.8],[0.85,0.85,0.85,0.5],[0.85,0.85,0.85,0]]]; _vel = [0,0,(_drop)]; _Newpos2 = [0,0,0]; _max = 15; _speed = 400; Comment { _speed MUST be set to the exact speed of the bullet, a simple (speed _bullet) WILL NOT WORK in the sqf and it MUST be changed here. you can change it according to different guns with a line below (IF (_gun == "") then {_speed = 1000};) }; _negdist = -0.5; Comment { _negdist is how far back the "chamber" smoke backblast appears, adjust accordingly for the size of the gun }; _dir = getdir _bullet; _pos = getpos _bullet; _x = _pos select 0; _y = _pos select 1; WHILE "_max > 0" DO { _Newpos = [(getpos _bullet select 0)+(((velocity _bullet select 0)/_speed)*_dist),(getpos _bullet select 1)+(((velocity _bullet select 1)/_speed)*_dist),(getpos _bullet select 2)+(((velocity _bullet select 2)/_speed)*_dist)]; _Newpos2 = [(getpos _bullet select 0)+(((velocity _bullet select 0)/_speed)*_negdist),(getpos _bullet select 1)+(((velocity _bullet select 1)/_speed)*_negdist),(getpos _bullet select 2)+(((velocity _bullet select 2)/_speed)*_negdist)]; _size1 = [0.5 + random (_dist/3)];_size2 = [(_size1 select 0) + ((_dist/2) + random (_dist/2))];_size = _size1 + _size2;_randomdirintens = random 0.03; _color = _colorpool select (random ((count _colorpool)-1)); drop ["cl_basic" , "" , "Billboard" , 2 , (4+random 1) , _newpos , _vel , 1 , 0.197 , 0.155 , 0 , _size ,_color , [0] , 0.2 , _randomdirintens , "" , "" , ""]; drop ["cl_basic" , "" , "Billboard" , 2 , (4+random 1) , _newpos2 , [random 0.05,random 0.05,random 0.25] , 1 , 0.197 , 0.155 , 0 , [random 0.4,0.5+random 1] ,_color , [0] , 0.2 , _randomdirintens , "" , "" , ""]; _dist = _dist + 0.25;_max = _max - 1}; It was created for OFP but it should work for ArmA/ArmA2, if the particles names haven't changed. Share this post Link to post Share on other sites
StubbleHopper 0 Posted March 14, 2010 Thanks ProfT, that's a great helping hand cheers mate Share this post Link to post Share on other sites
cervantes 330 Posted April 19, 2010 hi i have test this script :) no error when script has launched with fired event handler but no smoke ^^ Share this post Link to post Share on other sites