Advertisement

Author Topic: Simlpe Rocktes & Bombs  (Read 1536 times)

0 Members and 1 Guest are viewing this topic.

Offline LurchiDerLurch

  • Members
  • *
Simlpe Rocktes & Bombs
« on: 25 Apr 2010, 13:48:11 »
Simlpe Rocktes & Bombs


This script is intended for mission makers who want a easy to use tool for creating rocket- or bomb-attacks by simply filling some parameters.
It's not meant to be a cinematic simulation but it serves the purpose. If you want more realistic weapon systems you better use Mando Missile.

Download

The rockets and bombs are moved with a script which can float an object to another position f.e:

Code: [Select]
[object,target,modelToWorld,speed,distance,correct,final]spawn float;
object: the object you want to move
target: unit or position (if you pass a unit the object will follow that unit)
modelToWorld: Array position from object model space f.e: [0,5,0] is 5m in front of the target, [0,0,5] is 5m above the target
speed: Speed for rockets (f.e: 0.1 fast, 1 slow)
distance: The script will terminate at this distance to the target
correct: Correct angle to target
final: Set the object to the final position as soon as the script terminates

In theory the object approachs the target arbitrary but will never reach it.

Feel free to use this script in your mission.

Used Scripts:

- mando_angles.sqf v1.0 by Mandoble (http://www.ofpec.com/ed_depot/index.php?action=details&id=441&game=ArmA)

********************

Example Mission:

The example mission shows you all 5 scripts in action:

1. The jeep gets hit by 4 rocktes that come from north (angle 0), 500m away and at an altitude of 500m.
2. The AA shoots two missles at plane1.
3. Tank1 gets hit by a bomb that comes from South (angle 180), 500m away and at an altitude of 500m.
4. Plane2 waits until the distance to tank2 is less than 300m and then a bomb is created 5m under plane2 which flys to tank2.
5. The parachute floats to the player.

********************

Some examples (you can find them in the example mission's init file):

1. Rocket Attack:

Code: [Select]
[jeep,[0,0,-5],4,0,500,500,"Sh_125_HE",0.75]spawn rockets;
Code: [Select]
[target, modelToWorld, number, angle, distance, altitute, warhead, speed]spawn rockets;
target: unit or position (if you pass a unit the rockets will follow that unit)
modelToWorld: Array position from object model space f.e: [0,5,0] is 5m in front of the target, [0,0,5] is 5m above the target
number: Number of rockets
angle: Direction where the rockets come from (0-360)
distance: Distance of rockets to start from
altitute: Altitute of rockets to start from
warhead: Warhead of rockets f.e: "Bo_GBU12_LGB","Sh_125_SABOT","Sh_125_HE"
speed: Speed for rockets (f.e: 0.1 fast, 1 slow)


2. Rocket Attack 2:
this script can handle a start position for the rockets f.e. an AA

Code: [Select]
[plane1,[0,5,0],AA modelToWorld[0,0,1],2,"Sh_125_HE",0.1]spawn rockets2;
Code: [Select]
[target, modelToWorld, start, number, warhead, speed]spawn rockets2;
target: unit or position (if you pass a unit the rockets will follow that unit)
modelToWorld: Array position from object model space f.e: [0,5,0] is 5m in front of the target, [0,0,5] is 5m above the target
start: Start position for rockets
number: Number of rockets
warhead: Warhead of rockets f.e: "Bo_GBU12_LGB","Sh_125_SABOT","Sh_125_HE"
speed: Speed for rockets (f.e: 0.1 fast, 1 slow)


3. Bomb Attack:

Code: [Select]
[tank1,[0,0,0],180,500,500,"Bo_GBU12_LGB"]spawn bomb;
Code: [Select]
[target, modelToWorld, angle, distance, altitute, warhead, speed]spawn bomb;
target: unit or position (if you pass a unit the bomb will follow that unit)
modelToWorld: Array position from object model space f.e: [0,5,0] is 5m in front of the target, [0,0,5] is 5m above the target
angle: Direction where the bomb comes from (0-360)
distance: Distance of bomb to start from
altitute: Altitute of bomb to start from
warhead: Warhead of bomb f.e: "Bo_GBU12_LGB","Sh_125_SABOT","Sh_125_HE"


4. Bomb Attack 2:
this script can handle a start position for the bomb f.e. an aircraft

Code: [Select]
waitUntil{sleep 0.1;(tank2 distance plane2 < 300)}; //wait until plane is close enough to the target
[tank2,[0,0,0],plane2 modelToWorld[0,0,-5],"Bo_GBU12_LGB"]spawn bomb2;

plane modelToWorld[0,0,-5] is the position 5m under the aircraft

Code: [Select]
[target, modelToWorld, start, warhead]spawn bomb2;
target: unit or position (if you pass a unit the bomb will follow that unit)
modelToWorld: Array position from object model space f.e: [0,5,0] is 5m in front of the target, [0,0,5] is 5m above the target
start: Start position for bomb
warhead: Warhead of bomb f.e: "Bo_GBU12_LGB","Sh_125_SABOT","Sh_125_HE"


5. float object:
this script can float an object to another position/object

example is rather useless but funny

Code: [Select]
[parachute,player,[0,0,0],0.5,1,false,false]spawn float;
Code: [Select]
[object,target,modelToWorld,speed,distance,correct,final]spawn float;
object: the object you want to move
target: unit or position (if you pass a unit the object will follow that unit)
modelToWorld: Array position from object model space f.e: [0,5,0] is 5m in front of the target, [0,0,5] is 5m above the target
speed: Speed for rockets (f.e: 0.1 fast, 1 slow)
distance: The script will terminate at this distance to the target
correct: Correct angle to target
final: Set the object to the final position as soon as the script terminates

********************


Lurchi

Offline Katrician

  • Members
  • *
Re: Simlpe Rocktes & Bombs
« Reply #1 on: 21 Jul 2010, 16:47:46 »
It looks fantastic I will give it a try  :clap:
Quote
People do what they must.
rpm666 from Overclock.net