Home   Help Search Login Register  

Author Topic: Shoot from vehicle  (Read 2561 times)

0 Members and 3 Guests are viewing this topic.

Spectaculas

  • Guest
Shoot from vehicle
« on: 07 May 2004, 11:20:07 »
Can somebody do a script what allows you to shoot from vehicle?

For example: You are on a back seat of 5t truck open heading to small enemy base. Small group tries to attack you but you shoot every enemy with your M16 while you are sitting in the truck.

 
« Last Edit: 07 May 2004, 11:23:23 by Spectaculas »

Dubieman

  • Guest
Re:Shoot from vehicle
« Reply #1 on: 07 May 2004, 20:16:57 »
Can't be done I think unless you make a new vehicle pack.
It might be scriptable but I have a feeling the answer is no. I've asked for this before and got limited response.
A new 5ton with a M16 weapon mounted on the tailgate or something might be good.

Grendel

  • Guest
Re:Shoot from vehicle
« Reply #2 on: 07 May 2004, 23:18:19 »
Oh come on now GuiltyRoachKilla, nothing is outright impossible with OFP scripting :D!

I played around with a script that allows you to "climb" up on a tank, and  shoot exposed crew, and I found that if the tank started to move, I could ride along with it, shoot, whatever!

If you use a getpos/setpos command to place the player in back of the flatbed, it shoud work.  Make sure you setpos the player in the right spot and high enough though...If you want help with the script let me know.

-Grendel

Dubieman

  • Guest
Re:Shoot from vehicle
« Reply #3 on: 07 May 2004, 23:37:13 »
Lag ahem lag ahem. This has been brought up before. A script like that would make nearly impossible to aim with your player moving every   ~0.01. A stationary truck I can see that but not a moving one. I was shot down with a box truck like this in add on ideas. The truck was like a bank one with opening rear doors and dudes could fasten seatbelts or stand or sit in back and fire rearward. It would be jarring the player constantly and you not assured a good spot in the truck when turning. look at the BAS MH47, try walking in that while going, you'll become a pancake. :)

A simple car or truck with a mounted or new animation for gunner add on using M16 or approapiate weapon would solve the problem. ;)

Loup-Garou

  • Guest
Re:Shoot from vehicle
« Reply #4 on: 08 May 2004, 16:49:10 »
Can somebody do a script what allows you to shoot from vehicle?

For example: You are on a back seat of 5t truck open heading to small enemy base. Small group tries to attack you but you shoot every enemy with your M16 while you are sitting in the truck.

 

Thanks for this question, Spectaculas  ;). I think, like you, that firing from a vehicle would be great (it's very annoying to be defenceless when you're in a car or a truck). However, I'm not good enough in scripting to help you  :(. Perhaps the solution is like this :

1) Check if the player is "in Cargo", in a car or a truck.
2) Detect when the player fires (left click).
3) "create" a "firing bullet" (coordinates on the side / behind / in front of the vehicle, direction the player watched when he has fired and so on...).
4) Remove the ammo each time the player fires.

Sorry I can't help more than this  :-\ . But I hope an answer !  :D

Grendel

  • Guest
Re:Shoot from vehicle
« Reply #5 on: 08 May 2004, 18:20:22 »
Quote
A script like that would make nearly impossible to aim with your player moving every  ~0.01.

I guess you've never tried firing an automatic weapon from a moving vehicle ;).  Even trying to fire accurately from a MOD-7 flexible weapon mount from a HMMWV is downright imposible when you're moving over anything but the smoothest road.  Normally its just pray and spray to keep their heads down.  

As far as lag goes, I only used one setpos command to get the player on the tank, and I just rode along with it.  I'll play with it as soon as my cpu is back up.  

-Grendel

Dubieman

  • Guest
Re:Shoot from vehicle
« Reply #6 on: 09 May 2004, 03:41:59 »
My old post in add on ideas for a civvie car with an UZI.... ::)

Anyways sitting on a tank is somewhat different. A slower ride with 360 degree view + whatever you miss gets the turret  :o

A truck moves faster, bounces(yes glitches and stupid engine coughs), doesn't have a clear firing area...
I've tried setposing ppl in trucks but it never works. They are under or over, never inbetween. ;)

Loup-Garou

  • Guest
Re:Shoot from vehicle
« Reply #7 on: 09 May 2004, 10:25:00 »
I also remembered that the manual "says" that BMPs have small "holes", that allow passengers to use their owns weapons. It might be possible to make a script in order to use these "holes" (by pressing "V" or by the action menu)...  :-\.
« Last Edit: 09 May 2004, 10:25:32 by Loup-Garou »

DBR_ONIX

  • Guest
Re:Shoot from vehicle
« Reply #8 on: 09 May 2004, 17:29:43 »
Hmmmm
The Humvees/turrets work okay
So what about making the turret the M16 etc at the back?

Could be cool, apart from that it won't remove the players ammo :|
- Ben

Loup-Garou

  • Guest
Re:Shoot from vehicle
« Reply #9 on: 09 May 2004, 18:41:49 »

Dubieman

  • Guest
Re:Shoot from vehicle
« Reply #10 on: 10 May 2004, 02:13:53 »
Yeah a simple M16 or AK74 on the appropiate truck...
I'd go for that. Not losing any ammo can be explained, the truck had an extra rifle. ::)

A car with a side mounted anything is what I've been looking for all along... >:(

Loup-Garou

  • Guest
Re:Shoot from vehicle
« Reply #11 on: 06 Jun 2004, 09:24:17 »

1) Check if the player is "in Cargo", in a car or a truck.
2) Detect when the player fires (left click).
3) "create" a "firing bullet" (coordinates on the side / behind / in front of the vehicle, direction the player watched when he has fired and so on...).
4) Remove the ammo each time the player fires.


According to xela89 (from ofrp forums), 1) and 3) are easy, 2) and 4) seems impossible. But I think that we can use the addaction command instead of detecting a left click (in others words, have the action "Shoot from vehicle" when the player is in cargo). A few people also suggested to "move" the player when he fires (floating next to the vehicle... :-\). In my opinion 4) is not very important because a player firing from a vehicle is an easy target... :P.
Quote
« Last Edit: 06 Jun 2004, 14:43:35 by Loup-Garou »

Offline Blanco

  • Former Staff
  • ****
Re:Shoot from vehicle
« Reply #12 on: 06 Jun 2004, 16:00:07 »
the ICP anims form the VDV2.0.pack Are maybe a step forward.
Thes anims are great imo and very usefull too because you can still fire and turn while you're in the animation
Maybe it's possible with cargoanims too,
but the turning in the vehicle could look very weird,  because only the upperbody should move.

« Last Edit: 06 Jun 2004, 16:00:46 by Blanco »
Search or search or search before you ask.

Loup-Garou

  • Guest
Re:Shoot from vehicle
« Reply #13 on: 24 Jun 2004, 19:04:12 »
I've found this script ; it puts a MG on the roof of a vehicle (a HMMWV in my example). Works perfect !

In init.sqs file, put :

[Nameofthevehicle,Nameofthemachinegun,height] exec "MGCarry.sqs"

exit

(You can do this differently, of course)

For a HMMWV, for example, put a height of 0.785 (warning : a "." for a ",").

Here's the script :

_carrier = _this select 0
_cargo = _this select 1
_height = _this select 2

endCargoSession = false

goto debug

#carrier

_x = (getPos _carrier) select 0
_y = (getPos _carrier) select 1
_z = ((getPos _carrier) select 2)+_height

_cargo setPos [_x, _y, _z + 0.9 ]
_cargo setDir (getDir _carrier)

~.01

? (!endCargoSession) : goto "carrier"

@ endcargosession
_cargo setpos [_x,(_y)-1.5,0]

exit

Offline angora

  • Members
  • *
Re:Shoot from vehicle
« Reply #14 on: 20 Jul 2004, 16:50:17 »
why not have you being able to shoot from a heli, :o like the BAS blackhawks the blokes with dangeling legs could pop off shots whilst the rest of you fast rope out, that would be cool 8)
Build a man a fire and he will be warm for the night, set a man on fire and he will be warm for the rest of his life