Home   Help Search Login Register  

Author Topic: Grenades....like hot potatoes......  (Read 2322 times)

0 Members and 1 Guest are viewing this topic.

Gravedigga

  • Guest
Grenades....like hot potatoes......
« on: 14 Jan 2003, 19:15:04 »
Well I was making this mission, and then I suddenly had this excellent idea.....I passed out for a few seconds at the sheer scale of brilliance that my brain had never processed before......

What about a grenade throwing script?

That sounds like an anticlimax. bear with me!

In this mission I'm making its sort of a campaign type thing, and the central character is sort of a super-hero type person.....Basically, what about if somebody throws a grenade at her, and she picks it up off the ground and throws it back? u know, like in every single movie made....

I know its complicated! I know that it's probably impossible! But it would just look really cool if in a cut-scene a russian could throw a grenade and then gets it thrown back at him!

Com'on...it's a challenge!  ;)

Fishion

  • Guest
Re:Grenades....like hot potatoes......
« Reply #1 on: 14 Jan 2003, 22:13:38 »
1) Good idea

2) Sorry to put a dent in your suggestion, but grenades
explode on impact. I'm not really on the height of possible things in OFP, but as far as I know everything
that explodes does this the very second it hit something else...

-Fishion

Soapyfrog

  • Guest
Re:Grenades....like hot potatoes......
« Reply #2 on: 14 Jan 2003, 22:51:04 »
That sure isn't true... most hand grenades explode after a preset time.  There are numerous accounts from WW2, Korea and Vietnam of grenades being thrown back by their intended targets (and sometimes even picked up and thrown AGAIN!) and also of grenades going off in the hands overly patient throwers...

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #3 on: 14 Jan 2003, 22:52:30 »
i think its posible using drop and velocity commands ;D

use drop 2 create somthin dat look like grenade (@drop commands experts : is it possible) and set da valocity (or nyway else) 2 make it travel from place 2 place den make da oder unit "pick" it up and trow it back ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gravedigga

  • Guest
Re:Grenades....like hot potatoes......
« Reply #4 on: 15 Jan 2003, 00:59:27 »
sooooo......are there any scripts for this? I'm sort of..er..completely new to scripts and although I can think up some really cool ideas (in my opinion....) I've usually got no idea what ppl are talking about. and then u say 'commands experts' and I just get worried and lash out....

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #5 on: 15 Jan 2003, 01:07:07 »
dere surly a way 2 do dis ;)

just gotta find som1 2 do it :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gravedigga

  • Guest
Re:Grenades....like hot potatoes......
« Reply #6 on: 15 Jan 2003, 01:13:59 »
heh....we'll have to overdose on the 'i'm a n00b + innocent' theme....

 ;)

Any1 out there know how to do pickup + throwing commands? Im lonely, single and like dogs and walking in the country. Please reply soon or I may have to go abroad......

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #7 on: 15 Jan 2003, 01:26:56 »
im not noob :P

 ;D

nd i think i can do dis if i realy need ;) :P so wait til som1 does it or til i get som need 4 it  ;D

4 pickup and throwing u only need 2 play daanims ;) find som command referance dat have animations :P ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gravedigga

  • Guest
Re:Grenades....like hot potatoes......
« Reply #8 on: 15 Jan 2003, 14:36:05 »
aww yeesh. Do u like cookies? I have lots of cookies.......  :)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #9 on: 15 Jan 2003, 15:35:29 »
LOL  ;D

wat kind of coockies ?  ;) ;D

dont wry it wont take long til i try doing dis  ;) ;D

ill just give u a call wen i do ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Gravedigga

  • Guest
Re:Grenades....like hot potatoes......
« Reply #10 on: 15 Jan 2003, 17:48:57 »
thx! soon I'll be lobbing small pineapple like objects all over the place

cpt.Hawkeyez

  • Guest
Re:Grenades....like hot potatoes......
« Reply #11 on: 24 Jan 2003, 00:36:04 »
what if you made the grenade land like 0.0000001 above the ground it would look like its on the ground no? then well nevermind to advanced for me form there on. probably just made everyone stupider so I'll probably just go now. :-*

Zell

  • Guest
Re:Grenades....like hot potatoes......
« Reply #12 on: 20 Apr 2003, 13:31:57 »
if u wanted a cut seen have it like the russian throws the gren but the west guy is also equipped wit a grenade then it goes on to the west guy nealing down and it looks like he picks up da gren then he throws his own gren back at the east guy and have a script so only the west guys gren goes off u get me here?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #13 on: 21 Apr 2003, 00:40:02 »
lol - can b ;D

try doin it ::)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Mav

  • Guest
Re:Grenades....like hot potatoes......
« Reply #14 on: 23 Apr 2003, 22:39:15 »
just a point, there aren't actually any impact grenades :)

they all go off after a 4-5 second delay with teh exception of the M15 White Phosphorus grenade :)

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Grenades....like hot potatoes......
« Reply #15 on: 26 Apr 2003, 07:47:05 »
That sure isn't true... most hand grenades explode after a preset time.  There are numerous accounts from WW2, Korea and Vietnam of grenades being thrown back by their intended targets (and sometimes even picked up and thrown AGAIN!) and also of grenades going off in the hands overly patient throwers...

just a point, there aren't actually any impact grenades :)

they all go off after a 4-5 second delay with teh exception of the M15 White Phosphorus grenade :)

Yes, its true that they don't explode on impact in real life, but what is being discussed is how grenades behave in the OFP universe. Remember: this is the same universe where tanks drive up sheer cliffs and airplanes stop dead in place when they hit a tree  ;)

Now, as for the script: while LCD's idea will work for cutscenes, I think there is a way to get this to work in game, with "real" grenades as well. What if you used the nearestObject command or an event handler to keep track of a grenade that is thrown. Now, when that grenades Z-pos (this getpos select 2) is, say, .5 meters, you simply execute another script where the player does some nifty animation, then the grenade is setvelocity'ed back at the thrower. You could do things like add an action for the player when the grenade is within ten meters or so, (that way it wouldn't be an automatic defense, and would take some quick thinking to execute).

Sorry for throwing those commands out, Gravedigga. I meant them more for LCD or anyone else reading this thread with more scripting experience  :-*
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #16 on: 26 Apr 2003, 08:06:45 »
@ GB

u can do it - i know dere was script dat made fast loop nd waited 4 missle 2 b shot from da player (usin da nearestonject) but i donno da class of da grande  :-\

mebe u can get up w/ somin ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Grenades....like hot potatoes......
« Reply #17 on: 26 Apr 2003, 09:25:45 »
Okay, done. Try this script out:

The first one should be run at the start of the mission. Nothing is passed to it, so just type [] exec "hot potato.sqs". Of course, you can name this whatever you want.

Code: [Select]
;//hot potato.sqs

actionCounter = 0
catching_grenade = FALSE
_catch_range = 15
? cadetmode : _catch_range = 25

#Top
thrown_grenade = FALSE
@ player distance nearestObject[player, "GrenadeHand"] <= _catch_range
_grenade = nearestObject[player, "GrenadeHand"]
? !catching_grenade : player addaction ["Catch Grenade","grenadecatch.sqs"]
@ player distance _grenade >= _catch_range OR thrown_grenade
player removeaction actionCounter
actionCounter = actionCounter + 1
goto "Top"

Basically, this waits until a grenade is close to the player (the exact distance can be changed; it is called "_catch_range" and is at the top of the script), then adds an action to the player. It won't add another action until the old one is removed. This action calls the next script:

Code: [Select]
;//grenadecatch.sqs

? catching_grenade : exit
catching_grenade = TRUE
_grenade = nearestObject[player, "GrenadeHand"]
@getpos _grenade select 2 <= 1
player switchmove "CombatThrowGrenadeEnd"

_grenade setpos getpos dump
;//NOTE BELOW!

thrown_grenade = TRUE
catching_grenade = FALSE

This script will wait until the grenade almost hits the deck, then makes the player do a little throw move. Now, I don't have resistance, so I can't use the setvelocity command. What I did was place a logic named "dump" on the map, and made the action move the grenade to the dump (see the noted line in the code). This would obviously be better suited for the setvelocity command here. However, like I said, I don't have OFPR (for whatever reason...), so I can't test the setvelocity command (LCD, maybe you would be interested). But I would make it send the grenade in whatever direction the player is facing, and slightly up.

Maybe: _grenade setVelocity [(getpos player select 0) + (10 * sin getdir player), (getpos player select 0) + (10 * cos getdir player, 5]. You could tweak the xy (10) and z (5) values to make it look realistic.

I haven't tested the script with multiple grenades being thrown at me at once, but it should still work in that case. Hope this helps!

--General Barron


HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Grenades....like hot potatoes......
« Reply #18 on: 27 Apr 2003, 09:24:07 »
Okay, I forgot to upload a sample mission. Here ya go.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Grenades....like hot potatoes......
« Reply #19 on: 30 Apr 2003, 02:23:04 »
its kool thing :thumbsup: but dere r som comments i have out it ;D (nd me xepectin u 2 take care of em ::))

1) it seems 2 work even wen dey throw da grande on me form behind - byt in RL it less likly dat da man actualy noticed it ;) (dere is nice function dat determintaes da facin of unit nd if it face object - can b used ;D)

2) m stil waitin 2 c da dump thin movin

i just dont have enough time now but if i get som ill try 2 make da setvelocity thing ;D (but i think it dont work on not vehicle objects  :-\)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta