Skip to content

FadeToBlack()/FadeFromBlack()

ZephiriusZephirius Member Posts: 411
edited November 2021 in Builders - Scripting
I'm trying my hand at a limited cutscene starting out with FadeFromBlack(). I'm uncertain how you have those dramatic fades in and out - lengthy ones at that. I've got it on the slowest setting but the fade hppens fast no matter what.
if ((GetLevelByClass(CLASS_TYPE_DRUID, oPC)>0))
        if (GetIsSkillSuccessful(oPC, SKILL_ANIMAL_EMPATHY, 16))
        {
           effect eParalyze = EffectCutsceneParalyze();
           ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oPC, 15.0f);

           AssignCommand(oPC, ClearAllActions());

           ActionDoCommand(FadeFromBlack(oPC, FADE_SPEED_SLOWEST));
           //Do cutscene stuff here...
       }
}

Thanks in advance for any help.

Comments

  • ZephiriusZephirius Member Posts: 411
    edited November 2021
    Okay. I think I'm getting somewhere. Different script, different scenario. But the desired effect of opening the scene with a timed fade is working now. :)
    #include "x3_inc_string"
    void main()
    {
       int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF)); // Set it so that the script only fires once
       if (DoOnce==TRUE)
          {
             return;
    
          }
          SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE); // End DoOnce check
    
       object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF);
    
       effect eParalyze = EffectParalyze();
       DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eParalyze, oPC, 8.5));
    
       BlackScreen(oPC);
       DelayCommand(3.0, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));
    
       oPC = GetEnteringObject();
       if (!GetIsPC(oPC)) return;
    
       AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 7.0));
       SetCommandable(TRUE, oPC);
    
       string sSound = "gui_learnspell";
       DelayCommand(9.0, AssignCommand(oPC, PlaySound(sSound)));
       string sWarning = StringToRGBString
       ("You find yourself washed ashore a desert insland with no memory of how you got there...", "770");
       DelayCommand(9.0, FloatingTextStringOnCreature(sWarning, oPC));
    }
    
    
    

    It's just an opening "scene" depicting a castaway "washed" up on shore...
    Suggestions?
    Post edited by Zephirius on
  • ZephiriusZephirius Member Posts: 411
    I was wondering if someone with the knowledge of camera scripting, could explain how to slowly zoom in on the PC while simultaneously circling it in a cutscene style...

    I'm racking my brain (what's left of it) on how to do this?
    Any help to nudge me in the right direction would be greatly appreciated.
  • TerrorbleTerrorble Member Posts: 169
    I haven't tried anything with the camera as of yet. I would start with SetCameraFacing() to set the initial viewing direction, distance and angle, then use SetCameraFacing() again with a different fDirection and lower fDistance with CAMERA_TRANSITION_TYPE_MEDIUM or SLOW and see if it works.

  • ProlericProleric Member Posts: 1,281
    edited November 2021
    @Zephirius I use the Gestalt cutscene scripts from Neverwinter Vault, which include a ready made function that does exactly that.

    Saves countless hours of debugging for this and many other cutscene actions, so the learning curve is highly worthwhile.
  • ZephiriusZephirius Member Posts: 411
    Yeah, thanks Proleric. I've been looking into that system. Time to read up! Like you said - It's worthwhile.
Sign In or Register to comment.