Game Development Community

Where do I find the crossbow methods for moving the bolt(bullet)

by Marvin Hawkins · in Torque Game Engine · 11/24/2008 (8:59 pm) · 7 replies

Hello all,

I know this is another noobtastic post. but I've found the methods for shooting the crossbow. More specifically I've fond the CrossbowImage stuff. but what I'm interested in is finding out where the methods are called for handling the behavior of the crossbow bolt (or any other ammo for that matter) when it impacts something.


I'm basically trying to change how the crossbow moves and if possible set up a ricochet shot. if you point me in the direction I can try to figure out the rest.

thank you for any help you can provide.

Marvin

#1
11/24/2008 (9:20 pm)
A ricochet shot, is actually a fun one. You want to look for the resource that lets you use multiple ammo, there is a richochet arrow in there.

www.garagegames.com/mg/forums/result.thread.php?qt=4387 there is something there i think.
#2
11/24/2008 (9:54 pm)
Play with these fields in the projectile data:
bounceElasticity
bounceFriction
isBallistic
gravityMod

The actual physics methods are handled in the source, but adjusting the values of the datablock will do a lot once you know what each field does - take a look at the first result for the search term "projectileData" to learn about these properties. ProjectileData
#3
11/25/2008 (10:23 am)
That's awesome is ProjectileData editable in Torque Script?
#4
11/25/2008 (11:18 am)
Sure is, look at the crossbow.cs script and find ProjectileData(CrossbowProjectile). All datablocks are editable it's just a matter of knowing what the different fields do.
#5
11/25/2008 (12:23 pm)
Cool one more question? Where is the explosion Datablock?
#6
11/25/2008 (12:38 pm)
Same script file right above the projectile. It's called ExplosionData(CrossbowExplosion) for the normal explosion and ExplosionData(CrossbowWaterExplosion) for the explosion while in water. The explosions consist of various particle effects (fire, smoke, sparks), sub-explosions, DebrisData, and sound - all of which are contained within crossbow.cs.
#7
11/25/2008 (8:39 pm)
Ok, I hate to keep bugging people.

I tried to comment out the Crossbow::ONCOLLision stuff. My purpose was to stop the explosion. Where are the line:

%col.damage(%obj,%pos,%this.directDamage,"CrossbowBolt");

What does the "directdamage" do? does this "damage" collidable objects?

I want to accomplish two things. I want to make my bolt bounce. But the crossbow explodes before it can "bounce" how can I "turn off" the explosion when it collides?


Okay I figured it out!! Well I figured out the ricocheting/bouncing.