Game Development Community

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.
#21
07/04/2006 (11:14 am)
That seems to be the problem... doesnt look like pathshape.cs is getting exec at all...
#22
07/04/2006 (11:16 am)
Hmmmm Well i included /server/scripts/game.cs which has an exec call with the rest of them. open it up and see if it's there.
#23
07/04/2006 (2:16 pm)
Casey's problem was having DSO files that didn't update. everyone erase them if you have them. But keep in mind these files are just going to overright any existing files, so don't just copy these over if you've made any modifications to the files in the archive :)


OK, that said i'm happy to announce a FIX/Upgrade.

Players are now getting their entire transform updated from the parent object. So now you can rotate the platform and the player follows. Check out the new zip! The platform is now rotates around as it goes along it's path.

ramensama.dyndns.org:8000/temp/torque.zip
#24
07/04/2006 (2:33 pm)
Excelent!... yes be sure to delete you're dso's atleast in the server scripts directory.. that fixed me all up
#25
07/04/2006 (2:35 pm)
The next Update will be a big one :)
#26
07/04/2006 (6:26 pm)
This is great, I had downloaded and merged in your changes.
This works so well, and compiles for me in Visual studio 2005.

Awesome!
#27
07/06/2006 (9:33 am)
Ramen, I give you props! I have the zip and will take a good look at it tonight, and just in time since I am about to begin a thirteen week production cycle! You are my hero.... judging from others' feedback, I know this is what I need for my game as well. Great work, your name (and Anthony's) in the credits are a given!!! - Jason
#28
07/06/2006 (2:38 pm)
Well definately try it out and give some feedback then, in the mean time i'll work on the next update.
#29
07/06/2006 (3:31 pm)
This is very cool.

I'm just curious thought, I've downloaded and integrated- the platform moves great but does not rotate as suggested in your post above.

I've downloaded the files at: ramensama.dyndns.org:8000/temp/torque.zip

Before I spend time debugging this, maybe you put up the wrong zip file?
#30
07/06/2006 (3:33 pm)
That may be the case. the player is not rotating with the platform? Let me check the zip file.
#31
07/07/2006 (12:03 pm)
Everything is great for me Ramen,

When I first collide with my shape , shape follws path I can jump up and down and move on shape while in motion (very cool).

I have it set to loop twice around.The loop eventually stops.
I collide with my shape a second time the loop dosnt start fresh again?
The shape remainds still. Any suggestions.

Can the pathshape be controlled by keyboard commands?
For Example : start,stop,forward,reverse along its path?
#32
07/07/2006 (2:40 pm)
Unfortunately the pathshape isn't my own creation, it tends to be buggy sometimes. For a list of commands availabe to a pathshape, check out the pathshape resource page. Today, i'll try and see what script improvements i can make to correct the problem.
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4849
#33
07/08/2006 (5:09 am)
Ramen

Around or on line 436 in pathShape.cc there is a console function

ConsoleMethod(PathShape,setState,void,3, 3,"PathShape.setState({forward,backward,stop});")

which sets the state forward backward or stop, Im having a little trouble binding keyboard to this.
Are you able to?

-Surge
#34
07/08/2006 (6:43 am)
Ramen, last night I compiled your code into the engine on my PC.... I ran into some problems since I had the TLK already in the engine... But I worked out the wrinkles and thought I would share them here if anyone else out there has TLK code in their engine.

I copied over all engine .cc and .h files Ramen has in his code, except objectTypes.h, sceneObject.h, and sceneObject.cc. I had to find Ramen's particular code changes in those files and add them over manually to avoid screwing up the lighting kit code. Just thought this might help someone out there....

- Jason

P.S. Once again, great work Ramen!!!!
#35
07/08/2006 (7:54 am)
@ Surge


Well, can you provide some example code of what you've tried?

@ Jason

winmerge is a most excellent tool for finding the differences in files if anyone needs to do the same to figure out the differences betweent the stock code and my changes
#36
07/08/2006 (10:47 am)
I have not yet had a chance to look threw the files but, it looks good. nice work. I will let you know how i make out.

Cheers mate, good job.
#37
07/10/2006 (8:18 am)
Ramen, thanks for the tip on winmerge... sounds like that would be much easier than walking through each line of code. :-)
#38
07/11/2006 (1:50 pm)
Well, i added this to the engine, it compiled fine with no errors.

but when i went to run the game it crashed on the attempt to load. di dnot even get the splash screen.

But, then again. i did not use winmerge, i simpoley replaced the files (making backups ofc) so i will try using winmerge and see how that goes.
#39
07/11/2006 (3:08 pm)
That's all i've done to test. i just extracted the files and overwrote them. Did you also add in the pathshape.cc and pathshape.h files to the project? Is your project 100% stock?
#40
07/12/2006 (10:29 am)
The engine runs fine on my PC. It is almost 100% stock except the lightning kit code and a few little modifications here and there. Ramen's code didn't break the engine at all on my attempt, Roland. Like Ramen said, check for pathShape files.