Scale the player
by Don Bates · in Torque 3D Professional · 06/02/2010 (1:03 pm) · 11 replies
I've been trying now for days to re-scale the player upon game startup. What I want to do is reduce the player size to 0.7. I've looked over the forums and tried quite a few things, none have worked at all. So where exactly do I put %player.setScale("0.7 0.7 0.7")?
#2
You should also check to make sure the parameter name matches what onAdd() is looking for, ie. %player would need to be %obj if memory serves.
06/02/2010 (1:24 pm)
Armor::onAdd()You should also check to make sure the parameter name matches what onAdd() is looking for, ie. %player would need to be %obj if memory serves.
#3
in player.cs under function PLAYERDATA:onAdd
view plainprint?
%obj.setScale("2 2 2"); // for example. "
I looked in player.cs under datablocks and the player.cs in scripts/server. Cannot find playerdata::onAdd( anywhere except in aiplayer.cs where its remmed out
06/02/2010 (2:08 pm)
"06/02/2010 (3:15 pm)in player.cs under function PLAYERDATA:onAdd
view plainprint?
%obj.setScale("2 2 2"); // for example. "
I looked in player.cs under datablocks and the player.cs in scripts/server. Cannot find playerdata::onAdd( anywhere except in aiplayer.cs where its remmed out
#4
That is really really strange to edit the armor and not player but it works!
Thank you Michael
06/02/2010 (2:16 pm)
Armor::onAdd()That is really really strange to edit the armor and not player but it works!
Thank you Michael
#5
You'll see...
06/02/2010 (4:00 pm)
Under game/scripts/server...You'll see...
function PLAYERDATA::onAdd(%this,%obj)
{
// Vehicle timeout
%obj.mountVehicle = true;
%obj.setScale("1.2 1.2 1.2"); // this is where I scale my player, and where everything else is kept on adding the player.
// Default dynamic armor stats
%obj.setRechargeRate(%this.rechargeRate);
%obj.setRepairRate(0);
}
#6
in Torque 3D its:
function Armor::onAdd(%this, %obj)
{
// Vehicle timeout
%obj.mountVehicle = true;
// Default dynamic armor stats
%obj.setRechargeRate(%this.rechargeRate);
%obj.setRepairRate(0);
// Set the numerical Health HUD
//%obj.updateHealth();
// Calling updateHealth() must be delayed now... for some reason
%obj.schedule(50, "updateHealth");
%obj.setScale("0.7 0.7 0.7");
}
Thanks for the help though.
06/02/2010 (5:31 pm)
I found that, in TGEA but not in Torque 3Din Torque 3D its:
function Armor::onAdd(%this, %obj)
{
// Vehicle timeout
%obj.mountVehicle = true;
// Default dynamic armor stats
%obj.setRechargeRate(%this.rechargeRate);
%obj.setRepairRate(0);
// Set the numerical Health HUD
//%obj.updateHealth();
// Calling updateHealth() must be delayed now... for some reason
%obj.schedule(50, "updateHealth");
%obj.setScale("0.7 0.7 0.7");
}
Thanks for the help though.
#7
06/03/2010 (2:39 am)
No worries.. This is on 1.1 BETA 1, although I'm using AFX so may be different.
#8
06/03/2010 (11:32 am)
I'm on 1.1 Beta 1 and wish I had AFX, I'll get it soon but not soon enough...
#9
06/04/2010 (2:43 am)
AFX is really cool.. definately adds value to your game for the special effects and manipulation of your game objects alone :) still a few bugs in the latest version, but that is to be expected until a stable release of T3D is out there, AFX will then follow up with a release instead of BETA.
#10
Hopefully that made sense ;)
06/04/2010 (4:45 pm)
Quote:Armor or PlayerData, it means the same thing, it's just a namespace distinction. PlayerData would be the default name for those functions, however in the player datablock it was given a class of "armor". By giving those functions the armor namespace means we can have differing methods for differing script "classes" and still be able to use the default if a script "class" method is not given -- only in the case of the FullTemplate/FPSExample such was not actually implmented/used, so I can see how that name (armor) could be confusing to some.
That is really really strange to edit the armor and not player but it works!
Hopefully that made sense ;)
#11
11/05/2011 (8:48 pm)
In T3D you can scale the player in the editor and when you save as the next time you load he is still scaled.works for me with gideon.same way you scale other models.
Torque Owner Jules
Something2Play
%obj.setScale("2 2 2"); // for example.