Moving Objects that players can ride on!
by Cinder Games · 07/03/2006 (2:24 am) · 31 comments
I've spent a good week or more trying to come up with a feasible method for a player to "ride" on a platform, elevator, spaceship.. whatever.
And i've finally got something that seems to work. Currently the players are able to dynamically attach to pathshape objects. which can then wisk them around the world. But this is going to be expanding so players can ride in/on ships, flying castles, whatever. it's not gonna matter :) It's a little different then "mounting" As the player still retains his movement and collision abilities, so they can jump off whenever they want. Also they'll be able to jump from one moving object to another.
Soon i'll be expanding this resource to do more attachment to player objects as well. that's already been implemented, but isn't in this code release. Currently that's not too incredibly useful... or is it? if you say attach a crate to a player object...... the player can then push the crate or something, or maybe other things to that effect.
How is this different from this "Pathed Interior" resource? well you don't have to use DIF for one.
You can attach yourself to a animated, flying bird for example... you can be inside an animated DTS that's flying thru space. Really it's up to your imagination.
Here's a little path around the lake for our "hero" to traverse on his flying square

Riding the wind!

Ditto!

SO to prove it. here's a video :P
ramensama.dyndns.org:8000/temp/stronghold.avi
It's 2.09 megs. enjoy and please post some comments.
OK, please go to this thread to download the code::
www.garagegames.com/mg/forums/result.thread.php?qt=47074
And i've finally got something that seems to work. Currently the players are able to dynamically attach to pathshape objects. which can then wisk them around the world. But this is going to be expanding so players can ride in/on ships, flying castles, whatever. it's not gonna matter :) It's a little different then "mounting" As the player still retains his movement and collision abilities, so they can jump off whenever they want. Also they'll be able to jump from one moving object to another.
Soon i'll be expanding this resource to do more attachment to player objects as well. that's already been implemented, but isn't in this code release. Currently that's not too incredibly useful... or is it? if you say attach a crate to a player object...... the player can then push the crate or something, or maybe other things to that effect.
How is this different from this "Pathed Interior" resource? well you don't have to use DIF for one.
You can attach yourself to a animated, flying bird for example... you can be inside an animated DTS that's flying thru space. Really it's up to your imagination.
Here's a little path around the lake for our "hero" to traverse on his flying square

Riding the wind!

Ditto!

SO to prove it. here's a video :P
ramensama.dyndns.org:8000/temp/stronghold.avi
It's 2.09 megs. enjoy and please post some comments.
OK, please go to this thread to download the code::
www.garagegames.com/mg/forums/result.thread.php?qt=47074
About the author
#22
10/15/2006 (12:01 am)
yes i extracted the files to C:\Torque\sdk
#23
10/15/2006 (12:02 am)
i saw that someone named casey had the same problem but i deleted the dsos and nothing. i even reinstalled the whole thing
#24
how to create a pathed object ,is your pathed object a static shape item class.or a pathedcamera class or a pathshape class.
12/14/2006 (12:46 am)
i am a tse owner . i can not access the code link. so pls let me know this.how to create a pathed object ,is your pathed object a static shape item class.or a pathedcamera class or a pathshape class.
#25
01/20/2007 (1:44 am)
Anyone also has the problem that the platform starts jumping after one round and on the third round even drops the player?
#27
01/26/2007 (8:58 pm)
Well, I recompiled it with out error, yes. Is not a big deal, is it? Just throw in the changed files, add the two additional files to the project and compile it! To be sure, I cleaned all up and compiled everything new and I also deleted all dso files. I was doing it on a freshly installed Torque 1.4, not 1.4.2 though.
#28
01/26/2007 (9:00 pm)
Do you have an instant messaging program? perhaps you can contact me on AIM or Yahoo!, perhaps i can help figure out the issue then.
#29
Maybe I can send you a recording? Will that be useful?
01/26/2007 (10:36 pm)
no, sorry, all I use sometimes is IRC...Maybe I can send you a recording? Will that be useful?
#30
01/26/2007 (10:41 pm)
Yes. a video would help me to understand. Perhaps you can e-mail it to me?
#31
if you look at pathshape.cs
function LoopingShape::onCollision(%this,%obj,%col){
%obj.followpath(Path);
}
for that line. i added in an error...
error("A collsion with a loopingshape has occurred");
i noticed that when the glitch occurs, it's cause there was a collision detected. the "collision" with the pathshape is what is triggering the pathshape to follow a path. So when the pathshape restarts it's loop, it's position/rotation is changing slightly, and a collision is being detected. an easy fix would be some sanity checking. Add a variable or something to the player or the pathshape to let it know it's moving, and doesn't need to be restarted.
I'll work on adding some callbacks or something to query the status of the pathshape.....
01/26/2007 (11:42 pm)
Ok, i've determined the issue.if you look at pathshape.cs
function LoopingShape::onCollision(%this,%obj,%col){
%obj.followpath(Path);
}
for that line. i added in an error...
error("A collsion with a loopingshape has occurred");
i noticed that when the glitch occurs, it's cause there was a collision detected. the "collision" with the pathshape is what is triggering the pathshape to follow a path. So when the pathshape restarts it's loop, it's position/rotation is changing slightly, and a collision is being detected. an easy fix would be some sanity checking. Add a variable or something to the player or the pathshape to let it know it's moving, and doesn't need to be restarted.
I'll work on adding some callbacks or something to query the status of the pathshape.....

Torque Owner Cinder Games