making a new shape type
by Andy Simon · in Torque 3D Professional · 08/10/2009 (12:33 pm) · 3 replies
I really need to make an elevator for my project. I've been thinking about the best way to approach this but maybe you guys have a better idea. I've been thinking to create a new class based off staticshape but add the functionality to have the movement scripted. I've seen other methods for scripting TSstatic movement, but it looked like too much effort and a not so awesome door/elevator.
I don't know how torque handles movement of objects. I decided to look in the vehicle class and I found several functions that should have something to do with this, updatePos and updateMove. But I think I also need the collision functions and pack/unpackUpdate. Any input to help me tie this all together? Thanks!
I don't know how torque handles movement of objects. I decided to look in the vehicle class and I found several functions that should have something to do with this, updatePos and updateMove. But I think I also need the collision functions and pack/unpackUpdate. Any input to help me tie this all together? Thanks!
About the author
#2
http://www.garagegames.com/community/forums/viewthread/95951
I've been looking through it and based on their code I'm on the right path. But I've thought of a better way, create a vehicle and extend the FlyingVehicle class, and add console methods to open movement to the scripting system using stuff from the AIplayer class...
Thanks for the input brian!
08/10/2009 (1:28 pm)
Actually I looked into that, problem is animated collision meshes don't really work. I found an interesting resource though, someone already wrote some code to have a static shape follow a path:http://www.garagegames.com/community/forums/viewthread/95951
I've been looking through it and based on their code I'm on the right path. But I've thought of a better way, create a vehicle and extend the FlyingVehicle class, and add console methods to open movement to the scripting system using stuff from the AIplayer class...
Thanks for the input brian!
#3
08/10/2009 (1:36 pm)
If you use the resource "platforms players can ride on", it's quite simple to make an elevator that the player can walk around on while it's going up/down.
Torque Owner Brian Mayberry
Dead on Que Productions
I'm just getting my head around all of this fancy new Torque myself, but instead of trying to get dirty and script a new class just for simple movement, I would look into triggering an animation for said shape.
As so long as the collision behaves accordingly, I don't see why it wouldn't work. Plus you could get a lot more detail out of your movement animation.