Game Development Community

Link point easy to access from script?

by Alex Rice · in Torque Game Builder · 06/11/2006 (9:36 pm) · 2 replies

In the TGB level builder, it's easy to drop an object onto another object's link point to mount it. Works great. But from script the link points are a little on the tedious side. Is there a more direct way? here is what I ended up writing:

%tLinkWorldPoint = %this.positionTargetMountToCell.getLinkPoint(1);
%tLinkLocalPoint = %this.positionTargetMountToCell.getLocalPoint( 
                                                getWord( %tLinkWorldPoint, 0), 
                                                getWord( %tLinkWorldPoint, 1));        
%this.mount( %this.positionTargetMountToCell, 
                  getWord( %tLinkLocalPoint, 0 ), 
                  getWord( %tLinkLocalPoint, 1), 
                  100, true, false, false, false);

#1
06/11/2006 (11:51 pm)
Nope. There is a t2dSceneObject method in the engine that can mount to an existing link point, but it is not exposed to scripts.

I hadn't really thought of this particular situation, so I will consider exposing it - need to check something first to make sure everything will work properly (technically link points and mount points are not exactly the same thing).
#2
06/12/2006 (10:40 am)
What is the difference between a link point and a mount point?