OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: 456820 on 27 Jan 2006, 11:47:14

Title: AA fire
Post by: 456820 on 27 Jan 2006, 11:47:14
im wondering is it possible to have a Shilka fire short bursts into the air spaced out between a few seconds. If you have seen Band of brothers towards the end of Day of day Lt. Winters is staning on his own in the dark watching short bursts of AA fire up into the sky.
Im looking for that effect but with in OFP
I could place an invisible addon but i would like a none addon way
Cheers
Title: Re:AA fire
Post by: nominesine on 27 Jan 2006, 12:04:37
Try:
Code: [Select]
shilka1 Fire ["muzzle", "mode"]
shilka1 Fire ["muzzle", "mode"]
shilka1 Fire ["muzzle", "mode"]
~3
shilka1 Fire ["muzzle", "mode"]
shilka1 Fire ["muzzle", "mode"]
shilka1 Fire ["muzzle", "mode"]
~3
etc

I don't know the name for the weapons and the fire mode of the Shilka. But they can be found in the commented Comref in the Editors Depot
Title: Re:AA fire
Post by: 456820 on 27 Jan 2006, 21:10:39
cheers for that but will the shilkas fire straight up in the air using that? Ill have a quick go in a minute or so.
Title: Re:AA fire
Post by: nominesine on 27 Jan 2006, 22:00:37
If you give the shilkas a fire command, without a specific target (as in the example above) they will most likely fire their rounds into thin air
Title: Re:AA fire
Post by: Mandoble on 27 Jan 2006, 22:19:57
First, dont get horrified by the number of arguments, you only need to play with the array where you see the sin and the cos, this is the "sky" position where the bullets will go [x,y,z] when the target is objNull. In the example, 800m ahead of the shilka, 100m alt.

You may also play with the "smoke type" argument (---> 0, 0.5, true, false, false)
0 means no smoke, 1 to 5 are different types of smokes for the rounds, for example 5 for a thin smoke trail (---> 5, 0.5, true, false, false).

The first array [0,2,2.5] indicates relative position from the center of the firing unit [angle, radius, altitude], in this example, 2m ahead, 2.5m high (where the guns of the shilka are placed).

Lets say your shilka's name is shilka
Each call to this script will fire a "Bullet4x23" round from the indicated unit (shilka) to the indicated space position.

Just execute it with the desired frequency at the desired positions.

Code: [Select]
[shilka, objNull, 300, 0, 0, 0, "Bullet4x23", "", 1, 0, [0,2,2.5], [(getPos shilka select 0)+sin(getDir shilka)*800,(getPos shilka select 0)+cos(getDir shilka)*800,100], 1, 0, 0.01, 4, 2, 0, 0.5, true, false, false]exec"mandomisil.sqs"

Find the script attached to this post, just copy it into your mission folder.

It is part of the mandomisil suite currently available at the Resource Betatesting forum.