Author Topic: Changing explosion shape based on projectile velocity  (Read 1205 times)

I'm trying to script a grenade-firing weapon and the grenade detonates in midair upon right clicking. Firstly, is the topic title even possible? If so, how on Earth would one go about doing it?

detonating the grenate when you right click is possible.  Off the top of my head im not sure exactly how.

but "changing explosion shape based on projectile velocity" - what do you mean here?  how do you want the explosion shape to change?

For instance, if a grenade in real life shot from a weapon is traveling at over 100 fps, it won't explode in a spherical explosion, the explosion will rather blow outwards in the direction of travel. The faster the grenade is traveling upon detonation, the farther the explosion will blow forward.

What is the purpose of this? It seems to me that it's more work than it's worth.

What is the purpose of this? It seems to me that it's more work than it's worth.
if a grenade in real life

realism

What is the purpose of this? It seems to me that it's more work than it's worth.

Yeah, what otto said. I'm just trying to make it as realistic as possible.
« Last Edit: July 10, 2010, 09:17:32 AM by Raeyok »

dont call me otto-san

i hate this name

call me either otto

or ottosparks

dont call me otto-san

i hate this name

call me either otto

or ottosparks
Ask Badspot for a name change. He's been known to do it.

Anyway, blockland isn't nessessarily a realism game, but this is possible. It would be a great deal of work, though, to change the shape properly.

I don't know if it'd work, but get the xyz velocity for the grenade, and variables for all of them.

then make the explosion scale those variables?

I don't know if it'd work, but get the xyz velocity for the grenade, and variables for all of them.

then make the explosion scale those variables?
Explosion scale is in the datablock, so that's no good.

Ask Badspot for a name change. He's been known to do it.

Anyway, blockland isn't nessessarily a realism game, but this is possible. It would be a great deal of work, though, to change the shape properly.

Okay, so that answers my first question about the possibility of it. Now, see, the thing is, I have absolutely no idea how to do this. I would very much appreciate it if someone could either somehow walk me through it or create a small (?) portion of a script that does this. I realize I'm asking a lot here, but I would appreciate it so much if someone could help me with this.

Now, see, the thing is, I have absolutely no idea how to do this.
Just don't bother.

Really, it's not worth it.

I don't know if you can change the scale of an explosion, but I think you can change the scale of the projectile cause if a projectile is 2 times bigger on every axis the explosion is bigger on every axis. But I don't know if it will work with one axis in particular or at different amounts. Maybe you could get the velocity and change the scale right before it blows up, when you click.