Moving Objects Players can Ride on, code inside.
by Cinder Games · in Torque Game Engine · 07/03/2006 (3:35 am) · 105 replies
This is a continuation of this thread....
www.garagegames.com/mg/forums/result.thread.php?qt=44667
for pictures....
www.garagegames.com/blogs/11127/10822
Alright everyone, here's some files you can add to add this spiffy feature.
This zip file contains all the needed files to convert your STOCK 1.4 torque.
I do not have the time to do a "resource" right now, so i just threw all the files i modified in a directory tree.
Save this zip in your base torque folder....
C:\Torque or whatever you are using.
Extract the zip where it is and it should overright all the correct files.
You will need to add pathshape.cc and pathshape.h to your Project as well.
Included in a replacement stronghold.mis file. it should put you on the dock when you load it up. the pathshape object is "docked" there. simple fall onto it to begin the ride.
There is currently one small limitation. As of now the moving platform is only affecting the POSTION of the player, and not rotations or anything. I was having a hell of a time trying to get the matrix.mul stuff working. That'll be updated later to fix.
Please post any comments/suggestions/questions.
If something doesn't work, let me know cause i didn't test to make sure all the files were put in the archive :p
I should state this is based on a resource by Anthony Lovell
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9093
MANY of the functions in sceneobject.cc, he wrote are including in this, however not all of them. I found use in some of his code, but decided to go a different way in many other places
The Zip::
ramensama.dyndns.org:8000/temp/torque.zip
PS, i'd like to mirror this since i'm hosting it off my computer. If you can mirror this, please let me know.
www.garagegames.com/mg/forums/result.thread.php?qt=44667
for pictures....
www.garagegames.com/blogs/11127/10822
Alright everyone, here's some files you can add to add this spiffy feature.
This zip file contains all the needed files to convert your STOCK 1.4 torque.
I do not have the time to do a "resource" right now, so i just threw all the files i modified in a directory tree.
Save this zip in your base torque folder....
C:\Torque or whatever you are using.
Extract the zip where it is and it should overright all the correct files.
You will need to add pathshape.cc and pathshape.h to your Project as well.
Included in a replacement stronghold.mis file. it should put you on the dock when you load it up. the pathshape object is "docked" there. simple fall onto it to begin the ride.
There is currently one small limitation. As of now the moving platform is only affecting the POSTION of the player, and not rotations or anything. I was having a hell of a time trying to get the matrix.mul stuff working. That'll be updated later to fix.
Please post any comments/suggestions/questions.
If something doesn't work, let me know cause i didn't test to make sure all the files were put in the archive :p
I should state this is based on a resource by Anthony Lovell
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9093
MANY of the functions in sceneobject.cc, he wrote are including in this, however not all of them. I found use in some of his code, but decided to go a different way in many other places
The Zip::
ramensama.dyndns.org:8000/temp/torque.zip
PS, i'd like to mirror this since i'm hosting it off my computer. If you can mirror this, please let me know.
#62
@Allyn
Hmm i haven't done any expermints with large dts shapes. But i don't see why it would be noticeable to the player if there were on a moving dts object that was large. the player and the pathshaped dts object each are affected by physics. with my example, the player and jump onto the pathshape object while it moves... and can even jump onto other moving pathshapes. so movng and jumping seem to behave like you'd expect. However, if a player is struck by a moving pathshape.. that's where issues will arise. Since only moving players and other things will detect the collision, the player may simply pass thru an object. But there shouldn't be any problems while the player is actually in motion, like running/jumping etc. Maybe someone can do some tests...... or i might when i return to torque.
10/30/2006 (8:49 pm)
Been hit with several games i was forced to play, Valkyrie Profile 2, Final Fantasy 12, Phantasy Star Universe, and currently playing .hack .G.U. Volume one :) Maybe when i'm done i can get back to torque.@Allyn
Hmm i haven't done any expermints with large dts shapes. But i don't see why it would be noticeable to the player if there were on a moving dts object that was large. the player and the pathshaped dts object each are affected by physics. with my example, the player and jump onto the pathshape object while it moves... and can even jump onto other moving pathshapes. so movng and jumping seem to behave like you'd expect. However, if a player is struck by a moving pathshape.. that's where issues will arise. Since only moving players and other things will detect the collision, the player may simply pass thru an object. But there shouldn't be any problems while the player is actually in motion, like running/jumping etc. Maybe someone can do some tests...... or i might when i return to torque.
#63
Thanks Brandon and thanks Ramen for the great resource.
11/01/2006 (12:02 am)
I got it all working. Thanks Brandon and thanks Ramen for the great resource.
#65
12/31/2006 (6:08 pm)
Well that's good to know.
#66
Let me tell you what I am trying to do and if you could; tell me if your resource will do the job for me.
I have a wheeledvehical namely a Forklift which has an animation of the main boom raising. I attach a pallet to the boom through an mount node. But when I play the animation of the boom raising the pallet will raise with the animation but it's collison box will not move with it. Oddly enough if I walk the player up to the forklifts bounding box the collision box of the attached pallet will update and move to where the actual pallet is.
If your resource doesn't have anything to do with what I'm talking about could you at least point me in the direction of where to update an objects collision box. It has to happen somewhere since when I move the player through the forklifts bounding box the pallets collison box updates properly.
//edit//
oh I'm currently using 1.4 with a few minor modifications, but will eventualy move to 1.5
01/24/2007 (4:50 pm)
Hey there, I read through both Threads and saw a spot where you talk about attaching any object to another object and the attached object followed the attchee with no problems.Let me tell you what I am trying to do and if you could; tell me if your resource will do the job for me.
I have a wheeledvehical namely a Forklift which has an animation of the main boom raising. I attach a pallet to the boom through an mount node. But when I play the animation of the boom raising the pallet will raise with the animation but it's collison box will not move with it. Oddly enough if I walk the player up to the forklifts bounding box the collision box of the attached pallet will update and move to where the actual pallet is.
If your resource doesn't have anything to do with what I'm talking about could you at least point me in the direction of where to update an objects collision box. It has to happen somewhere since when I move the player through the forklifts bounding box the pallets collison box updates properly.
//edit//
oh I'm currently using 1.4 with a few minor modifications, but will eventualy move to 1.5
#67
01/24/2007 (5:46 pm)
I would also be interested in attaching objects to other objects like that....
#68
Well, to be honest, i've been rather distracted from torque lately. I was infact working on methods to attach objects to nodes of other objects so that animations would affect the players position. I haven't found the time and interest lately for torque. Mostly me fighting some strange and backwards engine for most of my time using it. But aside from that, i'm fairly confident i could write something to make it all work.
Feel free to paypal me some donations to make me interested. :p
But yeah, i'm not quite sure when i'd be able to add in the functionality with my current schedule. I'm not familiar with any resource that will do what you'd like.
01/24/2007 (11:10 pm)
@ CTS Well, to be honest, i've been rather distracted from torque lately. I was infact working on methods to attach objects to nodes of other objects so that animations would affect the players position. I haven't found the time and interest lately for torque. Mostly me fighting some strange and backwards engine for most of my time using it. But aside from that, i'm fairly confident i could write something to make it all work.
Feel free to paypal me some donations to make me interested. :p
But yeah, i'm not quite sure when i'd be able to add in the functionality with my current schedule. I'm not familiar with any resource that will do what you'd like.
#69
Thanks for responding, I'll post when I figure this out.
01/25/2007 (2:30 pm)
Got ya, I just don't get why the collison box would update when the player interacts with the vehicals bounding box, Neither the player or the vehicals onCollision is being called. If I could just find out what is being called I would be able to solve my problem. I was just hopeing you had an idea of what was going on. Well back to work I guess, by the way I would be glad to "donate" but I'm not in the position to do so myself, heh sorry.Thanks for responding, I'll post when I figure this out.
#70
Got it working really well, except for a little snag: The updating of player positions (actually, it's an aiplayer but I assume that's ok) once it is attached to the platform, is quite jerky. Maybe around 5 position updates per second. This happens both when walking on the platform while it's not moving, and when it moves. The platform itself moves smoothly though.
Any idea what might be the reason?
02/04/2007 (1:05 pm)
Great resource!!!Got it working really well, except for a little snag: The updating of player positions (actually, it's an aiplayer but I assume that's ok) once it is attached to the platform, is quite jerky. Maybe around 5 position updates per second. This happens both when walking on the platform while it's not moving, and when it moves. The platform itself moves smoothly though.
Any idea what might be the reason?
#71
02/04/2007 (4:31 pm)
Well i definately have an idea why it's doing that. the player used to jerk around just like that when i first started working on the code. I'm guessing that the AIPlayer's routine is not using some of the same code to fix it's position like the normal players are. uhm.... i'll see if i can get around to fixing this this evening. if not, within the week.
#72
02/04/2007 (7:50 pm)
This doesn't seem to build in 1.5. There are about 90 errors in unrelated files. Is anyone else having this problem?
#73
02/04/2007 (7:52 pm)
Did you add in the pathshape.cc and pathshape.h to your project?
#74
02/04/2007 (7:55 pm)
Yes. It compiled fine before I did and got messed up after.
#75
02/04/2007 (7:56 pm)
Can you list some of the errors you're getting?
#76
02/04/2007 (8:20 pm)
It's all things relating to TLK:P:\Torque\engine\game\staticShape.cc(90) : error C2039: 'receiveSunLight' : is not a member of 'SceneObject'
../engine\sim/sceneObject.h(241) : see declaration of 'SceneObject'
P:\Torque\engine\game\staticShape.cc(91) : error C2039: 'receiveLMLighting' : is not a member of 'SceneObject'
../engine\sim/sceneObject.h(241) : see declaration of 'SceneObject'
P:\Torque\engine\game\staticShape.cc(92) : error C2039: 'useAdaptiveSelfIllumination' : is not a member of 'SceneObject'
../engine\sim/sceneObject.h(241) : see declaration of 'SceneObject'
P:\Torque\engine\game\staticShape.cc(93) : error C2039: 'useCustomAmbientLighting' : is not a member of 'SceneObject'
../engine\sim/sceneObject.h(241) : see declaration of 'SceneObject'
P:\Torque\engine\game\staticShape.cc(94) : error C2039: 'customAmbientForSelfIllumination' : is not a member of 'SceneObject'
../engine\sim/sceneObject.h(241) : see declaration of 'SceneObject'
P:\Torque\engine\game\staticShape.cc(95) : error C2039: 'customAmbientLighting' : is not a member of 'SceneObject'
../engine\sim/sceneObject.h(241) : see declaration of 'SceneObject'
P:\Torque\engine\game\staticShape.cc(96) : error C2039: 'lightGroupName' : is not a member of 'SceneObject'
#77
02/04/2007 (8:23 pm)
Can I just get the new code so I can add it without deleting any of the TLK stuff?
#78
www.garagegames.com/blogs/11127/12188
Tom has it working in 1.5..... maybe you could ask him what he did?
02/04/2007 (8:25 pm)
I don't have torque 1.5, but i'll ask someone to attempt to merge it. in the mean time,www.garagegames.com/blogs/11127/12188
Tom has it working in 1.5..... maybe you could ask him what he did?
#79
and a video showing that yes.. it works in 1.5... :) home.comcast.net/~theberk/toby02042007a.avi
I will post here when I get the code pulled out.. :)
TomFeni
02/04/2007 (9:21 pm)
I will see what I can do about writing up an easier way to add this without having to use winmerge..and a video showing that yes.. it works in 1.5... :) home.comcast.net/~theberk/toby02042007a.avi
I will post here when I get the code pulled out.. :)
TomFeni
#80
02/05/2007 (7:50 am)
Is winmerge hard to use? cause it looks really useful for this exact sort of thing, and would prevent resources from running over each other.
Torque 3D Owner Brandon Maness
Honestly, If I were you, I would spend some time working on the basics of C++ and managing/compiling less complex projects to begin with. Although adding a resource to the code base might be considered trivial by some, you will have a better experience working with TGE if you have a firm grasp of the fundamentals of developing with C/C++.
Trying to add resources when you don't understand basic C++ concepts and compler/linker workflow is alot like trying to write a book or novel when you don't underastand words or sentence structure. Save yourself some headache and work through some basic C++ tutorials on the web. It will be time well spent.