Game Development Community

Railguns, Sharp-Shooting Arrows... stragith projectiles?

by Dave Calabrese · in Technical Issues · 03/10/2005 (8:13 pm) · 6 replies

I have a feeling this is one of those very-easy things that I'm just barely missing...

I need to have a projectile that fires STRAIGHT. It has no drag, dosen't change velocity, just goes form Point A to Point B on a perfectly straight line. I tried the obvious at first of using a pathed object, but apparently those do not support collisions and I couldn't get it to work. My projectile works perfect - does everything I need - except stay on the proper course!

Anyone know the secret to making a projectile just go straight?

Thanks,
-Dave

#1
03/10/2005 (9:12 pm)
Bearing in mind that I'm a relative newbie, the way I understand it, the projectile class defaults to being non-ballistic (ie, no drag, no gravity, etc). You may have, at some point, set the default property to ballistic (projectile.cc, line 70: isBalllistic). I reckon you could subclass (I'm not sure if I'm using the correct terminology here) projectile for your straight-line projectiles, and set isBallistic=False.
#2
03/10/2005 (9:33 pm)
Actually, I've already got them set to isBallistic = false, so that wasn't it. =/
#3
03/10/2005 (9:55 pm)
In the script file for crossbow
/server/scripts/crossbow.cs

there is a variable for gravity etc in the datablock (not to be confused with the particle datablocks)

i dont have the code with me but it is self explanitory, i would just turn off the gravity.

for a fun trick you can increase the speed and the bounce count and jump in a closed room with your friends :)
#4
03/11/2005 (5:10 am)
Search for "ContainerRayCast".
#5
03/11/2005 (5:38 pm)
Check the datablock for your projectile, and set isballistic=false. This is done in script, not in code. The version of isballistic found in code is ordinarily just used to set the default. Doing this will turn off gravity. I don't know about drag though.
#6
03/11/2005 (6:04 pm)
Hrm... well, don't I feel stupid... the projectile already is traveling in a straight line!

Problem was, I'm getting the origin of the muzzlepoint from a mountpoint. The mountpoint was too high, causing it to go at an angle instead of straight.

And this also makes something... very interesting. I somehow enabled mounted objects to have collision... huh... I wonder how! hehe

Thanks for everyons assistance! Hopefully this will be help for someone else as well. =D