Home   Help Search Login Register  

Author Topic: Fireball problem  (Read 2522 times)

0 Members and 1 Guest are viewing this topic.

Offline tateyou

  • Members
  • *
Fireball problem
« 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:

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #1 on: 25 Jul 2008, 11:20:08 »
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.
Code: [Select]
_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, "", "", ""];
};

Offline tateyou

  • Members
  • *
Re: Fireball problem
« Reply #2 on: 25 Jul 2008, 11:49:40 »
I defined the _pos and the_drop2,but there still was an "error type object,expected array",what shall i do?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #3 on: 25 Jul 2008, 12:40:01 »
_drop2 was already defined.

_drop2 = "\ca\data\cl_exp";  // <- Explosion like particle class

How is looking your script now?

Offline tateyou

  • Members
  • *
Re: Fireball problem
« Reply #4 on: 25 Jul 2008, 12:59:30 »
Still the same problem ???

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #5 on: 25 Jul 2008, 13:18:00 »
And again, How is looking your script now? May you copy/paste here as well as how are you executing it?

Offline tateyou

  • Members
  • *
Re: Fireball problem
« Reply #6 on: 25 Jul 2008, 14:20:11 »
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:

Code: [Select]
_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
« Last Edit: 25 Jul 2008, 16:20:11 by bedges »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #7 on: 25 Jul 2008, 14:30:19 »
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

Offline tateyou

  • Members
  • *
Re: Fireball problem
« Reply #8 on: 25 Jul 2008, 14:44:32 »
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" :-[

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #9 on: 25 Jul 2008, 14:55:45 »
res = []execVM"whatever.sqf";

Offline tateyou

  • Members
  • *
Re: Fireball problem
« Reply #10 on: 25 Jul 2008, 15:00:28 »
the game says there is an error in line 22,but i can't find it
and thanks for your time and your patient

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #11 on: 25 Jul 2008, 15:38:24 »
Copy and paste here your current script as well as how and from where are you executing it.

Offline tateyou

  • Members
  • *
Re: Fireball problem
« Reply #12 on: 25 Jul 2008, 15:53:08 »
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:

Code: (add.sqs) [Select]
ID= player addaction ["action","setfire.sqs"];
exit;


Code: (setfire.sqs) [Select]
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;


Code: (big.sqf) [Select]
~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, "", "", ""];
};
« Last Edit: 25 Jul 2008, 16:19:42 by bedges »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Fireball problem
« Reply #13 on: 25 Jul 2008, 16:17:35 »
Please use the code format button when including a script in your post.  :good:

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fireball problem
« Reply #14 on: 25 Jul 2008, 16:22:34 »
You have
Code: [Select]
_pos = target; // Position of the explosion, but target in your case is an object, so, as indicated above, use
Code: [Select]
_pos = getPos target; // Position of the explosion