Character initial rotation
by UZON · in Torque Game Engine · 07/18/2007 (11:18 am) · 6 replies
Hi,
I have a little problem, every time i put a AiPlayer in the game, rotate it then save the mission, when i reload the mission, the player has it rotation reseted to "0 0 1". Anyone know how to retain it?
Thanks!
I have a little problem, every time i put a AiPlayer in the game, rotate it then save the mission, when i reload the mission, the player has it rotation reseted to "0 0 1". Anyone know how to retain it?
Thanks!
#2
new AIPlayer(josue) {
canSaveDynamicFields = "1";
position = "23.8748 -412.23 0.170181";
rotation = "0 20 1 86";
scale = "1 1 1.07537";
dataBlock = "josueBloco";
falaN = "1";
nome = "josue";
acaoConversar = "1";
};
And i already tested its rotation in the onAdd method, and there the rotation still fine, it got reseted after the player is add in the game.
function PlayerData::onAdd(%block, %obj)
{
echo(%obj.rotation);
}
07/19/2007 (6:30 am)
Im spawning him in the mission file, and i already checked there and it has its rotation there.new AIPlayer(josue) {
canSaveDynamicFields = "1";
position = "23.8748 -412.23 0.170181";
rotation = "0 20 1 86";
scale = "1 1 1.07537";
dataBlock = "josueBloco";
falaN = "1";
nome = "josue";
acaoConversar = "1";
};
And i already tested its rotation in the onAdd method, and there the rotation still fine, it got reseted after the player is add in the game.
function PlayerData::onAdd(%block, %obj)
{
echo(%obj.rotation);
}
#3
07/23/2007 (6:15 am)
Same problem here
#4
I think it may help
08/02/2007 (4:53 am)
Pat WilsonQuote:
Because none of the persisted fields exposed in AiPlayer, PlayerData, or their inherited classes stores transform information.
I think it may help
#5
08/05/2007 (6:29 pm)
If you have your missions set up to exec after loading, which if I remember correctly, TGE 1.5 does stock, then it's simple, testplay once, open the console and use 'josue.getTransform();', write that down, and after OBJECT WRITE END in the mission file, add the line 'josue.setTransform(whatever you wrote down)' and it should override the mission editors placement and rotation.
#6
08/06/2007 (6:26 am)
Yeah, but i did different, i used a PathMarkers for each NPC, and at the beggining of the mission i loop throught it and set theirs position. It is good because sometimes i make they move and save. this way i know they will be always at the start point in the beginning of the mission.
Torque Owner Steve D