Jump to content
integerdevourer

Changing Turret Location

Recommended Posts

I never got around to asking this, but this is for an old mission I was developing called BATTLE CARS. One of my biggest issues was the placement of the "turret" of vehicles that did not actually have a turret. There seems to be some values regarding this turret's placement, but I never figured out how to alter it, if it is even possible. It definitely would have made certain aspects of the mission function better. So, is it possible? 

Share this post


Link to post
Share on other sites

I've done some fiddling with this as well (when Karts were released).  I'm pretty sure the 'turret' location is determined by the vehicle itself (ie: nothing you can change without creating your own modded version of the vehicle).  However I don't really know for sure :)

Share this post


Link to post
Share on other sites

(ie: nothing you can change without creating your own modded version of the vehicle)

 

That was sort of my fear. I want to avoid having to mod the vehicles, because that would require an extra download (right?) because I was trying to make the mission as freely and easy to play as possible. 

  • Like 1

Share this post


Link to post
Share on other sites

It looks like it's a new version of the vehicle, not exactly what I was talking about, but thanks :D

It's not. It's just a few objects attached to the original vehicle. You can run a script that adds it to the regular chopper. It has its bugs like rockets not reappearing after replenishing ammo (since they're attached objects after all) but it works.

Share this post


Link to post
Share on other sites

It's not. It's just a few objects attached to the original vehicle. You can run a script that adds it to the regular chopper. It has its bugs like rockets not reappearing after replenishing ammo (since they're attached objects after all) but it works.

That's a visual attachment, it doesn't change the turret location of the vehicle. I am asking about a very different situation that requires a different method.

 

FROM MOD:

heli addWeaponTurret ["FIR_BF_FFAR",[-1]]; 
heli addMagazineTurret ["FIR_BF_FFAR_19rnd_M",[-1]];
 
This adds the weapon and ammo to an EXISTING turret on the vehicle.
 
 
This is what I am talking about, manipulating the source of the weapon fire from a vehicle that DOES NOT HAVE a turret. This issue that plagues me is that cars, for example, will shoot from their [0,0,0] point of their model (center of the vehicle) and depending on the vehicle may be very low or impractical to use. An example are titan missiles in this method when used on a car will explode on the ground even if locked onto a target or mortar/artillery shells shooting at such a low arc that it will impact too close and kill your vehicle. 
 
I have two objectives in mind, if it is possible:
 
Altering this turrets placement on the fly 
Doing so without requiring a mod

Share this post


Link to post
Share on other sites

 

That's a visual attachment, it doesn't change the turret location of the vehicle. I am asking about a very different situation that requires a different method.

 

FROM MOD:

heli addWeaponTurret ["FIR_BF_FFAR",[-1]]; 
heli addMagazineTurret ["FIR_BF_FFAR_19rnd_M",[-1]];
 
This adds the weapon and ammo to an EXISTING turret on the vehicle.
 
 
This is what I am talking about, manipulating the source of the weapon fire from a vehicle that DOES NOT HAVE a turret. This issue that plagues me is that cars, for example, will shoot from their [0,0,0] point of their model (center of the vehicle) and depending on the vehicle may be very low or impractical to use. An example are titan missiles in this method when used on a car will explode on the ground even if locked onto a target or mortar/artillery shells shooting at such a low arc that it will impact too close and kill your vehicle. 
 
I have two objectives in mind, if it is possible:
 
Altering this turrets placement on the fly 
Doing so without requiring a mod

 

Sorry to say this for the 3rd time, but the mod does work, including firing the attached rockets from their attachment points. I don't know how, if they're moved to the point as soo as they're fired (EH fired + using nearObjects to find the rocket a move it) or some other method, but it should work for cars, too. You could do it even for machineguns, although the performance would probably be horrible.

 

If it does not, do it like this:

  1. check for user input with displaySetEventHandler
  2. destroy an attached rocket and spawn a real one
  3. give it the desired velocity

Although this would prevent you from using guided missiles, machineguns and regular rockets should be fine.

Share this post


Link to post
Share on other sites

In short. Adding turrets into the vehicles via script is not possible. Attaching turret objects to the vehicle is.

FiredEH already returns all you need to grab the fired shot/bullet/missile and do whatever you want to do to it. Use the ballistic values it already has when fired or change them. Reposition the shot to start from where ever you want.

It is possible to add and attach a static turret, hide it and remote control it too if you want.

  • Like 1

Share this post


Link to post
Share on other sites

the mod does work

 

Sorry I got it now after there was an explanation, I didn't have time to delve into the mod and see the functions behind the scenes. I'm still learning here.

 

 

 

In short. Adding turrets into the vehicles via script is not possible. Attaching turret objects to the vehicle is.

FiredEH already returns all you need to grab the fired shot/bullet/missile and do whatever you want to do to it. Use the ballistic values it already has when fired or change them. Reposition the shot to start from where ever you want.

It is possible to add and attach a static turret, hide it and remote control it too if you want.

 
Thanks :D

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×