Home   Help Search Login Register  

Author Topic: Help needed to make ArmA Artillery useable  (Read 3975 times)

0 Members and 1 Guest are viewing this topic.

Offline wolf man

  • Members
  • *
Help needed to make ArmA Artillery useable
« on: 24 Jul 2007, 16:17:17 »
I would like to know if it is possible to get angle or compass bearing and elevation within the sight of an ArmA artillery piece.

Also, as the current shells do not destroy buildings, is there a way to have a menu option to load the guns with sabot?  and smoke shells would be good :)

I would love to use arty for indirect fire, but I would like the arty to be player controlled, and require skill and training.

This is for an MP tournament and would be used with Forward Observers.

I figured that if anyone would know if this was possible, it was you guys.


Offline firecontrol

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #1 on: 25 Jul 2007, 02:38:10 »
Well, I was envisioning placing a gamelogic somewhere quite far from the arty piece... and have it move with the barrel.
For instance.... wherever the muzzle of the arty piece is looking, there will be a game logic say, 1000 meters out.

As the muzzle raises or lowers in elevation, then the gamelogic's height above the arty's height will be adjusted. In essence, you will have a gamelogic 1km away, at any angle, and at varying heights.

We can get the angle the muzzle is elevated by doing something like:



Code: [Select]
_artyHeightASL = (getPosASL _arty) select 2;

_angle = (((getPosASL gameLogic) select 2) - (_artyHeightASL)) / 1000;
_elevation = atan _angle;

BUT, the problems I'm having are

1) even getting the direction the arty's muzzle is pointing... a 'direction' or 'getDir' command only returns the bearing that the entire arty piece is facing (i.e. where you placed it originally facing...) I tried to get the direction of the gunner, but that just returns the same bogus bearing no matter which way you're facing, 258.something degrees.

2) I'm not sure how to "attach" a gameLogic to the end of the muzzle, and then setPos is 1km away.


Now if we could in fact attach a gameLogic to the muzzle and move it 1000 meters away in a straight line, that would be even better. Imagine taking a gameLogic and putting a stick into it. Now put the other end of the stick into the muzzle of the artillery. If this stick were 1km long, we can get the angle of elevation by:



Code: [Select]
_artyHeightASL = (getPosASL _arty) select 2;

_angle = (((getPosASL gameLogic) select 2) - (_artyHeightASL)) / 1000;
_elevation = asin _angle;


Again, if anyone knows how to do something like this with a gamelogic.... I'm stumped.
I'm sure Mandoble will come in with an ingenious, much simpler, very doable solution. But I always do things the hard way! heheh. I'm not smart enough to do it otherwise.

Offline Landdon

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #2 on: 04 Aug 2007, 20:20:08 »
Any luck with this as of yet?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Help needed to make ArmA Artillery useable
« Reply #3 on: 05 Aug 2007, 03:58:34 »
Sorry, was on vacation  :D

Bearing and elevation are displayed, original hi speed shell is replaced by one able to destroy any building, initial muzzle velocity is divided by 10 so you a better trajectory for indirect fire at short distances (ArmA distances  :whistle: ). If you want more maximum range, lower the _brakefactor as explained in the bigshells script.

EDIT:
Changed bigshells to be able to set the length of the new shell so it does not collide with the gun.

EDIT:
Updated to 1.2, now shotdown that Kamov with your gun  ;)
« Last Edit: 06 Aug 2007, 00:53:09 by Mandoble »

Offline firecontrol

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #4 on: 05 Aug 2007, 07:41:12 »
See, what'd I tell you.
Class act, this Mandoble guy! Very nice.

weaponDirection... that command was there the whole time and I couldn't seem to see it through all the trees. (Disgusted with myself.   :confused:)

Beautiful solution.


Offline wolf man

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #5 on: 05 Aug 2007, 14:21:29 »

Outragous people,

Going to play with this now!

Thanks a million.  :)

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
Re: Help needed to make ArmA Artillery useable
« Reply #6 on: 05 Aug 2007, 18:22:41 »
Mando strikes again!
 :clap:
ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)

Offline Landdon

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #7 on: 05 Aug 2007, 22:43:15 »
We tried to get this to work in Multiplayer put it did work.  If your the host, it works just fine.  But is anyone else uses it, BOOM.  They die, we tired using a Game Logic Marker named "server" and it didn't help.  Any Ideas?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Help needed to make ArmA Artillery useable
« Reply #8 on: 05 Aug 2007, 23:41:50 »
Try the new version, the LGB is a large bomb, it may collide with the gun when it replaces the original small shell. Check bigshells.sqf comments to adjust the length of any desired replacement ammo. Changed also the event handler, now it calls the function instead of spawning it.

Offline Landdon

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #9 on: 06 Aug 2007, 04:29:09 »
Mandoble,

Works well, but we are having trouble with the Ammo Menu in Multiplayer.  Other than that it is fine.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Help needed to make ArmA Artillery useable
« Reply #10 on: 06 Aug 2007, 10:22:43 »
what problem with the ammo menu?

Offline Landdon

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #11 on: 06 Aug 2007, 11:46:41 »
In multiplayer, we could not change the ammo from the GBU to anything else.

Offline wolf man

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #12 on: 01 Sep 2007, 14:09:27 »
Just an short note to let you know how we are getting along with this, the elevation and direction info in the sight display is exactly what was needed.
The Ammo select option is excelent, though we seem to have a problem with whoever has the host computer, gets to select the Ammo for all the guns.
This is something that we will experiment on and report with more info.

The ability to load ANYTHING as ammo has resulted in a lot of fun for the lads, I managed to shoot down a KA50 with a tractor :) and you have not seen anything untill you watch a cannon duel between guns firing city buses and Camels at each other. :o

We have not yet managed to fire smoke shells though, when we shoot, the cannon is enveloped in smoke, we will have to play around with that.

The reduction in the shell speed is working, though we are still working out our indirect fire, complicated stuff this arty :scratch:

Hopefully with a bit of tweeking, it does what it says on the tin :good:

Thanks again Mandoble,  I will post a conclusion when we have had more time to work on it.

Offline Nixer6

  • Members
  • *
Re: Help needed to make ArmA Artillery useable
« Reply #13 on: 02 Sep 2007, 11:44:42 »
Quote
The ability to load ANYTHING as ammo has resulted in a lot of fun for the lads, I managed to shoot down a KA50 with a tractor  and you have not seen anything untill you watch a cannon duel between guns firing city buses and Camels at each other.



Please keep us posted.
Why do I have to be a Rocket Scientist to make a good mission?