x1_inc_cutscene

Library file for cutscene functions.

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.

The integer nCutscene is now passed in to all cutscene functions. This is so that if a player skips one cutscene and then very soon after enters another cutscene, we need to be able to check which cutscene a delayed function belongs to. If it is not the cutscene that the PC is currently in - the delayed actions that affect the PC should NOT take place.

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

Functions

NameBrief Description
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.
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.
CallActionStartConversationInternal 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.
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.
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.
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.
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.
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.
CallSetCameraInternal 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.
CallSetPlotFlagInternal 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.
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.
CutActionCastFakeSpellAtLocationUsed to cast a fake spell at a location.

Example: CutActionCastFakeSpellAtLocation(23.0, oPC, SPELL_SUNBEAM, lLoc, PROJECTILE_PATH_TYPE_DEFAULT); would have the PC cast a sunbeam at lLoc, with a default projectile path. This would happen after a 23 second delay.
CutActionCastFakeSpellAtObjectUsed to cast a fake spell at an object.

Example: CutActionCastFakeSpellAtObject(23.0, oPC, SPELL_SUNBEAM, oTarget, PROJECTILE_PATH_TYPE_DEFAULT); would have the PC cast a sunbeam at the oTarget, with a default projectile path. This would happen after a 23 second delay.
CutActionMoveToLocationUsed to move the PC or NPC to a location.

Example: CutActionMoveToLocation(2.0, oPC, lTable, FALSE); would have the PC walk to lTable after a 2 second delay. TRUE = run, FALSE = walk.
CutActionMoveToObjectUsed to move the PC or NPC to an object.

Example: CutActionMoveToObject(2.0, oPC, oTable, TRUE); would have the PC run to oTable after a 2 second delay. TRUE = run, FALSE = walk.
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.
CutApplyEffectAtLocationUsed to apply a visual effect at a location. The PC is passed to determine if the cutscene has been aborted or not.

Example: CutApplyEffectAtLocation(98.3, oPC, DURATION_TYPE_INSTANT, VXF_FNF_HOLY_STRIKE, lLoc, 0.0); would have a holy strike visual appear at lLoc after a 98.3 second delay.

The duration is instant, lasting the default time.
CutApplyEffectToObjectUsed to apply a visual effect to an object.

Example: CutApplyEffectToObject(98.3, oPC, DURATION_TYPE_TEMPORARY, VXF_DUR_PETRIFY, oPC, 4.0); would have a PETRIFY visual appear to the PC after a 98.3 second delay.

The duration is temporary, lasting 4 seconds.
CutApplyEffectToObject2For all other effects (NOT VISUAL EFFECTS).

Used to apply a NON visual effect to an object.
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.

Example: CutBlackScreen(10.0, oPC); would set the screen to black at the 10.0 mark.
CutClearAllActionsUsed to clear the actions of the subject.

Example: CutClearAllActions(3.2, GetObjectByTag("guard")); would clear the actions of "guard" after a 3.2 second delay.
CutCreateObjectUsed to delay object create. Pass the type, the sTemplate, the location, and the effect you wish to have appear when the object is created (0 for no effect). The PC is also passed to check cutscene abort.

Example: CutCreateObject(2.3, oPC, OBJECT_TYPE_PLACEABLE, "resref", lLoc, VFX_FNF_HOLY_STRIKE); would create a placeable with the resref of "resref" at the location lLoc after 2.3 seconds, with the VFX_FNF_HOLY_STRIKE effect.
CutDeathUsed to apply a death effect to an object.

Example: CutDeath(98.3, oPC, TRUE); would have a death appear on the PC after a 98.3 second delay.

The duration is always instant. TRUE is used if you want a spectacular death. Set FALSE otherwise.
CutDestroyObjectUsed to destroy objects. Make sure they are destroyable first with the CutSetPlotFlag function.

Example: CutDestroyObject(10.0, oObject); would destroy the object after 10 seconds.
CutFadeFromBlackUsed to fade in.

Example: CallFadeFromBlack(35.0, oPC); would Fade the screen in on the PC, after a delay of 35 seconds.
CutFadeToBlackUsed to fade out.

Example: CallFadeToBlack(35.0, oPC); would Fade the screen out on the PC, after a delay of 35 seconds
CutFadeOutAndInUsed to fade out and back in, with a black screen section of 2 seconds in between.

Example: CallFadeOutAndIn(35.0, oPC); would Fade the screen out and back in on the PC, after a delay of 35 seconds.
CutJumpToLocationUsed to jump the PC or NPC to an object.

Example: CutJumpToObject(20.0, oPC, GetObject(GetObjectByTag ("invis_object")); would jump the PC to the invis_object after a 20 second delay.
CutJumpToObjectUsed to jump the PC or NPC to an object.

Example: CutJumpToObject(20.0, oPC, GetObject(GetObjectByTag "invis_object")); would jump the PC to the invis_object after a 20 second delay.
CutKnockdownUsed to apply a knockdown effect to an object.

Example: CutKnockdown(98.3, oPC, 4.0); would have a knockdown appear on the PC after a 98.3 second delay.

The duration is always temporary, this one lasting 4 seconds.
CutPlayAnimationUsed if you need a cutscene participant to do an animation.

Example: CutPlayAnimation(, 26.0, oPC, ANIMATION_FIREFORGET_BOW, 3.0); would have the PC bow for 3 seconds after a 26 second delay.
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.
CutRestoreCameraFacingUsed to restore the camera position.

Example: CutRestoreCameraFacing(10.0, oPC); would set the old camera settings back at the 10.0 mark.
CutRestoreLocationUsed to recall the PC's location so they can be jumped back to their original location, stored by CutGetLocation.

Example: CutRestoreLocation(23.0, oPC); would return the PC to their original spot. This would happen after a 23 second delay.
CutSetCameraUsed to set the camera for cutscene dramatics.

Example: To set a camera with the following settings on the PC, after a 30.0 second delay:
    CAMERA_MODE_TOP_DOWN
    Facing = 170.0
    Zoom = 5.0
    Pitch = 50.0
    CAMERA_TRANSITION_TYPE_MEDIUM

CutSetCamera(30.0, oPC, CAMERA_MODE_TOP_DOWN, 170.0, 5.0, 50.0, CAMERA_TRANSITION_TYPE_MEDIUM);
CutSetCutsceneModeUsed to turn cutscene mode on or off.

Example: CutSetCutsceneMode(10.0, oPC, TRUE); would turn cutscene mode on after 10 seconds for the PC.
CutSetFacingPointUsed to set the facing of a creature.

Example: CutSetFacingPoint(22.5, oPC, "creature_tag"); would have the PC face "creature_tag" object after a 22.5 second delay.
CutSetLocationUsed to set the PC's location so they can be jumped around as though they are the camera.

Example: CutSetLocation(23.0, oPC); would set the location on the PC, as a variable, as a location to be returned to later. This would happen after a 23 second delay.
CutSetPlotFlagUsed to turn plot flags on or off.

Example: CutSetPlotFlag(10.0, oObject, 1); would turn plot flag to on after 10 seconds for the object.
CutSpeakStringUsed for bubble text type speaking.

Example: CutSpeakString(0.0, GetObjectByTag("drow_priest"), "I like green eggs and ham."); would have the object drow_priest speak the line "I like green eggs and ham." after no delay.
CutStopFadeUsed to remove the screen to black.

Example: CutStopFade(10.0, oPC); would set the screen back from black at the 10.0 mark.
CutStoreCameraFacingUsed to store the camera position.

Example: CutStoreCameraFacing(10.0, oPC); would set the current camera settings at the 10.0 mark.
GetShiftUsed to shift the entire cutscene a length of time.

Used internally here, but very handy for cutscenes that are complete, but need to be changed after the fact.

From the point it is called, it just shifts the cutscene accordingly.

Can be used (and should be) for non-cutscene delays in a script (ie - commands that aren't here or regular DelayCommands in a script.)
RemoveCommandableUsed to clear commandable state FALSE in the event there are too many.

Used in this include only.

See Also

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

  author: Mistress, contributor: Kookoo