Aller au contenu

Photo

Re-orienting the camera during an in-area transition


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
rjshae

rjshae
  • Members
  • 4 497 messages
I use the following script to correct for an issue with the camera facing during an in-area transition. Unfortunately it seems to have the deficiency of setting the camera height to the level of the PC's head. Does anybody know a good way to fix this?

// ww_orient_camera
/*
    This is a "On Click Script" for use with a door that has a
    transition to a waypoint in the same area. Normally, such a
    transition will leave the camera facing in the original
    direction, which may be an awkward view for the player. This
    script will check whether the transition target for the open
    door is a waypoint, then orient the camera in the direction
    the waypoint is facing. It will then transition the party to
    the target.
*/

int StartingConditional()
{
    object oPC = GetFirstPC();
    if ( GetIsOpen( OBJECT_SELF ) )
    {
        object oTarget = GetTransitionTarget( OBJECT_SELF );
        if ( GetIsObjectValid( oTarget ) )
        {
            // Check for a waypoint
            int nType = GetObjectType( oTarget );
            if ( nType == OBJECT_TYPE_WAYPOINT )
            {
                // Orient the PC camera to face the waypoint direction
                float fTarget = GetFacing( oTarget );
                AssignCommand( oPC, SetCameraFacing( fTarget ) );
            }
            
            // Perform the transition
            JumpPartyToArea( oPC, oTarget );
        }
    }
    
    return ( FALSE );
}

P.S. I've found that if you do include a script in a door's "On Click Script" slot, then the door's transition becomes disabled and the script has to take care of the jump for you.

Modifié par rjshae, 28 juin 2011 - 06:51 .


#2
rjshae

rjshae
  • Members
  • 4 497 messages
Nary a work-around, eh? Oh well.