Home   Help Search Login Register  

Author Topic: timegrenade??  (Read 1143 times)

0 Members and 2 Guests are viewing this topic.

warhammer

  • Guest
timegrenade??
« on: 16 Jun 2003, 18:55:29 »
I have made a handgrenade... but i want to make it explode after 3 seconds..
Is that possible? Set a timebomb fuse on it?  ??? ???
« Last Edit: 16 Jun 2003, 18:55:39 by warhammer »

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:timegrenade??
« Reply #1 on: 17 Jun 2003, 00:03:34 »
 ???

 :D we already have a "timebomb"?!  ...and them pipes ...

anyho' - I guess a camcreated "bomb" could pop up where the egg hits?!
...some "fired" script or alike, dunno really?!  ??? :)

you want the 'nade to bumb & roll, hm? ...and then explode?!

warhammer

  • Guest
Re:timegrenade??
« Reply #2 on: 17 Jun 2003, 02:58:59 »
I want the grenade explode after about 3 sec...
it shall act ass a normal grenade but after 3 seconds it blows up...

~3
setdammage 1
???
how do i do that in an addon config file??

shawm3

  • Guest
Re:timegrenade??
« Reply #3 on: 28 Jul 2003, 07:45:40 »
IT could be done in a script
some how in a eventhandler have IT on impact set delay for 3 seconds  ;D
« Last Edit: 28 Jul 2003, 07:52:03 by shawm3 »

MJHergenroder

  • Guest
Re:timegrenade??
« Reply #4 on: 07 Aug 2003, 18:38:59 »
I want to do this on my custom config.  The idea is simple in theory....
1.  Decide whether to modify your master config.cpp via the decrypted config file from OFP Advanced Editing Forum? to effect all grenades in game, or as addon config to effect only your custom missions thru scripting each time.  (If you want to do the first, take a look at the ECP project under the OFPEC Editing page.)

2.  If the first method, change the default hand grenade (same class for both east and west, but m203/gp30 are different classes) to an inert dammage model.  This is what you actually will throw.

3.  After changing default hand greande to inert (no dammage/no expl) inside the handgrenade class under CfgAmmo, add a fired event handler to the Throw class under CfgWeapons.  The handgrenade class under CfgWeapons is considered as a magazine used by the Throw weapon. (if this sounds weird, try to get a hold of inquisitor's weapon pack to see how he did it in his config).

class EventHandlers
{
     Fired = "_this exec {"\aPBOtoPutAscriptIn\fuze.sqs"}";
};

4.  Add a custom explosive grenade class that will be used to replace the inert nade after the fuze expires thru scripting.  Since the throw 'weapon' can also throw smoke shells, you need to check inside the script what type of weapon 'i.e. magazine' is being thrown.

5.  Script your fuze.sqs, to simulate some kind of fuze (time based, height based (waiting for it to peak first), or distance based.  After the fuze expires, get the position and velocity vector of _this, delete the round via setdammage=1 (it's inert) or someother method, and then spawn an explosive round/grenade/missile/etc. at the stored position and then set the velocity vector to the stored value.

6.  One thing to note:  it's been kind of a while since I was messing around with this idea for use in an artillery piece but some people posted a 10 second rule (~11.?s) for the shotshell simulation (artillery/tank rounds), after that, you need to respawn the round in an ~11s loop.  The throw sim used by the grenade class, might be different or might not even work with the get/set velocity commands, but I think it should as you can set the velocity of static tables (as in chairs...) but it requries some one to shoot it or touch it first.  Setvelocity of rounds/grenades in motion (due to gravity @ respawn) should have no prob I think.

7.  For more info, search some of the older posts on the official forums under setvelocity.

P.S.  It might be possible to add an action menu option, like "Pull Pin" if you have any grenades in your inventory, and that will start the timer; but I don't know if their is a command to check what magazine (ammo) the player has selected (like SMK vs frag)
« Last Edit: 07 Aug 2003, 18:54:19 by MJHergenroder »