Skip to content

SetCameraFacing() Question

I can't get oPC to face east...???
void main()
{

 object oPC = GetPCSpeaker();
 if (!GetIsPC(oPC)) return;

 AssignCommand(oPC, ClearAllActions());

 location lLoc = GetLocation(GetWaypointByTag("SIT_DOWN"));
 AssignCommand(oPC, ActionMoveToLocation(lLoc, FALSE));
 AssignCommand(oPC, SetCameraFacing(0.0, 5.0, 10.0, CAMERA_TRANSITION_TYPE_SNAP));
 AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 10.0));

}

I checked the lexicon and didn't glean anything useful.
Everything works except SetFacing. What am I doing wrong?

Comments

  • ZephiriusZephirius Member Posts: 419
    edited February 2022
    Cry havoc! I think I have it!
    AssignCommand(oPC, SetCameraFacing(0.0, 5.0, 10.0, CAMERA_TRANSITION_TYPE_SNAP));
     DelayCommand(1.0, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 10.0)));
    

    Guess I just needed time for the animation to clear. ;)
  • ZephiriusZephirius Member Posts: 419
    Cry darn it! I don't have it. It worked once (are there freakish coincidences in coding). Oh well.
    As it is, the PC moves to lLoc, but doesn't face east after that. It's only when you disengage from conversation does SetFacing work?
  • ProlericProleric Member Posts: 1,316
    If you wrap SetCameraFacing inside ActionDoCommand, it's executed when the ActionMove completes.

    You may need to disable Dialogue Zoom, too, as it tends to resist scripted camera work, especially at end of conversation.


  • ZephiriusZephirius Member Posts: 419
    Thanks P.
  • ZephiriusZephirius Member Posts: 419
    edited February 2022
    I don't suppose anyone knows where to disable dialog zoom feature or command can be located? I looked in the conversation editor, on the character and the script editor. Can't find anything. I could swear I've seen it before. Have I overlooked something?

    It was in the conversation editor under "current file." Not even remotely close to where I remember it being. Ha!
    Post edited by Zephirius on
  • ZephiriusZephirius Member Posts: 419
    edited February 2022
    I've tried my hardest and am banging my head against the wall trying to figure this out. It still won't SetFace before sitting...

    This is my messed-up block now...
    void main()
    {
     object oPC = GetPCSpeaker();
     if (!GetIsPC(oPC)) return;
    
     AssignCommand(oPC, ClearAllActions());
     object oPywicket = GetObjectByTag("PYWICKET");
    
     location lLoc = GetLocation(GetWaypointByTag("SIT_DOWN"));
     location lLoc2 = GetLocation(GetWaypointByTag("WICKET_LOC"));
     location lLoc3 = GetLocation(GetWaypointByTag("GUST_LOC"));
    
     AssignCommand(oPC, ActionMoveToLocation(lLoc, FALSE));
     DelayCommand(2.0, ActionDoCommand(SetCameraFacing(60.0, 3.0, 20.0, CAMERA_TRANSITION_TYPE_SNAP)));
     DelayCommand(2.5, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1000.0))); // Will remove 
     // the effect before timer runs out
    
     effect eGust = EffectVisualEffect(VFX_IMP_PULSE_WIND);
     ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eGust, lLoc3);
     effect eDisApp = EffectDisappearAppear(GetLocation(oPC), 1);
     PlayVoiceChat(VOICE_CHAT_ENEMIES, oPywicket);
     ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDisApp, oPywicket, 7.0);
    }
    
    Yeah
  • DazDaz Member Posts: 127
    Do you want the character of the player to face east or the camera of the player's client?
  • ZephiriusZephirius Member Posts: 419
    The character of the player Daz.
  • ProlericProleric Member Posts: 1,316
    Then SetFacing rather than SetCameraFacing, wrapped in ActionDoCommand not delayed.
Sign In or Register to comment.