new physics in hand grenades

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
fps
Posts: 504
Joined: Mon Sep 26, 2005 9:54 pm
Location: in a magical land devoid of hope, happiness, and sanity.

new physics in hand grenades

Post by fps »

Ss it possible to make physics scripted projectiles using the new physics stuff Fredrico added?
I’ve noticed that the hand grenades I have now bounce unrealistically and tend to keep moving until they time out and explode.

All I think I would need is for the script to create the physics object of the grenade on a key press and that script would run a timer, when timer runs out the grenade will "explode" and create a damage area, a bunch of cool effects, and shrapnel projectiles and such.

Does any one know if this is possible?
Any ideas on how I would make the grenades fire when the player uses them?
Also I there any way to keep the grenades from damaging people who are hiding behind corners and such with the damage area?

Thanks,
Fps
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico »

Ok. The things are a bit complicated.
1) The RF+physics is currently unrealeased due to unresolved instability. I think that only QoD can take a look at the code and find a solution for these crash.
2) Apply the physics on an actor and then apply a force on it, it's quite simple. You can script a weapon in this way quite easily.
3)
All I think I would need is for the script to create the physics object of the grenade on a key press and that script would run a timer, when timer runs out the grenade will "explode" and create a damage area, a bunch of cool effects, and shrapnel projectiles and such.
This is a bit too ambitious.... :wink:
Could you set a timer to calculate the force applied on the grenade force, instead?
4) The projectile code for physics has been arranged by Nout in this way: If a Genesis3d Bounding box (the standard blue box) is shooted by a standard projectile (the ones defined in the weapon.ini), then a force is applied using Tokamak on that body (if a physics body is defined for that actor). If you disable Genesis collision on an object, for example, the trick doesn't work anymore. So if the bodies aren't directly fired they can't be moved by tokamak. The explosions are a big trouble for this reason. One possibility is to apply at the source level a tokamak body on the projectiles. But this presuppose a correct implementation of Tokamak so we are again at the point 1.
5) Another idea is (point 1 is presupposed again) to set a timer for the exploasion and then make the grenade actor shots in random directions some dozen of projectiles. This is similar to the bleeding effect that Pickles introduced. In this case, if there are physics bodies defined, they would be "blown away".

If you look at my Pin Factor prototype you will find something similar to a grenade.
Hope this helps.
Post Reply