OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dmakatra on 03 Feb 2003, 18:03:05
-
Hi! Those of you who have tried SefeÂ's guided missile script knows what IÂ'm looking for. An exactly the same script, but with a bullet, of anykind. I donÂ't want to use setdammage cause it dammage every bodypart and I want one in the head! Does this excist, or can you do it manually in the editor? Plz help.
Thx in advance.
-
You can create bullets but they'll fall down in a straight line. But if you are running that script on OFP Resistance you can use the setVelocity command to let the bullet fly in a certain direction. Try this script:
("Bullet7_6" camCreate (_this select 0)) setVelocity [(sin (_this select 1)) * (_this select 2), (cos (_this select 1)) * (_this select 2), 0]
Call it like this:
[ Position, Bearing, Speed ] Exec "ScriptName.sqs"
where Position is the [x, y, z] position array, Bearing the compass bearing of the bullet and Speed the speed in m/s. I haven't tested this solution so don't expect that it works from the start. ;D
-
If you want it more sophisticated (provided the first solution works ;D) you can do it like this:
("Bullet7_6" camCreate (_this select 0)) setVelocity [(sin (_this select 1)) * (sin (_this select 2)) * (_this select 3), (cos (_this select 1)) * (sin (_this select 2)) * (_this select 3), (cos (_this select 2)) * (_this select 3)]
Calling:
[ Position, HorzBearing, VertBearing, Speed ] Exec "ScriptName.sqs"
HorzBearing is the horizontal compass bearing and VertBearing is the vertical bearing (ie. up or down). The other parameters stay the same.
-
DoesnÂ't seem to work, IÂ'll have to use da strait-down version.
Thx
-
Don't give up that quickly. What doesn't work? After my posts, I tested the scripts and they worked for me.
-
I found another way. I camcreate a bullet inside a soldier, he dies.
Thx.
*TOPIC SOLVED AND LOCKED*