Home   Help Search Login Register  

Author Topic: Grenade in tank  (Read 2906 times)

0 Members and 2 Guests are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Grenade in tank
« on: 21 Mar 2005, 22:20:40 »
Has anyone tried making a script that allows the player to drop a grenade in the top of a tank? Kina like this:

Tank is parked on a street shooting everyone.
You get right up behind it, and a new action comes up 'Drop grenade in tank'.
The action only comes up if the player has at least 1 grenade.
When selected, the player is setpos'ed on top of the tank.
The player loses one of his grenades.
After acouple of seconds, there is a explosion sound, and the crew of the tank die.

Maybe at the end after 10 seconds or so the tanks ammo could explode, and the tank is destroyed.

It could be random. 4/5 times the tank will blow up, 1/5 times it will just kill the crew and leave the tank nearly undamaged.

I'm pretty sure it could be done. I know people have made sticky-bombs that kill only the crew, and can only be placed when right next to the tank.
« Last Edit: 22 Mar 2005, 08:54:33 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline XCess

  • Former Staff
  • ****
Re:Grenade in tank
« Reply #1 on: 21 Mar 2005, 23:32:48 »
Sounds like a cool idea for a script. I'd write it up myself here but it's easy to do and I think it'd be a great learning excercise if ya dont know how to script.

Grunt249

  • Guest
Re:Grenade in tank
« Reply #2 on: 24 Mar 2005, 12:51:23 »
I'll give this script a try if nobody else wants to. But the chance of the tank being destroyed is almost impossible. If you plan to use a standard frag grenade, it would kill the turret crew and possibley injure the driver (depending on vehicle design). It would also damage internal turret equipment such as hoses, wiring, control panels, electronics, and any other sensitive components in the turret that are exposed. But in most modern MBT's the shells are stored in a protective bustle, so they would not detonate. Remember that this is based on the player using a frag grenade, inciendary grenades might have a more likely chance of ammo detonation. But for more realism, I would use the frag grenade method, since those are the grenades used in the game without need of an addon.

I can write this script for use on MBT's, but using it on a vehicle like an APC or IFV might not be realistic. I will write a simple script that will kill the turret crew but not driver, and will add those animations. If someone else wants to write a larger version that will check vehicle class, that would work for realism in APC's. If a frag was dropped down the turret of say a BMP, the blast would have chance of wounding everyone within the vehicle, including passengers in rear. If the script was able to detect the vehicle class, tank compared to apc, then it can choose from one of two scripts. Tank class would just kill gunner and commander, APC class would kill gunner and commander, and have random chance of killing or injuring driver and passengers. APC script(s) would take a little more work, but would make the stuff more interesting.

Does this sound like what you are wanting? If so, I'll give the tank version of this script a try. Might take a day or so, I'll try to get it to look good.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Grenade in tank
« Reply #3 on: 24 Mar 2005, 13:30:56 »
That sounds great.  ;D

I suppose destroying the tank would be kinda unrealistic on modern MBTs.
I have to admit that when I thought of the idea, I was basing it on WW2 tanks like the M-10 Wolverine, which was basically an armoured box with a turret on top. All the ammo and crew where in the same compartment.  ;)

What you've got sounds really good  :D
I'm looking falward to seeing it  ;)
« Last Edit: 24 Mar 2005, 13:31:16 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Nemesis6

  • Members
  • *
Re:Grenade in tank
« Reply #4 on: 24 Mar 2005, 15:02:48 »
Well, if I were a tank commander, I'd lock the hatch(es).
I am actually flying into a star... this is incredible!

Offline Morglor9

  • Members
  • *
Re:Grenade in tank
« Reply #5 on: 24 Mar 2005, 17:19:19 »
I'm guessing you decided to start this topic after watching something along the lines of say... Saving Private Ryan? anyway, it is a sweet idea for a script.
Cymbaline

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Grenade in tank
« Reply #6 on: 24 Mar 2005, 17:43:11 »
Yeah, I posted it after playing 'Brothers in Arms', and how you can climb on top of a tank and put a grenade in one of the hatches.  ;D

I thought it would be good to put into flashpoint. I tried to do it myself, failed lots, then realised I have no scripting skill what-so-ever.  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Morglor9

  • Members
  • *
Re:Grenade in tank
« Reply #7 on: 31 Mar 2005, 22:31:52 »
is anyone actually attempting this?
Cymbaline

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Grenade in tank
« Reply #8 on: 31 Mar 2005, 23:04:17 »
I thought Grunt249 was trying it, but this seems to have gone dead.

I might have another go at it myself, but it wouldn't be too good.  :-\
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

bluehand

  • Guest
Re:Grenade in tank
« Reply #9 on: 01 Apr 2005, 00:56:00 »
I'm just a nooB at scripting too, but a couple of thoughts struck me.  In an APC, the passengers are in cargo, so you can probably get an array of them from some function.  That's in addition to the driver/gunner/commander that work the same for both tanks and APCs.  So that bit should be easy.

More tricky might be figuring out whether the player is in range of a vehicle in the first place.  Have a look at the thread on melee combat, which talks about the same problem (near enough to punch).  You probably need a trigger that moves with the player (setPos it every second) and you could check the list of units in its radius for whether any of them is an enemy vehicle?

Don't know if that's any help - actually doing this script is still beyond me  :(

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Grenade in tank
« Reply #10 on: 01 Apr 2005, 10:07:49 »
I know how to get the 'how close to a vehicle' script working. There was a feature in one of the WW2 missions that had a 'stick sticky bomb' action come up when you got close to a enemy tank/halftrack. I'll find that, de-PBO it, nick the script, and start adding things to it  ;D
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

bluehand

  • Guest
Re:Grenade in tank
« Reply #11 on: 01 Apr 2005, 20:11:23 »
ok, when I said I couldn't make this script, maybe I was mistaken  ;)

This version with demo mission needs a couple more things: an animation for the player, and a way of taking away just 1 grenade afterward.

Offline XCess

  • Former Staff
  • ****
Re:Grenade in tank
« Reply #12 on: 02 Apr 2005, 00:38:03 »
player removeMagazine "handgreande"
« Last Edit: 02 Apr 2005, 00:38:15 by XCess »

bluehand

  • Guest
Re:Grenade in tank
« Reply #13 on: 02 Apr 2005, 15:00:54 »
That's exactly what I thought it should be.  You'll see the line commented out in the code.  What I found was that a standard grunt with 6 grenades walks up to the tank, drops one inside and blows it up, check gear (only 5 left).  Good start.  Then I try to switch weapon to grenades to throw one.  Can't.  What's going on there?  ???

DBR_ONIX

  • Guest
Re:Grenade in tank
« Reply #14 on: 02 Apr 2005, 15:27:18 »
Try removeweapon instead of removemagazine?
- Ben