Author Topic:  Grenade throwing,  (Read 1043 times)

0 Members and 1 Guest are viewing this topic.

MAXdragon300

  • Member
  • ***
  • Posts: 215
  • Nothin, to see here..... nope...
  • Awards 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: MAX dragon 300
Grenade throwing,
« on: June 27, 2017, 09:02:23 PM »
This is a question about a script, I didn't know if it would go under the question or script topic...
How would I make a script that throws an object like how an arrow would and explode like a tnt as if it were a hand grenade? I know there is the grenade launcher, but I wanna try something new....
https://m.

Click here to go to my YouTube channel...

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4252
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Grenade throwing,
« Reply #1 on: June 28, 2017, 12:15:35 PM »
This would require raycasting with a parabolic trajectory. In other words, A difficult script that even I have not attempted yet.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

crazytater94

  • Supreme Member
  • *****
  • Posts: 2586
  • Mastering TM since 2011
  • Awards Awarded to exemplary forum members Members who have unlocked the robotic avatar 3 years on site+600 posts 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 Former MotM winners Week 1 members w/25+ posts (4/13/13-4/20/13) 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: crazytater94
  • PSN: crazytater94 (Inactive)
  • Steam: crazytater94
Re: Grenade throwing,
« Reply #2 on: June 28, 2017, 12:52:31 PM »
Well, for us lamens who aren't script geniuses, let's just make it simple.

Use a swing event that spawns a particle slightly above your shoulder to simulate a wind up. Make the particle have a velocity of something like forward 2-4 blocks for every 1 block down. (VRel: 3,-1,0). That will give a srltraight shot out and down, but not the are that dryym wants.

After that, add a wait to simulate the time in the air, maybe spawn a particle on the ground 6 blocks away (from my x3_ y-1 example, but use is block to check that it won't float in the air.) Also, give it the "fuse" time.
 (most grenades in games take 4 seconds to explode as well, not sure if its accurate because I've never used one IRL).

Next, script an explosion at said location of x3_y-1 and there's a grenade that's not pretty, but can get a basic version done.

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4252
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Grenade throwing,
« Reply #3 on: June 28, 2017, 02:12:41 PM »
Well, for us lamens who aren't script geniuses, let's just make it simple.

Use a swing event that spawns a particle slightly above your shoulder to simulate a wind up. Make the particle have a velocity of something like forward 2-4 blocks for every 1 block down. (VRel: 3,-1,0). That will give a srltraight shot out and down, but not the are that dryym wants.

After that, add a wait to simulate the time in the air, maybe spawn a particle on the ground 6 blocks away (from my x3_ y-1 example, but use is block to check that it won't float in the air.) Also, give it the "fuse" time.
 (most grenades in games take 4 seconds to explode as well, not sure if its accurate because I've never used one IRL).

Next, script an explosion at said location of x3_y-1 and there's a grenade that's not pretty, but can get a basic version done.

Ew. How are you meant to prevent grenades from going through walls, Or make it matter what angle you throw it at?

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym

Platinum Dryym

  • Supreme Member
  • *****
  • Posts: 4252
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts 3 years on site+600 posts Site art contributions/TPs in-game/Contest winners 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: dryym
Re: Grenade throwing,
« Reply #4 on: June 28, 2017, 07:05:47 PM »
Well, I created raycasting along a parabolic arc. Lemme turn it into a grenade and I will share the script.

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym