Game Development Community

Platforms Players can Ride Version 1.1

by Cinder Games · in Torque Game Engine · 01/27/2007 (4:34 pm) · 268 replies

Platforms Players can Ride Version 1.2!!!!!!
with Dynamic object Attachment
###################################
##This post has been edited and updated 2/13/07 ##
##################################

subvoicestudios.com/~ramensama/TorqueDynamicAttachment.jpg

Here's the new and improved files you'd need.
Version 1.2
subvoicestudios.com/~ramensama/torque1.5.2.zip

1.7.2008
What's new? There are several new features and improvements.

1) Removed or reduced jitter caused by multiple players on a platform
2) Support for new items on platforms. Now Items, Shapes, lights, particle emitters, and possibly others!
3) Object to object Attachment. Players can now attach Items, shapes, etc to them. Even the attached objects can attach more objects to themselves!
4) Reduced the number of code changes.... a little.


This must be extracted in the base torque directory where it's installed...
c:/torque

or whatever. it's designed to simply overwrite a stock install of torque.

Afterwards you must add pathshape.cc and pathshape.h to your project in visual studio or whatever.

img292.imageshack.us/img292/9507/addexistingxy9.gif

To attach an object, you must use this syntax:

ParentObject.attachChild(ChildObject);

So if you want to attach an item to the player, move the player towards the object, press F11 to get the object ID. Press ~ and type in $player.attachchild(ObjectID);

The item is now attached to the player.

$player.detachchild(ObjectID); is how to remove the object.






Ancient Versions of the code can be found here.
These are version 1.1, not the newest version and probably have bugs that the newer code does not.
Here's a link to the new updated code. It's for torque 1.4...
subvoicestudios.com/~ramensama/torque.zip

And for Torque 1.5
subvoicestudios.com/~ramensama/torque1.5.zip
#61
05/03/2007 (11:29 am)
I got it to compile in 1.5 finally but it doesn't work. All I can do is create a static shape which does nothing.
#62
05/03/2007 (5:08 pm)
Hmm i can't honestly say i know how to create a pathshape object via the mission editor.
I always created it via script. Try creating the pathshape object via script.

Also, you compiled it... did you test out the pre-existing mission and ensure you can ride the two platforms in it?
#63
05/04/2007 (5:04 am)
Created may have been the wrong choice of words, "placed" an instance of the object in the world was my intent. Placed using the editor because creating one is script would still have to reference some location in world space seemed easier.
Yes I tested the pre existing and get this error in the console. The DTS object with texture exists in data/shapes as referenced in the pathshape.cs file. I can find the paths just the shape does not exist when I run the game.

console.log-----
Object 'LoopingShape' is not a member of the 'GameBaseData' data block class
starter.fps/data/missions/stronghold.mis (0): Register object failed for object (null) of class PathShape.
#64
05/04/2007 (3:33 pm)
Sounds like it's not loading the pathshape.cs file.
#65
05/09/2007 (6:15 am)
I deleted the DSO files and all is well, thanks Ramen

Couple questions:
in the new PathShape() one of the members is loopNode, I can't find this in the engine whats it do?
in the new Marker() onGroup = "Default Value" what is this for?

I have 2 nodes, simple elevator, jump on, goes up, on the way down close to the bottom the platform speeds up then hits the bottom node and moves normally, any reason it might speed up as it approaches the bottom node?

Thanks again....
#66
05/09/2007 (6:33 am)
Bug I did notice, if you are playing on a LAN and both players are on the platform and the player that "Joined" the game quits and exits the game, it crashes the server player.
#67
05/10/2007 (10:59 am)
Ramen another thing I noticed in the player.cc file you have all the F32 types in there with no trailing f on the data.
minLookAngle = -1.4; << unless you use -1.4f the compiler assumes double precision math which is a major slowdown in a game loop.
Did you intend on all the data in Player.cc file to be double precision?
#68
05/10/2007 (2:38 pm)
@howard

I uh... didn't make any changes to much of the player.cc file.
Just a few extra calls and what not. I certainly didn't add in stuff like minLookAngle.
#69
05/10/2007 (3:58 pm)
@Howard

They (GarageGames) appear to have added the "trailing f" (technical jargon) to just about everything (generalization) in TGE 1.5.1 (after 1.5.0 but before the prophesied version 1.5.2).
#70
05/11/2007 (5:43 am)
@James I looked at the previous versions and you are correct my appologies Ramen. GG leaving off the trailing f is major bad juju.....

Now on to a previous post about server player crash when a client player quits the game and both are on the platform. Any resolution on that?
#71
05/11/2007 (4:52 pm)
@howard

Well i'm not so great at debugging. Are you? Can you get me the log files to assist me in my determination?
I sorta have an idea what could be causing it though.
#72
05/11/2007 (5:48 pm)
Sure Ramen, i'll ldo a debug build and try to trap the event and check the call stack and send you info.

Another thing you might be able to help me with is the starter.racing demo. I added a platform drove a car on it and it's jerking. The car needs attached or the car needs moved to the new platform location prior to collision checks. In that demo there is no player per se, the car is the player controlling object. Thanks for any help.

I am going to take this resource along with the door resource and create an elevator in a building with a gui for which floor the player wants to go to and floor numbers that light up etc. One of the characters in the game is a wheeled robot (vehicle base) that is actually a character. So all this moving platform is important to the design, anything else I can do to help you solve these bugs let me know.
#73
05/11/2007 (7:41 pm)
Yeah, the vehicle is going to need additional calls and variables to work, if you want, compare what was added to the player.cc and maybe you can figure out how to add that to the vehicle.cc.

Using winmerge you might be able to get the results. If not, i'll see what i can do later.
#74
05/12/2007 (7:06 am)
Ok the crash happens from a call in pathShape.cc

void PathShape::processTick(const Move* move)
...
...

UpdateXformChange(mat);
for (U32 i=0; i < getNumChildren(); i++) {


This Fails when client player leaves game, the platform will have no next and we get access violation

SceneObject::getNumChildren() const
{
U32 num = 0;
for (SceneObject *cur = mGraph.firstChild; cur; cur = cur->mGraph.nextSibling)
#75
05/21/2007 (6:43 am)
I suspect it has something to do with the deletenotify.
I am at work so I can't test it.
It should call the deletenotify and remove the child from the parent.
#76
06/14/2007 (1:34 pm)
OK I think I got this one fixed.

in
SceneObject::OnRemove()

add

if ( getparent() != NULL)
   attachToParent( NULL);

after

Parent::OnRemove();

This removes the crash if you delete a object while it is attached to a parent.
It should be the same crash for when a player quits the game while attached to a parent.
I will test it in network play later.
#77
06/14/2007 (6:18 pm)
Terrific resource yet again, thanks Ramen-sama.

No problems getting it into 1.5.2 after a careful diff with the 1.5.0 files, to see what really needed changing. Works like a charm.

Also great to see the back & forth with Henry Todd, even though I don't understand most of it. I'll be attempting to link/mount a pathshape to an animating DTS, I suspect your discussion/vehicle.cc will point the way.

Seeing as this resource opens up an entire and important genre, I hope this (and/or pathed interiors, which I haven't tried out) finds its way to the front burner for integration by GG. EDIT - whoops I guess pathed interiors have been in for some time now ...
#78
06/26/2007 (5:14 pm)
Yeah, pathed interiors have been"in" for awhile... but do they actually work?
#79
08/04/2007 (6:43 am)
I'm having the exact same problem that Sventhors mentioned previously regarding
smAmbientLight.

Specifically, my compiler tosses 300+ errors all the same (see Shenthor's previous post
from April '07 for a perfect description).

Is there a different process to get this into 1.5.2 or am I just doing something stupid?
#80
08/04/2007 (10:00 pm)
@Kent,
Not sure about your specific issue but - I got it working only after very careful comparison of Ramen-sama's new files vs. 1.5 files vs. 1.5.2 files. Then I copied and pasted only the Ramen-specific changes into 1.5.2. If you just drop Ramen's entire files into 1.5.2 you end up re-introducing some old 1.5 code that doesn't work anymore.