SetCutsceneMode(object, int)
カットシーンのモードを設定します。
void SetCutsceneMode( object oCreature, int nInCutscene = TRUE );
Parameters
oCreature
カットシーンに巻き込むプレイヤーによって操作されているクリーチャー
nInCutscene
モードのトグルでTRUEならばカットシーンモードを有効にし、FALSEであれば無効にします。(デフォルト:TRUE)
Description
oInCutsceneが有効の時、カットシーンモードはプレイヤーの操作やGUIの使用、カメラの操作を使用不能にします。無効の時は、操作は回復します。
Remarks
もしFadeToBlack、FadeFromBlackおよびEffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY)と共に適切に使用されれば、SetCutsceneModeはムービーのようなカットシーンを扱うことが出来ます。
SetCutsceneModeがTRUEに設定されれば、PCのカメラの向きは自動的に保存され、FALSEに設定されれば、カメラの向きは自動的に回復されるように思います。これは、あなたがカメラ・モードや向きの全ての材料の種類をカットシーンで、それについて後で心配する必要なしに行うことができることを意味します。しかしながら、あなたがcutsceneの中でPCを動かせば、回復されたカメラの向きはもはやよい角度などではないかもしれません。この場合、PCがカットシーンから出たとき、SetCameraFacingを常に呼出すことが出来ます。
Version
1.30
Example
//Example of a simple cutscene by Lilac Soul
//If you have a script in OnCutsceneAbort, you can simply
//ClearAllActions on the PC to make the scene stop,
//then remove the invisibility visual effect and
//SetCutsceneMode to false, and destroy the copy.
void RunCutsceneActions();
void CreateCopy(object oPC = OBJECT_SELF);
void main()
{
object oPC=GetEnteringObject();
if (!GetIsPC(oPC)) return;
AssignCommand(oPC, RunCutsceneActions());
}
//Wrapped in its own function so that oPC can be
//OBJECT_SELF so there's no need for AssignCommand
//Making heavy use of ActionDoCommand to be able to control
//that one thing must finish before another starts
void RunCutsceneActions()
{
//Fade out the PC
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));
ActionWait(2.0);
ActionDoCommand(SetCutsceneMode(OBJECT_SELF, TRUE));
//Create a copy so we can move the invisible PC around
//and still have him think he's standing where he was
ActionDoCommand(CreateCopy());
//Make PC invisible
effect eInv=EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, OBJECT_SELF));
//Fade PC back in
ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));
//Here then, move the invisible PC around and do whatever
//It will look like the camera is just moving, and the
//player will have the impression of standing still because
//we created a copy of him
//If having others do stuff, like oNPC, you can do this trick
//To have the NPC action added to the PC's action queue
//REMEMBER: NO MORE THAN 75 ACTIONS IN AN ACTION QUEUE!
//ActionDoCommand(AssignCommand(oNPC, ActionSpeakString("Hello")));
//Eventually, we call
ActionDoCommand(FadeToBlack(OBJECT_SELF, FADE_SPEED_FAST));
ActionWait(2.0);
ActionDoCommand(SetCutsceneMode(OBJECT_SELF, FALSE));
//Destroy the copy
ActionDoCommand(DestroyObject(GetLocalObject(GetModule(), "pccopy")));
ActionDoCommand(RemoveEffect(OBJECT_SELF, eInv));
ActionDoCommand(FadeFromBlack(OBJECT_SELF, FADE_SPEED_FAST));
}
//Function for creating a copy of the PC
void CreateCopy(object oPC = OBJECT_SELF)
{
object oCopy=CopyObject(oPC, GetLocation(oPC));
//Make sure the copy likes the PC
SetIsTemporaryFriend(oPC, oCopy);
//Store so we can destroy later!
SetLocalObject(GetModule(), "pccopy", oCopy);
}
See Also
| functions: | FadeFromBlack | FadeToBlack | GetLastPCToCancelCutscene | RestoreCameraFacing | SetCameraFacing | SetCameraMode | StoreCameraFacing |
| categories: | Cut-Scene Functions | PC Only Functions |
| events: | OnCutsceneAbort Event |
author: Charles Feduke, editor: Lilac Soul, additional contributor(s): Lilac Soul, JP team: Rainie
Send comments on this topic.