X2 inc cutscene

From NWN Lexicon



Contents

[edit] x2_inc_cutscene

Library file for doing cutscenes.

Each function will be in a wrapper function that will check to see if the cutscene has been aborted yet or not.

There is an added variable called iShift. This can be ignored in all cases, except when the GetShift function is being called. It was added so that when a shift is done, you can insert stuff (the reason for the shift) into your script without the new stuff being shifted.

An example of this: You decide you need to add 20 seconds of material in the middle of your cutscene. You need to do this at the 1 minute mark, and you want to shift everything after that point by 20 secs. The new stuff you add there for that 20 secs will get shifted as well since you called the shift. But by adding FALSE at the end of the function call, it will ignore the shift amount.

Also, if anything after the shift is something that you don't want adjusted from the default, use this there as well.

NOTE: Builders should use the "Cut" functions, not the "Call" functions.

[edit] Constants

Name Value Brief Description
CUT_CAMERA_HEIGHT_HIGH 5
CUT_CAMERA_HEIGHT_LOW 3
CUT_CAMERA_HEIGHT_MEDIUM 4
CUT_CAMERA_HEIGHT_VERY_HIGH 6
CUT_CAMERA_HEIGHT_VERY_LOW 2
CUT_DELAY_TYPE_CONSTANT 1
CUT_DELAY_TYPE_CUMULATIVE 0
RESTORE_TYPE_COPY 2
RESTORE_TYPE_NONE 0
RESTORE_TYPE_NORMAL 1
VANISH 2


[edit] Functions

Name Brief Description
CallActionAttack Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastFakeSpellAtLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastFakeSpellAtObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastSpellAtLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastSpellAtObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCloseDoor Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionEquipItem Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionForceFollowObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionForceMoveToLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionForceMoveToObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionLockObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveAwayFromLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveAwayFromObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveToLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveToObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionOpenDoor Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionSit Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionStartConversation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionUnequipItem Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionUnlockObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallAdjustReputation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallApplyEffectAtLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallApplyEffectToObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallApplyEffectToObject2 Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallBeginConversation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallBlackScreen Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallClearAllActions Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallCreateObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallCreateObjectCopy Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallDeath Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallDestroyObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallDestroyPCCopy Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallFadeFromBlack Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallFadeOutAndIn Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallFadeToBlack Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallJumpAssociateToLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallJumpToLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallJumpToObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallKnockdown Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallPlayAnimation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallPlaySound Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallPlayVoiceChat Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRemoveAssociatesEffects Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRemoveEffects Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestoreCameraFacing Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestoreLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestoreMusic Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestorePCCopyLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetAmbient Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetCamera Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetCameraSpeed Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetCutsceneMode Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetFacingPoint Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetLocation Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetMusic Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetPlotFlag Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetTileMainColor Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetTileSourceColor Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetWeather Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSpeakString Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSpeakStringByStrRef Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallStopFade Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallStoreCameraFacing Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallStoreMusic Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutActionAttack Causes one object to attack another object.
CutActionCastFakeSpellAtLocation Used to cast a fake spell at a location.
CutActionCastFakeSpellAtObject Used to cast a fake spell at an object.
CutActionCastSpellAtLocation Used to cast a spell at a location.
CutActionCastSpellAtObject Used to cast a spell at an object.
CutActionCloseDoor Used to have an object to close a door.
CutActionEquipItem Used to have an object equip an item.
CutActionForceFollowObject Used to have one object follow another object.
CutActionForceMoveToLocation Used to force move the PC or NPC to a location.
CutActionForceMoveToObject Used to force move the PC or NPC to an object.
CutActionLockObject Used to have an object attempt to lock a door or placeable.
CutActionMoveAwayFromLocation Used to have an object move away from a location.
CutActionMoveAwayFromObject Used to have an object move away from another object.
CutActionMoveToLocation Used to have an object move to a location.
CutActionMoveToObject Used to have an object move to another object.
CutActionOpenDoor Used to have an object to open a door.
CutActionSit Used to have an object sit in a chair object.
CutActionStartConversation Used for a conversation file when you need to have an NPC speak via a conversation instead of bubble text.

The fDelay is used when timing is important.

Example: CutActionStartConversation(5.0, oNPC, oPC, "my_conv"); would start the conversation file "my_conv" of the NPC, after a 5 sec delay, and the conversation subject would be the PC.
CutActionUnequipItem Used to have an object unequip an item.
CutActionUnLockObject Used to have an object attempt to unlock a door or placeable.
CutAdjustReputation This adjusts Faction Reputation, how the entire faction that oSourceFactionMember is in, feels about oTarget.
CutApplyEffectAtLocation Used to apply a visual effect at a location.
CutApplyEffectToObject Used to apply a visual effect to an object.

If you want to apply non-visual effect use CutApplyEffectToObject2
CutApplyEffectToObject2 Applies eEffect to Object.
CutBeginConversation Use this instead of CutActionStartConversation() to start a dialog without one object running to the other.
CutBlackScreen Used to set the screen to black. This is very useful in covering up and cutscene jumps that happen in the same area as the play area.
CutCalculateCurrentDelay Internal function. Calculates the "real" delay to execute a cut* action (can be a cumulative delay or a constant one).
CutClearAllActions Used to clear the actions of the subject.
CutCreateObject Would create an object after the delay.

Avoid using this function as it is currently impossible to cancel action of objects created by it after aborting the cutscene.
CutCreateObjectCopy Creates a copy of oPC at lLoc with tag sTag. Older copies of oPC would be destroyed if any.
CutCreatePCCopy Creates a copy of oPC at lLoc with tag sTag. Older copies of oPC would be destroyed if any.
CutDeath Used to apply a death effect to an object.
CutDestroyObject Used to destroy objects. Make sure they are destroyable first with the CutSetPlotFlag function.
CutDestroyPCCopy Destroys the copy of oPC and restores the PC's original location if bRestorePCLocation is TRUE.
CutDisableAbort Disables the possibility to disable nCutscene.

Pressing ESC would do nothing after calling this function.
CutDisableCutscene Disables a cutscene.

All generic disable functions would be called after a delay of fCleanupDelay, and any PC copy object would be destroyed after a delay of fDestPCCopyDelay).

If using the CUT_DELAY_TYPE_CUMULATIVE delay type, then each delay should be in relation to the previous delay (independent delays).
CutFadeFromBlack Used to fade-in.
CutFadeOutAndIn Combines fade-out and fade-in into one function.
CutFadeToBlack Used to fade-out.
CutGetAbortDelay Retrieves the current abort delay for nCutscene after aborting.
CutGetActiveCutsceneForObject Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutGetConvDuration Get the duration of dialog sConvName from a 2da.

A value of 0.0 is returned on error.

The value in the 2da should be set when first knowing the english length of the dialog.
CutGetDestroyCopyDelay Retrieves the current destroy PC delay after aborting a cutscene.
CutGetIsAbortDisabled Returns TRUE if it is not possible to abort nCutscene, FALSE otherwise.
CutGetIsMainPC Internal function. Returns TRUE whether the pc is the main pc for his current cutscene, FALSE otherwise.
CutJumpAssociateToLocation Jumps all associates of oPC to lLoc.
CutJumpToLocation Used to jump the PC to a location.
CutJumpToObject Used to jump the PC or NPC to an object.
CutKnockdown Used to apply a knockdown effect to an object.
CutPlayAnimation Used if you need a cutscene participant to do an animation.
CutPlaySound Used to have an object play a sound.
CutPlayVoiceChat Plays voice chat nChatID for oObject.
CutRemoveEffects Used to remove all effects from an object.

Example: CutRemoveEffects(10.5, GetObjectByTag("guard1")) would remove all effects from guard1 after a 10.5 second delay.

Notice that only effects created for the cutscene would be removed.
CutRemoveHenchmenAssociates Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutResetActiveObjectsForCutscene Internal function. Used internally by the generic abort script.

It finds all active objects for this cutscene and resets them so they won't execute any more actions.
CutRestoreCameraFacing Restored camera facing that has been stored by CutStoreCameraFacing.
CutRestoreLocation Restores the location that had been stored by CutSetLocation.
CutRestoreMusic Restores the music track for the area where oPC is which was stores by CutStoreMusic.
CutRestorePCAppearance Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutSetAbortDelay Sets the delay between pressing the ESC key to actually doing the cutscene cleanup.

This function should be used at the beginning of a cutscene only if such delay is required.

Otherwise, there would be no cleanup delay.
CutSetActiveCutscene Set the current active cutscene.

Any following delayed Cut* functions would run only if the initiating object has the same cutscene number as the global active one.

A value of -1 means that no cutscene is active (possible values for bDelayType: CUT_DELAY_TYPE_CUMULATIVE, CUT_DELAY_TYPE_CONSTANT.

bSetCutsceneObject should be set to FALSE whenever calling this function more than once for the same cutscene but in another file. This would keep the original cutscene object that created all the cutscene effect so it would be possible to remove them when the cutscene ends.
CutSetActiveCutsceneForObject Use this function at the begining of a cutscene for each object involved in the cutscene.

Notice that this function would fail if oObject already has another cutscene value (any number greater than 0).

The function returns 0 on success, -1 otherwise.
CutSetAmbient Sets the track nTrack as the music for the current area of oPC and plays it.
CutSetCamera Used to set the camera for cutscene dramatics.
CutSetCameraSpeed Sets the current movement rate factor of the cutscene camera-man.
CutSetCutsceneMode Used to turn cutscene mode on or off.
CutSetDestroyCopyDelay Sets the delay between pressing the ESC key to actually destroying the PC copy.

This function should be used at the beginning of a cutscene only if such delay is required.

Otherwise, there would be no delay.
CutSetFacingPoint Used to set the facing of a creature.
CutSetLocation Stores the current location of oPC to be restored later with CutRestoreLocation.
CutSetMusic Sets the track nTrack as the music for the current area of oPC and plays it.
CutSetPlotFlag Used to turn plot flags on or off.
CutSetTileMainColor Sets the main tile color for the tile at lLoc.
CutSetTileSourceColor Sets the source tile color for the tile at lLoc.
CutSetWeather Used to set the weather.
CutSpeakString Used for bubble text type speaking.
CutSpeakStringByStrRef Used to speak a string and play a sound.
CutStopFade Used to remove the screen to black.
CutStoreCameraFacing Stores camera facing for oPC to be restored by CutRestoreCameraFacing.
CutStoreMusic Stores the current music track for the area where oPC is.

Use CutRestoreMusic to reset the music for the area.
FreezeAssociate Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
GetActiveCutsceneNum Returns current global cutscene number.
GetShift
RemoveAssociateEffects Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
RemoveCommandable Used to clear commandable state FALSE in the event there are too many.

Used in this include only.
UnFreezeAssociate Used to remove cut-scene specific effects from all of the PC's associates.
Talk Internal function. Wrapper for BeginConversation.


[edit] See Also

includes: 

x1_inc_cutscene

tutorial: 

  author: Mistress, contributor: Kookoo

Personal tools
Categories