Home   Help Search Login Register  

Author Topic: Sefe´s guided bullet script?  (Read 838 times)

0 Members and 1 Guest are viewing this topic.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Sefe´s guided bullet script?
« 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.

Offline Sefe

  • OFPEC Patron
  • Former Staff
  • ****
Re:Sefe´s guided bullet script?
« Reply #1 on: 03 Feb 2003, 18:28:55 »
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
« Last Edit: 03 Feb 2003, 18:32:15 by Sefe »

Offline Sefe

  • OFPEC Patron
  • Former Staff
  • ****
Re:Sefe´s guided bullet script?
« Reply #2 on: 03 Feb 2003, 18:41:56 »
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.
« Last Edit: 03 Feb 2003, 18:55:36 by Sefe »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Sefe´s guided bullet script?
« Reply #3 on: 03 Feb 2003, 19:21:02 »
DoesnÂ't seem to work, IÂ'll have to use da strait-down version.

Thx

Offline Sefe

  • OFPEC Patron
  • Former Staff
  • ****
Re:Sefe´s guided bullet script?
« Reply #4 on: 03 Feb 2003, 19:31:24 »
Don't give up that quickly. What doesn't work? After my posts, I tested the scripts and they worked for me.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Sefe´s guided bullet script?
« Reply #5 on: 03 Feb 2003, 19:34:11 »
I found another way. I camcreate a bullet inside a soldier, he dies.

Thx.

*TOPIC SOLVED AND LOCKED*
« Last Edit: 03 Feb 2003, 19:36:48 by The real Armstrong »