AttachCamera(object, object, int)

From NWN Lexicon
Jump to navigationJump to search
Nwnee logo.jpg Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Sets the object oPlayer's camera will be attached to.

void AttachCamera(
    object oPlayer,
    object oTarget,
    int bFindClearView = FALSE
);


Parameters

oPlayer
The player for whom the camera behavior will be updated.
oTarget
A valid creature or placeable. If oTarget is OBJECT_INVALID, it will revert the camera back to oPlayer's character.
bFindClearView
if TRUE, the client will attempt to find a camera position where oTarget is in view.


Description

Sets the object oPlayer's camera will be attached to.

The target must be known to oPlayer's client, this means it must be in the same area and within visible distance.

  • SetObjectVisibleDistance() can be used to increase this range.
  • If the target is a creature, it also must be within the perception range of oPlayer and perceived.

Notes:

  • If oTarget gets destroyed while oPlayer's camera is attached to it, the camera will revert back to oPlayer's character.
  • If oPlayer goes through a transition with its camera attached to a different object, it will revert back to oPlayer's character.
  • The object the player's camera is attached to is not saved when saving the game.


Remarks

Information icon.png This section of the article is a stub. You can help the NWN Lexicon by expanding it.


Version

This function was added in 1.86.8193.35 of NWN:EE.


Example

Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.


See Also

functions:

SetCameraLimits()


 author: Shadguy