Jump to content
Sign in to follow this  
marki980908

Name a script group

Recommended Posts

 

This script makes a plane go to 0km/h in an instant
 

Spoiler

this addAction ["<t color='#FF0000'>Gravity Break","_veh = _this #0; _veh setvelocity [0 * (sin (getdir _veh )), 0 * (cos (getdir _veh )), 0]", [], 7, true, true, "", "_this == driver _target"];

 

This script should do the same thing, but add a bunch of Effects to make it look cooler and stuff, but it doesnt work for some reason...

Spoiler

this addAction ["<t color='#FF0000'>Gravity Break","
_veh = _this #0; 
_veh setvelocity [0 * (sin (getdir _veh )), 0 * (cos (getdir _veh )), 0];

distort1 = "#particlesource" createVehicle position _this;
distort1 setParticleCircle [0, [0, 0, 0]]; 
distort1 setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0]; 
distort1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 8, 3, 1], "", "Billboard", 1, 0.5, [0, 0, 0], [0, 0, 0.75], 0, 10, 15, 0.075, [1,20], [[1, 1, 1, 1], [1, 1, 1, 1]], [0.5], 1, 0, "", "", _this]; 
distort1 setDropInterval 1.0;

spark1 = "#particlesource" createVehicle (getpos _this);
spark1 setParticleRandom [0, [0.25, 0.25, 0], [5, 5, 5], 0, 0.1, [0, 0, 0, 0.1], 0, 0];
spark1 setParticleParams [["\A3\data_f\proxies\muzzle_flash\mf_sparks_01.p3d", 1, 0, 1], "", "SpaceObject", 1, 2, [0, 0, 0], [0, 0, 0.75], 13, 10, 7.9, 0.075, [2, 0.5], [[1, 1, 1, 1], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _this];
spark1 setDropInterval 0.002;

spark2 = "#particlesource" createVehicle (getpos _this);
spark2 setParticleRandom [0, [0.25, 0.25, 0], [5, 5, 5], 0, 0.1, [0, 0, 0, 0.1], 0, 0];
spark2 setParticleParams [["\A3\data_f\proxies\muzzle_flash\mf_sparks_02.p3d", 1, 0, 1], "", "SpaceObject", 1, 2, [0, 0, 0], [0, 0, 0.75], 13, 10, 7.9, 0.075, [2, 0.5], [[1, 1, 1, 1], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _this];
spark2 setDropInterval 0.002;

lightflash = "#lightpoint" createVehicle [0,0,0];
lightflash setLightBrightness 2;
lightflash setLightDayLight true;
lightflash setLightUseFlare true;
lightflash setLightFlareSize 5;
lightflash setLightFlareMaxDistance 5;
lightflash setLightAmbient [0,0,1];
lightflash setLightColor [0,0,1];
lightflash lightAttachObject [_this,[0,0,0]];

playSound3D ["A3\Sounds_F\ambient\thunder\thunder_03.wss", this, false, getPosASL this, 5, 1.5, 0];

sleep 3;

deleteVehicle lightflash;
deleteVehicle distort1;
deleteVehicle spark1;
deleteVehicle spark2;
", [], 7, true, true, "", "_this == driver _target"];

 

This is the script that adds effects:

Spoiler

distort1 = "#particlesource" createVehicle position _this;
distort1 setParticleCircle [0, [0, 0, 0]]; 
distort1 setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0]; 
distort1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 8, 3, 1], "", "Billboard", 1, 0.5, [0, 0, 0], [0, 0, 0.75], 0, 10, 15, 0.075, [1,20], [[1, 1, 1, 1], [1, 1, 1, 1]], [0.5], 1, 0, "", "", _this]; 
distort1 setDropInterval 1.0;

spark1 = "#particlesource" createVehicle (getpos _this);
spark1 setParticleRandom [0, [0.25, 0.25, 0], [5, 5, 5], 0, 0.1, [0, 0, 0, 0.1], 0, 0];
spark1 setParticleParams [["\A3\data_f\proxies\muzzle_flash\mf_sparks_01.p3d", 1, 0, 1], "", "SpaceObject", 1, 2, [0, 0, 0], [0, 0, 0.75], 13, 10, 7.9, 0.075, [2, 0.5], [[1, 1, 1, 1], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _this];
spark1 setDropInterval 0.002;

spark2 = "#particlesource" createVehicle (getpos _this);
spark2 setParticleRandom [0, [0.25, 0.25, 0], [5, 5, 5], 0, 0.1, [0, 0, 0, 0.1], 0, 0];
spark2 setParticleParams [["\A3\data_f\proxies\muzzle_flash\mf_sparks_02.p3d", 1, 0, 1], "", "SpaceObject", 1, 2, [0, 0, 0], [0, 0, 0.75], 13, 10, 7.9, 0.075, [2, 0.5], [[1, 1, 1, 1], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _this];
spark2 setDropInterval 0.002;

lightflash = "#lightpoint" createVehicle [0,0,0];
lightflash setLightBrightness 2;
lightflash setLightDayLight true;
lightflash setLightUseFlare true;
lightflash setLightFlareSize 5;
lightflash setLightFlareMaxDistance 5;
lightflash setLightAmbient [0,0,1];
lightflash setLightColor [0,0,1];
lightflash lightAttachObject [_this,[0,0,0]];

playSound3D ["A3\Sounds_F\ambient\thunder\thunder_03.wss", this, false, getPosASL this, 5, 1.5, 0];

sleep 3;

deleteVehicle lightflash;
deleteVehicle distort1;
deleteVehicle spark1;
deleteVehicle spark2;

 

It works perfectly as a stand alone thing, however when I put it into addaction, it gives me error saying this:

Spoiler

srbpZLW.png

Any idea whats wrong? Why cant I execute it?
I assume it might be too long or smth and I might need to group those scripts together and name them? (making sqf is not an option)

Share this post


Link to post
Share on other sites

In the addAction script param, you have wrapped your code in double quotes. Use curled brackets. Putting the code in an addAction without necessary adjustments to some variables also broke the code.
 

Spoiler

this addAction ["<t color='#FF0000'>Gravity Break", 
{ 
params ["_target", "_caller", "_actionId", "_arguments"]; 
 
_target setvelocity [0 * (sin (getdir _target )), 0 * (cos (getdir _target )), 0]; 
 
distort1 = "#particlesource" createVehicle (getpos _target); 
distort1 setParticleCircle [0, [0, 0, 0]];  
distort1 setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0];  
distort1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 8, 3, 1], "", "Billboard", 1, 0.5, [0, 0, 0], [0, 0, 0.75], 0, 10, 15, 0.075, [1,20], [[1, 1, 1, 1], [1, 1, 1, 1]], [0.5], 1, 0, "", "", _target];  
distort1 setDropInterval 1.0; 
 
spark1 = "#particlesource" createVehicle (getpos _target); 
spark1 setParticleRandom [0, [0.25, 0.25, 0], [5, 5, 5], 0, 0.1, [0, 0, 0, 0.1], 0, 0]; 
spark1 setParticleParams [["\A3\data_f\proxies\muzzle_flash\mf_sparks_01.p3d", 1, 0, 1], "", "SpaceObject", 1, 2, [0, 0, 0], [0, 0, 0.75], 13, 10, 7.9, 0.075, [2, 0.5], [[1, 1, 1, 1], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _target]; 
spark1 setDropInterval 0.002; 
 
spark2 = "#particlesource" createVehicle (getpos _target); 
spark2 setParticleRandom [0, [0.25, 0.25, 0], [5, 5, 5], 0, 0.1, [0, 0, 0, 0.1], 0, 0]; 
spark2 setParticleParams [["\A3\data_f\proxies\muzzle_flash\mf_sparks_02.p3d", 1, 0, 1], "", "SpaceObject", 1, 2, [0, 0, 0], [0, 0, 0.75], 13, 10, 7.9, 0.075, [2, 0.5], [[1, 1, 1, 1], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _target]; 
spark2 setDropInterval 0.002; 
 
lightflash = "#lightpoint" createVehicle [0, 0, 0]; 
lightflash setLightBrightness 2; 
lightflash setLightDayLight true; 
lightflash setLightUseFlare true; 
lightflash setLightFlareSize 5; 
lightflash setLightFlareMaxDistance 5; 
lightflash setLightAmbient [0, 0, 1]; 
lightflash setLightColor [0, 0, 1]; 
lightflash lightAttachObject [_target, [0, 0, 0]]; 
 
playSound3D ["A3\Sounds_F\ambient\thunder\thunder_03.wss", _target, false, getPosASL _target, 5, 1.5, 0]; 
 
sleep 3; 
 
deleteVehicle lightflash; 
deleteVehicle distort1; 
deleteVehicle spark1; 
deleteVehicle spark2; 
},  
[], 7, true, true, "", "_this == driver _target"];

 

 

https://community.bistudio.com/wiki/addAction

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×