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.

Constants

NameValueBrief Description
CUT_CAMERA_HEIGHT_HIGH5
CUT_CAMERA_HEIGHT_LOW3
CUT_CAMERA_HEIGHT_MEDIUM4
CUT_CAMERA_HEIGHT_VERY_HIGH6
CUT_CAMERA_HEIGHT_VERY_LOW2
CUT_DELAY_TYPE_CONSTANT1
CUT_DELAY_TYPE_CUMULATIVE0
RESTORE_TYPE_COPY2
RESTORE_TYPE_NONE0
RESTORE_TYPE_NORMAL1
VANISH2

Functions

NameBrief Description
CallActionAttackInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastFakeSpellAtLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastFakeSpellAtObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastSpellAtLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCastSpellAtObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionCloseDoorInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionEquipItemInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionForceFollowObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionForceMoveToLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionForceMoveToObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionLockObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveAwayFromLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveAwayFromObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveToLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionMoveToObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionOpenDoorInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionSitInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionStartConversationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionUnequipItemInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallActionUnlockObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallAdjustReputationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallApplyEffectAtLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallApplyEffectToObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallApplyEffectToObject2Internal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallBeginConversationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallBlackScreenInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallClearAllActionsInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallCreateObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallCreateObjectCopyInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallDeathInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallDestroyObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallDestroyPCCopyInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallFadeFromBlackInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallFadeOutAndInInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallFadeToBlackInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallJumpAssociateToLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallJumpToLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallJumpToObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallKnockdownInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallPlayAnimationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallPlaySoundInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallPlayVoiceChatInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRemoveAssociatesEffectsInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRemoveEffectsInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestoreCameraFacingInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestoreLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestoreMusicInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallRestorePCCopyLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetAmbientInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetCameraInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetCameraSpeedInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetCutsceneModeInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetFacingPointInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetLocationInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetMusicInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetPlotFlagInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetTileMainColorInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetTileSourceColorInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSetWeatherInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSpeakStringInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallSpeakStringByStrRefInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallStopFadeInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallStoreCameraFacingInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CallStoreMusicInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutActionAttackCauses one object to attack another object.
CutActionCastFakeSpellAtLocationUsed to cast a fake spell at a location.
CutActionCastFakeSpellAtObjectUsed to cast a fake spell at an object.
CutActionCastSpellAtLocationUsed to cast a spell at a location.
CutActionCastSpellAtObjectUsed to cast a spell at an object.
CutActionCloseDoorUsed to have an object to close a door.
CutActionEquipItemUsed to have an object equip an item.
CutActionForceFollowObjectUsed to have one object follow another object.
CutActionForceMoveToLocationUsed to force move the PC or NPC to a location.
CutActionForceMoveToObjectUsed to force move the PC or NPC to an object.
CutActionLockObjectUsed to have an object attempt to lock a door or placeable.
CutActionMoveAwayFromLocationUsed to have an object move away from a location.
CutActionMoveAwayFromObjectUsed to have an object move away from another object.
CutActionMoveToLocationUsed to have an object move to a location.
CutActionMoveToObjectUsed to have an object move to another object.
CutActionOpenDoorUsed to have an object to open a door.
CutActionSitUsed to have an object sit in a chair object.
CutActionStartConversationUsed 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.
CutActionUnequipItemUsed to have an object unequip an item.
CutActionUnLockObjectUsed to have an object attempt to unlock a door or placeable.
CutAdjustReputationThis adjusts Faction Reputation, how the entire faction that oSourceFactionMember is in, feels about oTarget.
CutApplyEffectAtLocationUsed to apply a visual effect at a location.
CutApplyEffectToObjectUsed to apply a visual effect to an object.

If you want to apply non-visual effect use CutApplyEffectToObject2
CutApplyEffectToObject2Applies eEffect to Object.
CutBeginConversationUse this instead of CutActionStartConversation() to start a dialog without one object running to the other.
CutBlackScreenUsed 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.
CutCalculateCurrentDelayInternal function. Calculates the "real" delay to execute a cut* action (can be a cumulative delay or a constant one).
CutClearAllActionsUsed to clear the actions of the subject.
CutCreateObjectWould 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.
CutCreateObjectCopyCreates a copy of oPC at lLoc with tag sTag. Older copies of oPC would be destroyed if any.
CutCreatePCCopyCreates a copy of oPC at lLoc with tag sTag. Older copies of oPC would be destroyed if any.
CutDeathUsed to apply a death effect to an object.
CutDestroyObjectUsed to destroy objects. Make sure they are destroyable first with the CutSetPlotFlag function.
CutDestroyPCCopyDestroys the copy of oPC and restores the PC's original location if bRestorePCLocation is TRUE.
CutDisableAbortDisables the possibility to disable nCutscene.

Pressing ESC would do nothing after calling this function.
CutDisableCutsceneDisables 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).
CutFadeFromBlackUsed to fade-in.
CutFadeOutAndInCombines fade-out and fade-in into one function.
CutFadeToBlackUsed to fade-out.
CutGetAbortDelayRetrieves the current abort delay for nCutscene after aborting.
CutGetActiveCutsceneForObjectInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutGetConvDurationGet 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.
CutGetDestroyCopyDelayRetrieves the current destroy PC delay after aborting a cutscene.
CutGetIsAbortDisabledReturns TRUE if it is not possible to abort nCutscene, FALSE otherwise.
CutGetIsMainPCInternal function. Returns TRUE whether the pc is the main pc for his current cutscene, FALSE otherwise.
CutJumpAssociateToLocationJumps all associates of oPC to lLoc.
CutJumpToLocationUsed to jump the PC to a location.
CutJumpToObjectUsed to jump the PC or NPC to an object.
CutKnockdownUsed to apply a knockdown effect to an object.
CutPlayAnimationUsed if you need a cutscene participant to do an animation.
CutPlaySoundUsed to have an object play a sound.
CutPlayVoiceChatPlays voice chat nChatID for oObject.
CutRemoveEffectsUsed 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.
CutRemoveHenchmenAssociatesInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutResetActiveObjectsForCutsceneInternal 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.
CutRestoreCameraFacingRestored camera facing that has been stored by CutStoreCameraFacing.
CutRestoreLocationRestores the location that had been stored by CutSetLocation.
CutRestoreMusicRestores the music track for the area where oPC is which was stores by CutStoreMusic.
CutRestorePCAppearanceInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
CutSetAbortDelaySets 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.
CutSetActiveCutsceneSet 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.
CutSetActiveCutsceneForObjectUse 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.
CutSetAmbientSets the track nTrack as the music for the current area of oPC and plays it.
CutSetCameraUsed to set the camera for cutscene dramatics.
CutSetCameraSpeedSets the current movement rate factor of the cutscene camera-man.
CutSetCutsceneModeUsed to turn cutscene mode on or off.
CutSetDestroyCopyDelaySets 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.
CutSetFacingPointUsed to set the facing of a creature.
CutSetLocationStores the current location of oPC to be restored later with CutRestoreLocation.
CutSetMusicSets the track nTrack as the music for the current area of oPC and plays it.
CutSetPlotFlagUsed to turn plot flags on or off.
CutSetTileMainColorSets the main tile color for the tile at lLoc.
CutSetTileSourceColorSets the source tile color for the tile at lLoc.
CutSetWeatherUsed to set the weather.
CutSpeakStringUsed for bubble text type speaking.
CutSpeakStringByStrRefUsed to speak a string and play a sound.
CutStopFadeUsed to remove the screen to black.
CutStoreCameraFacingStores camera facing for oPC to be restored by CutRestoreCameraFacing.
CutStoreMusicStores the current music track for the area where oPC is.

Use CutRestoreMusic to reset the music for the area.
FreezeAssociateInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
GetActiveCutsceneNumReturns current global cutscene number.
GetShift
RemoveAssociateEffectsInternal function. Used to implement the same function with the "Cut" prefix in place of the "Call" prefix.
RemoveCommandableUsed to clear commandable state FALSE in the event there are too many.

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

See Also

categories:  Cut-Scene Functions
includes:  x1_inc_cutscene
tutorial:  Cut-scene Tutorials

  author: Mistress, contributor: Kookoo