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.
#82
I will try to get the commented stuff pulled so at least when you browse the files you will see what needs to be added compared to the base engine..
02/05/2007 (4:36 pm)
I found it very useful. and as long as you merge only the platform stuff your fine.. I think some people may be adding ramens other code which isnt needed and may not be complete, ie not all cc files inluded for the things he has done. He commented it really well so I didnt have any problems. and for those switching to 1.5 form 1.4 dont change anyhting.. you should only add.. there are spots that its the same code almost except for some minor changes..I will try to get the commented stuff pulled so at least when you browse the files you will see what needs to be added compared to the base engine..
#83
Off topic: Does anyone know of an elegant way to allow breaking pieces of ships in Torque (1.5 or TSE (TGEA I guess now heh)) from both a model and code standpoint?
I have space available for files if need be, just send them to n00854180t@gmail.com.
02/05/2007 (4:45 pm)
Hey guys, this resource will be integral to the game I'm working on, and looks very cool (a unique twist on naval and melee combat, we're in design phases now (doing concept art to nail some things down and also design docs and such)). I'd like to port it to TSE. If possible, I'd like to start from an updated version for 1.5. We'll probably prototype in 1.5 and then port to TSE, but since things are pretty much in hand for this one (any specific improvements anyone could suggest? I haven't seen it in game since I'm focusing on the current stuff so much and not coding) I'd as soon get that worked on so that it can be done.Off topic: Does anyone know of an elegant way to allow breaking pieces of ships in Torque (1.5 or TSE (TGEA I guess now heh)) from both a model and code standpoint?
I have space available for files if need be, just send them to n00854180t@gmail.com.
#84
02/05/2007 (9:40 pm)
I got it to compile in 1.5, but when I try to load a mission with a pathshape in it, the game crashes (access violation, I think).
#85
02/06/2007 (2:10 am)
Hmmmm i'm gonna see about a complete rewrite since this has become much more popular as of late, my code was based off anothers code, and what not... so i'm going to try and streamline it and make it as painless as possible.
#86
02/06/2007 (8:31 pm)
For the record, I used WinMerge on TLK 1.4 to add this code, and it worked right away. WinMerge is really great once you've got used to it. Since Ramen's files do not include the Lighting Kit codeblocks, I recommend a manual merge of the two, if you need them both. There was nothing to it, really.
#87
02/07/2007 (7:33 am)
The merge worked fine, and I fixed that access violation, but for some reason there's an problem in pathshape.cs with functions that don't seem to pass arguments correctly. I'll try re-merging it in case I did something wrong there.
#88
1. Is there a tutorial for this yet? and
2. Would this code be good for an elevator that would go up and down?
I have Torque 1.5 and need to put an elevator in, just wondering.
02/11/2007 (8:33 pm)
Two questions:1. Is there a tutorial for this yet? and
2. Would this code be good for an elevator that would go up and down?
I have Torque 1.5 and need to put an elevator in, just wondering.
#89
2. it would work just fine as an elevator, though, i have not tested it in that situation.
I was able to get someone to merge this with 1.5, I'll work on getting a new mission setup using a pathshape in a similiar manner as i did before.
02/11/2007 (8:54 pm)
1. There is no tutorial(yet)2. it would work just fine as an elevator, though, i have not tested it in that situation.
I was able to get someone to merge this with 1.5, I'll work on getting a new mission setup using a pathshape in a similiar manner as i did before.
#90
02/12/2007 (12:49 pm)
Ok. I merged the code that you supplied with the old stuff and it compiled. Where can I see this platform in action?
#91
So I made a Stop, Up, and Down, and it works only when player is
in contact with platform. You could also make it work side to side in the same manner.
Its Pretty easy to set up.
02/12/2007 (1:12 pm)
I got it to work like an elevator a long time-a-go, just by binding key commands to it.So I made a Stop, Up, and Down, and it works only when player is
in contact with platform. You could also make it work side to side in the same manner.
Its Pretty easy to set up.
#92
02/12/2007 (1:42 pm)
I've almost got it working...
#93
So you need to create a pathshape object, and then put the player on it one way or another. Then you need to know how to start, stop, etc. My implementation is a little different then the standard pathshape resource. Before you can get the platform to move, you will need to set it's direction.
If you look in pathshape.cs, you'll see an example of how to start it. it's on pathshape::oncollision i believe.
02/12/2007 (2:42 pm)
How the code works is simple. there's a raycast from the player strait down. If it detects a pathshape object, the player is then attached to it.So you need to create a pathshape object, and then put the player on it one way or another. Then you need to know how to start, stop, etc. My implementation is a little different then the standard pathshape resource. Before you can get the platform to move, you will need to set it's direction.
If you look in pathshape.cs, you'll see an example of how to start it. it's on pathshape::oncollision i believe.
#94
P.S. Thanks for all the help so far!
02/12/2007 (10:02 pm)
Oy, more problems. The code compiled, but when I opened my game's .exe file up the screen goes gray and I can't move the mouse or do anything. It essentially freezes. Any idea why?P.S. Thanks for all the help so far!
#95
02/13/2007 (7:44 am)
Have you tried running a debugger?
#96
02/13/2007 (3:49 pm)
Hmm you guys are too much :P I'll upload a 1.5 compatible version today.
#97
02/13/2007 (4:48 pm)
I think I actually have 1.4, sorry about that. But no I have not run a debugger. I get that gray screen in my game, and for the FPS the guy does spawn on the dock but I don't see a raft. All the pathshape files are where they should be, I believe. Not sure why that doesn't show up :-(
#98
02/13/2007 (4:50 pm)
What's the console log say? search it for anything pathshape related. are are you sure you added the pathshape.cc and .h file to your project?
#99
starter.fps/server/scripts/pathshape.cs (0): Unable to instantiate non-conobject class PathShapeData
starter.fps/data/missions/stronghold.mis (0): Unable to instantiate non-conobject class PathShape.
02/13/2007 (5:21 pm)
Pathshape.cc and pathshape.h are in the engine/game folder. The pathshape.cs goes in the server/scripts folder right? I checked the console, and for the fps.starter it gave me this:starter.fps/server/scripts/pathshape.cs (0): Unable to instantiate non-conobject class PathShapeData
starter.fps/data/missions/stronghold.mis (0): Unable to instantiate non-conobject class PathShape.
#100
The error you reported tells me it was not added to the VS project. to do so, you need to navigate the directory tree of the project

from there select the pathshape.cc and pathshape.h files
02/13/2007 (6:43 pm)
Did you ADD the pathshape.cc and .h to your project? it must be done in visual studio.The error you reported tells me it was not added to the VS project. to do so, you need to navigate the directory tree of the project

from there select the pathshape.cc and pathshape.h files
Torque Owner Phoenix Online Studios