M.Evans 10 Posted July 2, 2012 Would this be the proper way to execute the script. I am putting this in the config.cpp class Afterburner { displayName ="JATO On"; position = "pilotcontrol"; radius =15; condition = "speed this >50 and this animationPhase ""ABSwitch"" <= 0.1"; statement = "this execvm ""\usaf_c130\scripts\burner.sqf""; "; onlyforplayer = False; }; class Afterburner_1 { displayName ="JATO Off"; position = "pilotcontrol"; radius =15; condition = "this animationPhase ""ABSwitch"" >= 0.9"; statement = "this animate [""ABSwitch"",0]"; onlyforplayer = False; }; The main part that I am concerned with is the execution of the script. Share this post Link to post Share on other sites
[aps]gnat 28 Posted July 3, 2012 ? You seem to be mixing 2 systems. One of which is from my (a revision of Lethal's) Su33 AB scripting INIT script ... _script1 set [0, _plane execVM "\rktsu33\scr\FX_Afterburner.sqf"]; ... FX_Afterburner.sqf // --------------------- // Original FX scripts by Lethal // Modified by Gnat // --------------------- private ["_MaxIntensity","_Boost","_leftengine","_rightengine","_emitters","_Intensity","_looptime", "_plane"]; _MaxIntensity = 2; _Boost = 0.4; _Intensity = 0; _maxspeed = 1100; _plane = _this; _leftengine = "#particlesource" createVehicle position _this; _rightengine = "#particlesource" createVehicle position _this; _emitters = [_leftengine,_rightengine]; {_x setParticleRandom [0.05,[0.05,0.05,0.05],[0.05,0.05,0.05],0,0.8,[0.1,0.1,0.1,0],0,0]} foreach _emitters; {_x setDropInterval 0} foreach _emitters; _looptime = 0.1; while {(alive _plane) and (_this animationPhase "KillFx" == 0)} do { if ((isengineon _this) and ((_this animationPhase "ExhaustUp") > 0.25) and ((_this animationPhase "ABSwitch") > 0.5) and ((_this animationPhase "AirBrake") < 0.01)) then { if (_Intensity < _MaxIntensity) then {_Intensity = _Intensity + 0.1*(10*_looptime)}; if ((speed _this) < _maxspeed) then {_this setVelocity [(velocity _this select 0)+((vectordir _this) select 0)*((_Boost*_Intensity/2)*(10*_looptime)),(velocity _this select 1)+((vectordir _this) select 1)*((_Boost*_Intensity/2)*(10*_looptime)),(velocity _this select 2)+((vectordir _this) select 2)*((_Boost*_Intensity/2)*(10*_looptime))]}; if (fuel _this > 0) then {_this setFuel ((fuel _this)-((1/1200)*(3*_looptime)))}; } else { if (_Intensity > 0) then {_Intensity = _Intensity - 0.2*(10*_looptime)} }; _leftengine setParticleParams ["\Ca\data\cl_exp","","Billboard",1,0.07,[-1.2,-9.2,-0.8],[(velocity _this select 0) - ((vectordir _this) select 0)*30,(velocity _this select 1) - ((vectordir _this) select 1)*30,(velocity _this select 2) - ((vectordir _this) select 2)*30],1,1.2745,1,0,[0.6+(2*(speed _this/_maxspeed)),0.5+(10*(speed _this/_maxspeed))],[[0.040,0.100,0.900,0.1500*_Intensity],[0.200,0.200,0.800,0.1000*_Intensity],[0.500,0.200,0.000,0.0250*_Intensity],[0.000,0.000,0.000,0.0000*_Intensity]],[0],0,0,"","",_this]; _rightengine setParticleParams ["\Ca\data\cl_exp","","Billboard",1,0.07,[1.2,-9.2,-0.8],[(velocity _this select 0) - ((vectordir _this) select 0)*30,(velocity _this select 1) - ((vectordir _this) select 1)*30,(velocity _this select 2) - ((vectordir _this) select 2)*30],1,1.2745,1,0,[0.6+(2*(speed _this/_maxspeed)),0.5+(10*(speed _this/_maxspeed))],[[0.040,0.100,0.900,0.1500*_Intensity],[0.200,0.200,0.800,0.1000*_Intensity],[0.500,0.200,0.000,0.0250*_Intensity],[0.000,0.000,0.000,0.0000*_Intensity]],[0],0,0,"","",_this]; {_x setpos (getpos _this)} foreach _emitters; if (_Intensity > 0) then {{_x setDropInterval 0.001} foreach _emitters} else {{_x setDropInterval 0} foreach _emitters}; _looptime = time; sleep 0.051231; // mod by Crowe _looptime = time - _looptime; }; deleteVehicle _leftengine; deleteVehicle _rightengine; Config.cpp ... class AnimationSources { ... ... class UserAB { source = "user"; animPeriod = 0.2; initPhase=0; }; ... ... }; ... class UserActions { class ABurner_on { displayName="Enable Burners"; position="zamerny"; onlyforplayer=0; radius=1.0; condition="(this animationPhase ""ABSwitch"" < 0.1)"; statement="this animate [""ABSwitch"",1]"; }; class ABurner_off { displayName="Burners Off"; position="zamerny"; onlyforplayer=0; radius=1.0; condition="(this animationPhase ""ABSwitch"" > 0.9)"; statement="this animate [""ABSwitch"",0]"; }; }; Model.cfg class Animations { class ABSwitch { type ="rotation"; selection ="ABswitch"; axis ="axis_ABswitch"; source="UserAB"; sourceAddress = "clamp"; memory = true; minValue=0; maxValue=1; angle0 =0; angle1 ="rad 45"; }; Share this post Link to post Share on other sites