Aller au contenu

Photo

placeable orientation being ignored


1 réponse à ce sujet

#1
Rolenka

Rolenka
  • Members
  • 2 257 messages
Vector is fine, but it's facing the wrong way. Orientation is defaulting to 0,0,0. I was giving it -40, but figured maybe it didn't accept a negative number, so I changed it to 320. Still no dice.

Any idea why? 

const string SF_X1_FORMS_TOME = "sf_x1_grantforms";
const resource SF_X1_FORMS_TOME_RESOURCE = R"sf_x1_grantforms.utp";

void main()
{
    object oMainControlled = GetMainControlled();
    object oTome = UT_GetNearestObjectByTag(oMainControlled, SF_X1_FORMS_TOME);

    if (!IsObjectValid(oTome))
    {
        location lSpawn = Location(GetArea(oMainControlled), Vector(134.601,56.4369,32.2178), 320.0);
        CreateObject(OBJECT_TYPE_PLACEABLE, SF_X1_FORMS_TOME_RESOURCE, lSpawn);
    }
}


Modifié par Rolenka, 03 juin 2010 - 03:31 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
I'm not certain, but I'm guessing CreateObject just ignores the orientation part of the location for placeables. I would try a SetFacing call after the object is created.



object oPLC = CreateObject(OBJECT_TYPE_PLACEABLE, SF_X1_FORMS_TOME_RESOURCE, lSpawn);

SetFacing(oPLC, 320.0);



You may have to place around with the fFacing paramater. I know there are some issues with what the value means and it doesn't always match the toolset or common sense, but you should be able to get it facing somewhere, and adjust from there.



I don't know if this is an option for you, but it might be easier to pre-place the placeable in the area, and set it to innactive. Then you can grab it by tag or by team and set it active when you want it to appear. So long as the location and orientation are fixed in advance, this is the simpler aproach.