Game Development Community

dev|Pro Game Development Curriculum

Dynamically Scaling Players, Vehicles, and Objects

by Conrad "Lynx" Wong · 03/11/2003 (1:40 pm) · 25 comments

The attached patch file corrects Torque so that if the scale of a SceneObject is changed on the server, it will pass this change down to the client. Scaling an object and then clicking 'apply' will now also result in immediate rescaling and redrawing of the object.

Players and vehicles collide correctly when rescaled, i.e. a player scaled to 5x normal size will collide at that size against a placed cube, rather than partially penetrating the cube. The scaled player's jump force is scaled somewhat so that a very large player jumps higher and a small player jumps lower than a normal sized player. Run was not touched. Footprint decals are scaled. Mounted images, i.e. weapons will attach to the scaled attach points and are also scaled in appearance so a large player does not appear to be carrying a ridiculously small weapon.

Changes have been tested in fps example.

lagkitten.purrsia.com/torque/scaling.patch

Here is a script example of how you could create a scaled-up player:

// Set up the player
%player = new Player() {
dataBlock = LightMaleHumanArmor;
client = %this;
scale = "5 5 5";
};
MissionCleanup.add(%player);

You can also scale the player, vehicles, or objects in the editor, simply by selecting the player, selecting 'Transform' fields, entering the new scaling values (which are X, Y, and Z respectively), and clicking 'apply'. After this change is applied, scaling changes to these objects will take place immediately instead of requiring the object to be dragged to make transformations show on the client side.

About the author

Recent Blogs

Page«First 1 2 Next»
#21
08/07/2006 (6:16 pm)
thank it work
#22
12/06/2006 (11:02 am)
Drew, did you ever get to the bottom of the Player::Step problem???
#23
02/10/2007 (8:11 pm)
if i have a humvee, how would i resize both the tire and the actual car so that they were both the same scale?
#24
01/07/2008 (7:46 am)
Great job. one of what I'm seeking. :-)

Actually this resource is already applied to Torque 1.4 and TGEA as I chcked. (not checked 1.5 but I guess it did too)
#25
03/12/2008 (1:12 pm)
Conrad,

First of all, thanks for posting this resource. I'm sure many will find it useful.

But, you might consider posting the code along with the patch for those of us who prefere to make the changes ourselves.

;)
Page«First 1 2 Next»