OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: tateyou on 25 Jul 2008, 10:59:55
-
I want to make an airburst,so i want create a big fireball in the mid-air,but i tried couple of ways in drop[] and still can't figure out how...
I don't even know what particle to use,Help :weeping:
-
This is a fragment of a mando missile warhead creating a fireball that goes from bright orange to black smoke. The arrays you see there with numbers are colours (colour transition along the life-time of the particle). The code is for sqf script type.
_pos = ????? // Position of the explosion
_drop1 = "\Ca\Data\ParticleEffects\RocketSmoke\RocketSmoke";
_drop2 = "\ca\data\cl_exp"; // <- Explosion like particle class
_maxspd = 20;
_mass = 1.275;
_vol = 1.0;
_rubb = 1;
_size1 = [3,7.5,11,15];
_size2 = [4,15];
_numdrops = 60;
for [{_i = 0},{_i < _numdrops},{_i = _i + 1}] do
{
_angh = random 359;
_angv = (random 180) - 90;
_rad = 20 + random _maxspd;
_radv = abs(_rad * sin(_angv));
_radh = abs(_rad * cos(_angv));
_vel = [sin(_angh)*_radh, cos(_angh)*_radh, sin(_angv)*_radv];
drop [_drop1, "", "Billboard", 1, 3, _pos, _vel, 0.5, _mass, _vol, _rubb/2, _size1, [[1,1,1,0.6],[0,0,0,0.5],[0,0,0,0.4],[0.5,0.5,0.5,0]], [0,1,0], 5, 0.05, "", "", ""];
_vel = [sin(_angh)*_radh, cos(_angh)*_radh, sin(_angv)*_radv];
drop [_drop2, "", "Billboard", 1, 1, _pos, _vel, 0.5, _mass, _vol, _rubb/1.5, _size2, [[1,0.5,0,0.6],[1,1,1,0.5],[1,1,1,0.4],[1,1,1,0]], [0,1,0], 5, 0.05, "", "", ""];
};
-
I defined the _pos and the_drop2,but there still was an "error type object,expected array",what shall i do?
-
_drop2 was already defined.
_drop2 = "\ca\data\cl_exp"; // <- Explosion like particle class
How is looking your script now?
-
Still the same problem ???
-
And again, How is looking your script now? May you copy/paste here as well as how are you executing it?
-
Sorry,i'm not very good in english :P
do you mean that how did my script looks like?if so,i first used an addaction,then a mapclick script,and by the mapclick to execute your script,looks like below:
_pos = target // Position of the explosion
_drop1 = "\Ca\Data\ParticleEffects\RocketSmoke\RocketSmoke";
_drop2 = "\ca\data\cl_exp"; // <- Explosion like particle class
_maxspd = 20;
_mass = 1.275;
_vol = 1.0;
_rubb = 1;
_size1 = [3,7.5,11,15];
_size2 = [4,15];
_numdrops = 60;
for [{_i = 0},{_i < _numdrops},{_i = _i + 1}] do
{
_angh = random 359;
_angv = (random 180) - 90;
_rad = 20 + random _maxspd;
_radv = abs(_rad * sin(_angv));
_radh = abs(_rad * cos(_angv));
_vel = [sin(_angh)*_radh, cos(_angh)*_radh, sin(_angv)*_radv];
drop [_drop1, "", "Billboard", 1, 3, _pos, _vel, 0.5, _mass, _vol, _rubb/2, _size1, [[1,1,1,0.6],[0,0,0,0.5],[0,0,0,0.4],[0.5,0.5,0.5,0]], [0,1,0], 5, 0.05, "", "", ""];
_vel = [sin(_angh)*_radh, cos(_angh)*_radh, sin(_angv)*_radv];
drop [_drop2, "", "Billboard", 1, 1, _pos, _vel, 0.5, _mass, _vol, _rubb/1.5, _size2, [[1,0.5,0,0.6],[1,1,1,0.5],[1,1,1,0.4],[1,1,1,0]], [0,1,0], 5, 0.05, "", "", ""];
};
exit;
i hve an invisible h called target on the map
-
As said, this is sqf code so:
_pos = target // Position of the explosion (missing ; there)
--->
_pos = target; // Position of the explosion
Also remove exit; at the end.
And your target needs to be a position, if it is an object, then:
_pos = getPos target; // Position of the explosion
-
My bad,i forgot it's a .sqf script,sorry for wasting your time
I never used a .sqf before,how should i execute it from script?
I just know [] exec "name.sqs" :-[
-
res = []execVM"whatever.sqf";
-
the game says there is an error in line 22,but i can't find it
and thanks for your time and your patient
-
Copy and paste here your current script as well as how and from where are you executing it.
-
i had a man player on map and an invisible h called target,[] exec "add.sqs" in the player's init.
the scripts are like these:
ID= player addaction ["action","setfire.sqs"];
exit;
setfire=true;
titleText ["Click on the map to set your firedirection","plain down"];
onMapSingleClick "target setPos _pos; setfire=false";
@!setfire;
"Firepoint" setMarkerPos getPos target;
onMapSingleClick "";
res = []execVM"big.sqf";
titleText ["","plain down"];
"firepoint" setmarkerpos [0,0]
exit;
~4
_pos = target; // Position of the explosion
_drop1 = "\Ca\Data\ParticleEffects\RocketSmoke\RocketSmoke";
_drop2 = "\ca\data\cl_exp"; // <- Explosion like particle class
_maxspd = 20;
_mass = 1.275;
_vol = 1.0;
_rubb = 1;
_size1 = [3,7.5,11,15];
_size2 = [4,15];
_numdrops = 60;
for [{_i = 0},{_i < _numdrops},{_i = _i + 1}] do
{
_angh = random 359;
_angv = (random 180) - 90;
_rad = 20 + random _maxspd;
_radv = abs(_rad * sin(_angv));
_radh = abs(_rad * cos(_angv));
_vel = [sin(_angh)*_radh, cos(_angh)*_radh, sin(_angv)*_radv];
drop [_drop1, "", "Billboard", 1, 3, _pos, _vel, 0.5, _mass, _vol, _rubb/2, _size1, [[1,1,1,0.6],[0,0,0,0.5],[0,0,0,0.4],[0.5,0.5,0.5,0]], [0,1,0], 5, 0.05, "", "", ""];
_vel = [sin(_angh)*_radh, cos(_angh)*_radh, sin(_angv)*_radv];
drop [_drop2, "", "Billboard", 1, 1, _pos, _vel, 0.5, _mass, _vol, _rubb/1.5, _size2, [[1,0.5,0,0.6],[1,1,1,0.5],[1,1,1,0.4],[1,1,1,0]], [0,1,0], 5, 0.05, "", "", ""];
};
-
Please use the code format button (http://www.ofpec.com/forum/Themes/OFPEC_blue/images/bbc/code.gif) when including a script in your post. :good:
-
You have
_pos = target; // Position of the explosion
, but target in your case is an object, so, as indicated above, use
_pos = getPos target; // Position of the explosion
-
Where will the fireball appear?
This time no game crash,no error,but nothing happened as will,what's wrong with my script :weeping:
-
Should appear in the position of your target object named target. Do the following to your onMapSingleclick:
onMapSingleClick "target setPos [_pos select 0, _pos select 1, 3]; setfire=false"
This way you will have the fireball 3m above ground, else change 3 by 0.
-
Thank you so so much Mandoble,i have so many stupid questions and you just helped me one by one with patience.
You are :good: