// 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 .





Retour en haut






