Game Development Community

Multible characters face the same direction.

by Emile Van Hes · in Torque Developer Network · 07/30/2007 (2:17 am) · 9 replies

I imported some characters. They work fine
but when I load my mission they all face the same direction.
I tried rotating them and saving after that.
But when I load my saved mission again, all charachters lost their rotation and are facing the same direction.

How is this possible?

#1
07/30/2007 (6:00 am)
We are seeing the same thing in our missions. I haven't investigated yet, but I suspect it has something to do with them sharing the same datablock.
#2
07/30/2007 (6:32 am)
It may be something to do with spawning the player. Try rotating the spawn marker to see if that changes the directon of the player as an experiment.
#3
07/30/2007 (6:50 am)
Do you use a single spawnsphere to make them all come in at defined locations, or does all have their own coordinates kinda like the below one ?

function spawnEveryone()
{
SpawnNPC("NpcNamed_01", "Name_01", "01.png", 1, "654 50 126.723 0 0 1 3.50487");
SpawnNPC("NpcNamed_02", "Name_02", "02.png", 1, "225 45 128.723 0 0 1 3.70237");
}

The last number is the actual orientation, and can be found by doing a dump of the actual object. Get ID of one of the NPC's and then write (in the console) echo(ID.getTransform());

Loads of this is discussed Here
#4
07/30/2007 (6:52 am)
Hi Jules,

It is not the player...
This is about AIPlayers in the mission.

But.. a "rotating the spawnsphere" is not a bad idea.

...
...

No, no effect.
#5
07/30/2007 (6:57 am)
Christian,

We used the mission editor to place the chars.

In the mission file there is i.e:


new AiPlayer(tourist) {
canSaveDynamicFields = "1";
position = "-113.768 -575.383 100.65";
rotation = "0 0 -1 92.8189";
scale = "1.1 1.1 1.1";
dataBlock = "touristShape";
receiveSunLight = "1";
useCustomAmbientLighting = "0";
customAmbientLighting = "0 0 0 1";
repeatFlag = "1";
onGroup = "1";
receiveLMLighting = "1";
customAmbientSelfIllumination = "0";
useAdaptiveSelfIllumination = "0";
};



When loading, the tourist rotation is reset to "1 0 0 0"
#6
07/30/2007 (7:50 am)
Sounds like you in Actor.cs, Aiactor.cs or datablock definitions are having something defined that overrules the attempts then.
#7
07/30/2007 (8:04 am)
Looked like Sherlock... But cannot find such code.
#8
07/30/2007 (8:10 am)
Looked like Sherlock... But cannot find such code.
#9
07/30/2007 (8:12 am)
Even when aplying the following code it doesn't work.

function tourist:onAdd(%this,%obj)
{
%obj.rotation = "0 0 1 171.438";
}


The rotations still resetting to "1 0 0 0"