Home   Help Search Login Register  

Author Topic: Luftabwehr (Air Defense System (ADS))  (Read 1065 times)

0 Members and 1 Guest are viewing this topic.

Pliskin

  • Guest
Luftabwehr (Air Defense System (ADS))
« on: 20 May 2003, 17:38:45 »
Hi there !
hey guys, I got a problem:
I made a Luftabwehr AddOn (Air Defense system (ADS)). If the Scripts starts, the explosion aren`t in the Air, they are on the ground. The explosions should be in the Air. Here is my Script: (Do somebody know, how to create Rockets with the  Camcreate  command ? If yes, please wrote it in this sript. The Rocket has to fly in the Air; if you need my .p3d, I can send ya)

SCRIPT NAME:  Air_Bombing.sqs
>>>>>>>>>>> Start <<<<<<<<<<<<<<<<


;========================
; Script by   Pliskin
;========================
;name and select this
_Luftabwehr = _this select 0
;number of explosions
_num = 80
;spreading area
_spread = 100
;random delay between explosions
_delay = 1.4

;counter to keep track of how many explosions so far
_count = 0

;beginning of loop
#beg

;setting everything to zero
_nx = 0
_ny = 0
_nz = 0
_x  = 0
_y  = 0

;generates plus or minus 1
_plusminus = (random 10)
?(_plusminus <= 5) : _plusminus = -1
?(_plusminus > 5) : _plusminus = 1

;determines how far off center the explosion will happen
_nx = (random _spread) * _plusminus

_plusminus = (random 10)
?(_plusminus <= 5) : _plusminus = -2
?(_plusminus > 5) : _plusminus = 2
_ny = (random _spread) * _plusminus

;determining floor and ceiling of explosions
_height = random (140)
?(_height < 140):_height = _height + 140

;new coordinates of explosion (I don't have _z or _nz in here because it's always 0
;you can easily add air bursts though.
_nx = _nx + _x
_ny = _ny + _y
_nz = _nz + _height

;add random delay up to delay specified by user (if you want constant rate, just take out the random
~(random _delay)

;creating explosion
Explo1="HandGrenade" CamCreate [(getpos _Luftabwehr select 0)+_nx,(getpos _Luftabwehr select 1)+_ny,_nz]
Explo2="Heat105"     CamCreate [(getpos _Luftabwehr select 0)+_nx,(getpos _Luftabwehr select 1)+_ny,_nz]
;increment counter
_count = _count + 1

;check if done
?(_count == _num):exit

;if not done, do another explosion
goto "beg"

exit

>>>>>>>>>>> End <<<<<<<<<<<<<<<<


And I think, in my config.cpp is a error,too: If a east Plane is in a radius from 200m. of my Luftabwehr AddOn, it should start to fire the Rockets, but it does nothing:


>>>>>>>>>>> Start <<<<<<<<<<<<<<

// |(((((((((((((((|
// | By Pliskin   |
// |)))))))))))))))|
class CfgPatches
{
class EPM_Luftabwehr
{
units[] = {EPM_Luftabwehr};
weapons[] = {};
requiredVersion = 1.90;
};
};
class CfgVehicles
{
class All {};
class Static: All {};
class Building: Static {};
class NonStrategic: Building {};
class TargetTraining: NonStrategic {};
class TargetGrenade: TargetTraining {};
class EPM_Luftabwehr: TargetGrenade
{
model="\EPM_Luftabwehr\Luftabwehr-feuer-rampe.p3d";  // where the model is
armor=80000;                                         // I dunnow
vehicleClass="EPM Objects";                          // Thats a own folder
scope=2;                                             // I dunnow
displayName="Luftabwehr System";                     // Name on the display
};
};
class UserActions                                    // HELP ME
{
class Alarm
{
displayName="Raketen abfeuern";                          // ?
radius=200;                                              // this is the radius, where my AddOn should start to fire if a enemy                                                    // plane is in it
activationBy="EAST";                                     // That I copy from a trigger
activationType="WEST D";                                 // That, too
condition="this";                                        // This, too
statement="[] exec ""\EPM_Luftabwehr\Air_Bombing.sqs"""; // Yeah, this too.
};
};      // FUCKIN, WHATS WRONG ?
};


>>>>>>>>>>> End <<<<<<<<<<<<<<<<


I Hope you can understand this mail.

 
Greatings:  Pliskin
 
My Mail: KSK-actions@web.de
~S~CD
   
 
« Last Edit: 20 May 2003, 17:45:14 by Pliskin »

FAB

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #1 on: 28 May 2003, 18:14:07 »
Explo1="HandGrenade" CamCreate [(getpos _Luftabwehr select 0)+_nx,(getpos _Luftabwehr select 1)+_ny,_nz]
Explo2="Heat105"     CamCreate [(getpos _Luftabwehr select 0)+_nx,(getpos _Luftabwehr select 1)+_ny,_nz]

Someone correct me if I'm wrong, as I'm a newbie in scripting (I'm working on my first script), but you will not get your grenade and Heat105 to explode like that.
Thoose ammo needs to hit something to explode.

you can make your Heat105 exploding by adding a second one at the same location:

Code: [Select]
Explo2="Heat105"     CamCreate [(getpos _Luftabwehr select 0)+_nx,(getpos _Luftabwehr select 1)+_ny,_nz]
Explo3="Heat105"     CamCreate [(getpos _Luftabwehr select 0)+_nx,(getpos _Luftabwehr select 1)+_ny,_nz]

Unfortunatly, The smoke effect will never work if not on the ground. The only way I found to simulate smoke at any height is to create a special fire object or you can use the drop command...

Hope that's what you're talking about...


« Last Edit: 28 May 2003, 18:21:57 by FAB »

Offline raedor

  • Members
  • *
    • VBS2
Re:Luftabwehr (Air Defense System (ADS))
« Reply #2 on: 28 May 2003, 18:28:11 »
yes, u're right, FAB. u need a second grenade if u want something like a grenade to explode...

FAB

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #3 on: 29 May 2003, 19:40:51 »
it doenst work for me if you have a second grenade. I think the "add it twice" trick only works with the shells.

If you need some smoke effect, the best thing to do is to create a new kind of SmokeShell (with different smoke properties of course), with very limited lifetime. I did it and it works nice.

Pliskin

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #4 on: 02 Jun 2003, 14:53:33 »
yes, right. But how ? The explosions are spreading. (If you understand what I meen)
The explosions aren`t at the same position.

FAB

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #5 on: 02 Jun 2003, 19:09:04 »
No, I'm not sure to understand what's exactly the problem now ?
Do you mean you cant get to put two shells at the exact same coordinates ?

Pliskin

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #6 on: 03 Jun 2003, 15:51:06 »
yes, I do. I think I cant get to put two shells at the exact same coordinates, 'cuz the explosions are somewhere in a radius of 500m.
and I`m sorry for my English.  :'(

FAB

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #7 on: 03 Jun 2003, 18:44:09 »
I dont really see where is the problem to put 2 shells at the same coordinates.
This is why your script do (in pseudo code):

Code: [Select]
loop

coord = randomly generated coordinates;

create shell1 at coord;
create shell2 at coord;

end loop

the value of coord here doesnt change until the script comes back to "coord = randomly generated coordinates;".

It means that the two shells are at the exact same coordinates. Apparently, that's what your script do, so you shouldnt have any problem with that ?

Pliskin

  • Guest
Re:Luftabwehr (Air Defense System (ADS))
« Reply #8 on: 05 Jun 2003, 16:01:25 »
cool. But could you put it in my script, please ?