OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: terran4999 on 14 Jun 2008, 02:01:52

Title: Launch Scud Script
Post by: terran4999 on 14 Jun 2008, 02:01:52
Hello

I have looked all over the Editor Depot and did some google searching and found no scud launch script. I want the scud to launch and then hit a target area marked by a gamelogic. Would anyone be kind enough to post their script ???
Title: Re: Launch Scud Script
Post by: Gcfungus on 14 Jun 2008, 09:37:24
For this you would need 2 parts of a script. First part launches the scud, and the second would create an explosion.

The first part would look something like this:

Code: [Select]
scudname Action ["SCUD LAUNCH"]
~13
scudname Action ["SCUD START"]

I'm not sure about the length in between, but I think 13 should be enough.
The first command points the rocket upwards, and the second launches it.

Unfortunately, the rocket is just for looks, it doesn't actually do anything, so you'll need a second part to create the explosion.

It would look something like this:
Code: [Select]
_ammo = "LaserGuidedBomb"
_pos = getmarkerpos "bombmarker
_x = _pos select 0
_y = _pos select 1
_z = 50
_bomb = _ammo camcreate [_x,_y,_z]

You can change the following: the _ammo type, the marker name, and the _z position (height)
Note: the previous will only create one LGB. If you want a bigger explosion, then the script will need to be changed to create multiple ones.

Hope it works,
-=GC=-Fungus1999
Title: Re: Launch Scud Script
Post by: terran4999 on 14 Jun 2008, 23:02:26
Hey

I just want to know if this command is correct:
 
Code: [Select]
"_X flyinheight 50" foreach units this


If this is a valid command why is it not working? I tried putting this in the WP Activation and well as in the Init of units