Home   Help Search Login Register  

Author Topic: Gun Elevation/Turret Rotation  (Read 833 times)

0 Members and 1 Guest are viewing this topic.

Nighthawk

  • Guest
Gun Elevation/Turret Rotation
« on: 24 Dec 2002, 06:34:48 »
Hey All,
    Just wonder if anyone out there would know how to alter the rotation of a turret or more importantly the elevation of the gun through scripting. I'm trying to do this with tanks and an M101A1 Artillery Addon. Or also would it be possible to target Out-of-sight objects. Say if you had someone spotting and marking on the map where the artillery should fire. I've been using regular Artillery Barrage scripts, but I don't like the explosion. Many thanks in advance,
      Nighthawk  ;D

sans-pareil

  • Guest
Re:Gun Elevation/Turret Rotation
« Reply #1 on: 24 Dec 2002, 13:37:33 »
I've come across this problem too. While I don't really mind the explosions, and have my own arty script with a nice random spread in a area defined in the trigger exec, I would like to be able to put some guns somewhere on the map that actually elevate and fire with smoke/bang effects at the end of the barrel. So if someone knows just how to get the barrel up. and the turret facing vaguely in the right direction, I would like to hear about it too.

Ofcourse the next step would indeed be to have the guns actually fire at a target oout of sight... but that would require alot of maths... which it would take me a long while to figure out :-).

Sans-pareil

tai mai shu

  • Guest
Re:Gun Elevation/Turret Rotation
« Reply #2 on: 31 Dec 2002, 22:23:15 »
erm, theres an arty script in the editors section that does exactly what your asking for.  You use the radio to dial in the coordinates of the target, and then the script calculates the range and azimuth to the target, and a battery of M60 tanks elevate their guns, and fire off heat rounds, which fly and actually hit the target, so it is a REAL arty script.  Its called direct artillery version 1.2 or sumthin like that

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Gun Elevation/Turret Rotation
« Reply #3 on: 31 Dec 2002, 23:48:26 »
Some people have had success createvehicling a small object (like a wristwatch) and using dotarget/dofire to instruct the unit to fire.  Just use some simple trig to get the elevation.

oh, and the next stage you don't want to emss with.  Shells timeout after 20 seconds. You're much better off putting a fired eventhandler on the turret, and using nearestobject to grab the shell and delete it.  Then spawn a new one on the inbound trajectory.
Dinger/Cfit

tai mai shu

  • Guest
Re:Gun Elevation/Turret Rotation
« Reply #4 on: 02 Jan 2003, 00:03:35 »
hmm, i thought shells had a longer timepout than 20 seconds.

the 50 cal machine gun times out after 20 seconds, but i think cannon shells fly for a longer duration.  nevertheless, your idea with deleting the shell, creating a new one, and giving it a setvelocity is a much better, more flexible, and more practicle way of doing it.  the problem with the old direct artillery script is that the script would only calculate for a very shallow firing angle (nothing over 20-30 degrees) so the minimum range for a fire mission was like 2000 meters, and the max range was 4000 and if there was anything like a hill in the way or forest, than the shells would blow up prematurely.  Also, you couldnt set the battery any higher than the target, cuz the script wouldnt calculate for that, also, the barrels of the tanks dont go over 45 degrees, so an indirect lobshot is pretty impossible (if you wanted to lob a shot over a very short range, at a target that cant be hit directly, say, over a hill)

with a setvelocity, you can VERY easily figure out the trajectory to the target, and make the round fire at a 0-90 degree path, with any ammo, from any position, as frequently as you want, with out having to worry about having the ai shoot anything.  Also, the calculations for setvcelocity are much more simple, theres no drag calculated into setvelocity, and you dont have to worry about simulating gravity, so your pretty much all set.  Someone please make a script for this lol