Game Development Community

RE-scaling a character

by Jonas · in Torque 3D Professional · 06/08/2011 (8:00 am) · 3 replies

Heyo!

This is porbably one of the easier questions you will ever hear but here goes:

How do i go about rescaling a chracter? and i dont mean placing a chracter in the world
and using the simple Scale functionality, what i mean is the chracter object that gets spawned
as a player.
I have checked around and tried various solutions but i have yet to get it to work.
I also observe that all the character/weapons in the basic T3D build are correct size from the
beginning.

any help at all is appreciated.

Best regards
Jonas

About the author

Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.


#1
06/08/2011 (8:36 am)
The stock assets are already *theoretically* scaled to size before introduction to the engine. This is a good procedure to follow keeping a consistent scale between art assets without forcing the engine to scale things for you.

You can use setScale(x y z) scriptside, usually in an onAdd() callback or you can adjust the scale property of an object as it is instantiated.
#2
06/11/2011 (6:33 am)
Thanks! i tested it with my character under this way:

function Armor::onAdd(%this, %obj)
{
%obj.setscale("0.5 0.5 0.5");
}

And it works as intended, but it seems i cant apply the same logic to weapons. I have tested around a bit with the same concept of using the Classname (in the players case: className = Armor;) i figured using the Classname for weapons would be a good idea using: className = "WeaponImage"; i could scale down all in one command in the weapon.cs file.

But so far i haven't gotten it to work, Is it something im missing or do i simply need to do it another way?

Best regards
Jonas
#3
06/11/2011 (9:13 am)
By default mounted weapons are automatically scaled according to the shape they're mounted to. It takes a small source code mod to enable adjustable shape image scaling - there is a Resource by Konrad that shows how.