Home   Help Search Login Register  

Author Topic: Angle mesurement script!  (Read 2920 times)

0 Members and 1 Guest are viewing this topic.

UNN

  • Guest
Re:Angle mesurement script!
« Reply #15 on: 01 Jul 2005, 14:59:52 »
I noticed your using FDF mortars? These are configured differently to say SEB Nam or Inv44. Thats probably not the cause of your error message, but it might explain why you are having so much trouble.

Inv44 mortars work as follows:

0 degrees Horizontal
90 degrees Vertical

FDF goes the other way round:

0 degrees Vertical
90 degress Horizontal

You could always use this:

Mortar Addon (FDF)

And type this in it's in it field:

Code: [Select]
[Group This,Target] Call FCU_GroupFireTarget
Shameless plug I know, but it's easier than typing out the triganometry required to do the same thing for your script  :P

I will, if you want me to :) As I would always encourage people to do there own thing, just depends how much time you want to spend doing it?
« Last Edit: 01 Jul 2005, 15:02:32 by UNN »

Offline RobinHansenDK

  • Members
  • *
  • I'm a llama!
Re:Angle mesurement script!
« Reply #16 on: 04 Jul 2005, 23:13:04 »
Even though the username is not quite the same it's still me -->accedently logged me self out and forgot my password (...just hate when such thing happens! >:()

So:
Actualy forget about the mortars. The error mentioned is here shown on the attached .jpg.

Im trying to find out the fireparameters of the BM-21 (Our weapon). If I replace the FDF-mortars with the BM-21 it elevates just like mortars, so I'm pretty sure that the script needs some different parameters for the BM-21

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Angle mesurement script!
« Reply #17 on: 04 Jul 2005, 23:23:40 »
Are you positive that you have defined the variables Artillery, Target, and Height? ???
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline RobinHansenDK

  • Members
  • *
  • I'm a llama!
Re:Angle mesurement script!
« Reply #18 on: 05 Jul 2005, 00:02:10 »
Not at all...

Rocketlauncher --> "Artillery"
Jeep --> "Target"
Height --> "???"

"Height" is the problem! Remember I just copyed the line from the tutorial...

Offline RobinHansenDK

  • Members
  • *
  • I'm a llama!
Re:Angle mesurement script!
« Reply #19 on: 05 Jul 2005, 00:41:26 »
I'm pretty sure that when this script works with rocketlaunchers, cannons, tanks etc. then my problems will be solved... :D

http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=22918
« Last Edit: 05 Jul 2005, 00:43:01 by RobinHansenDK »

UNN

  • Guest
Re:Angle mesurement script!
« Reply #20 on: 05 Jul 2005, 10:56:26 »
Well for the time being just experiment with the height value to see how it works:

Code: [Select]
Artillery DoWatch [GetPos _Target Select 0,GetPos _Target Select 1,1000]
If the target is 1000 meters away, setting the height to 1000 should give you a angle of 45 degrees.

Offline RobinHansenDK

  • Members
  • *
  • I'm a llama!
Re:Angle mesurement script!
« Reply #21 on: 05 Jul 2005, 14:08:44 »
Now I got rid of the error message...but now for the 1.000.000$ question! How do I get the AI to fire? I've tried the command way --> F2 - 3 - 3 (Fire) but the moron won't follow orders... ;)

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Angle mesurement script!
« Reply #22 on: 06 Jul 2005, 10:05:59 »
Okay, I think we are talking in circles here... a lack of communication about what exactly you want, what you currently have, and what you know.

Try this. Make yourself a script called "fire.sqs". Inside of that script, write the following:

Code: [Select]
arty dowatch [getpos target select 0, getpos target select 1, 100]
~2
arty fire (weapons arty select 0)
exit

Next, name the vehicle that you want to be firing "arty". Then, name the target you want it to fire at "target".

Use this line in a trigger's "on activation" field in order to run that script:

[] exec "fire.sqs"

Now, try running the script in your mission. Watch how the launched missle/shell whatever lands. Then adjust the number 100 in the script above, until you can get the weapon to hit properly. If the arty is shooting past the target, lower the number. If it isn't shooting far enough, then raise the number. After enough trial and error you will be able to get it to hit.

One note: this will only work when the artillery and the target stay in the exact same positions! If they move, then you will have to find a new value (instead of 100 or whatever you ended up with). If you want to make a script that will work no matter where the target or shooter are, then it will be more complicated, but first start out by getting the above script to work.



PS: The script of mine you linked to doesn't work with vehicles. Once I finish that script, I'll make a version specifically for vehicles.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!