Game Development Community

Newbie Collision Questions

by Bruno Campolo · in Torque Game Engine · 09/19/2006 (10:22 am) · 4 replies

Hi I've only had the engine for about 2 weeks now and I've been reading as many forum posts as I can on all subjects, but in particular collisions. There are still some things stumping me though. Also something to note is that I'm trying to use Script only for the time being until I realize its full capabilities.

These are things that I have learned, but please correct me if I am wrong:

- ShapeBaseImage is mountable but does not trigger collisions
- StaticShape is mountable and some forum posts say that even when mounted it can trigger collisions although I can't figure out how to get the call back to work. I get no collisions on mounted StaticShapes.
- Some forum posts also say that Items and ShapeBase objects are mountable although I have tried this and get no visibly mounted objects and no collisions.

One thing I don't understand is that there is a Weapon::onCollision function in script, but "Weapon" is not explicitly declared anywhere in the Script or the Source code besides as the className of the Item.

Basically I am trying to make a script only simple melee system and when I say simple, I mean just acknowledging a collision of the weapon with another player over a network. I have read the available melee resources, but they are overkill for what I need and they also make heavy mods to the source code which I am not ready to do at this point.

So for my real questions:

1) Which classes are mountable and/or collidable (item, shapebase, staticshape, shapebaseimage)

2) is it possible to have an onCollision event triggered for any kind of Player mounted object/image. If so, is there an example anywhere because I have tried what seems like the right way.

3) is it possible to mount a projectile?

Thanks,
Bruno

About the author

Creator of Bantam City Games, a one-man independent game development studio. To learn more, check out 'A Game Developer's Saga', a game development blog at: http://www.bantamcity.com/blog


#1
09/19/2006 (10:45 am)
The simplest melee you can do, is just making a forward raycast check when you attack with the weapon. It's not the greatest thing, but you can get things working and testable with it. There are variations of the method you can use to get somewhat more accurate results as well. Then if you need better later, you can go add the more complex melee code later.
#2
09/19/2006 (12:54 pm)
@Paul - is this done in script or source code? Do you have any resources about this because I have been searching the forums for weeks, but I will search more today specifically mentioning raycasting.

Thanks.
#4
09/19/2006 (5:10 pm)
@Ramen - This is the most simple one I have found so far, but it still requires source code changes. Is there no way to mount an object and get an onCollision callback all in script? Can anyone explain?

@Ramen - Do you know if this mod is multiplayer ready?

I have heard it mentioned that people are able to use mountObject on StaticShape or ShapeBase objects and use them to check for collisions but I am not able to do this. Can someone shed some light on this subect?

Thanks.