Game Development Community

Help with add onMove

by Gilberto DeSousa · in Torque Game Engine · 12/28/2007 (4:08 pm) · 8 replies

Hello everyone,
I have a newbish question. I would like to have a projectile move in an semi eratic pattern as it moves though the air. Similar to the flight pattern of missles in anime's. My thoughts on this would be to have an onMove event that would change the flight path. The problem being i havnt been able to figure out how to get the event or callback to run. All i realy need for help is how to add a call back to the projectile, I think i can handle the rest of the vector changes for the object. any help would be appreciated, or if perhaps there would be a better way to accomplish this, I am open to ideas lol. Now what i thought was i would be able to basicly do

function Projectile::onMove(%this)
{
echo("im moving");
}

since that is similar to the onCollision, but i am certain there is someplace else i have to mess with and i am not sure where or if im just completely missing the point on a way to do this.

thnx
ragansi

#1
12/28/2007 (4:49 pm)
For the most part it is a good idea to do this in the source. But I think it would work pretty well if you used schedule when you fired, to trigger that function at set intervals. If you don't understand I could mod the crossbow to do it in a couple minutes so just ask.
#2
12/28/2007 (5:14 pm)
If you could give an example on the crossbow for the projectile that would be great.
if the example just called an echo that would be great i considered that as a possible option but wasnt sure how to set it up.

thnx
ragansi.
#3
12/28/2007 (5:49 pm)
Okay I'm working on it I have to eat dinner but it should be done shortly.
#4
12/28/2007 (7:05 pm)
Thnx for the help
#5
12/28/2007 (8:47 pm)
Well it looks like you can't in fact do it in script, as you can't change the velocity vector. I'll do it from the source code though, which will have better results all around.
#6
12/28/2007 (8:52 pm)
I just want to clarify do you want the projectile to move around while it is in the air. I don't watch much anime so I was going to model it after princess Mononoke... around 1:09 in this clip.
http://www.youtube.com/watch?v=zaGo4-YecUA

is that about right or should I do it differently?
#7
12/28/2007 (9:43 pm)
Well here is a good reference on the style of missles motion im looking for. just watch for the launching missles
http://www.youtube.com/watch?v=jbUb1fmJN_0

Though you dont need to create the motion for me if you could just make the header and possibly a comment on some of the objects/classes i would have to access and the possible name of the variable that control the projectiles motion. or point me basicly in the rite direction.

im going to be heading for the night i realy appreciate all the help your giving

thnx
Ragansi
#8
12/28/2007 (9:56 pm)
It seems to me that those missiles are pretty much just homing missiles. You can use the resource here for that.

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6778

if you don't think that's quite right I could do something different. I'm just taking a break from my project, and I like to code stuff for projectiles so I'll be happy to help.