Aller au contenu

Photo

Scripting Fade In/Fade Out


  • Veuillez vous connecter pour répondre
10 réponses à ce sujet

#1
Challseus

Challseus
  • Members
  • 1 032 messages
All.

So, in NWN1 and NWN2, we have a method to handle the fading in/out of the screen. So far, I haven't come across such a method. However, by look at another thread about script camera visual effects, I learned that I could manipulate da_HSVMatrix. Once I enable it in my custom level, I can call this to make the screen go black:

FB_SetEffectResource("da_HSVMatrix", "Brightness", 0.0);

Now, I can certainly script it in a way where it progressively fades in or out, by manipulating that "Brightness" option by making successive calls to DelayEvent (which I assume would be processor intensive as it is). I'd rather not re-do existing work, so I was wondering if there was some library handling this, that I missed. Or, perhaps I'm going about it the wrong way? I mean, I guess I could just create a cutscene for the particular event, I was just hoping there was a scripting solution to it.

Thanks in advance for any input.

#2
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
I'll confess I've just been using the cutscene method. Typically when I'm doing a fade in/out it's part of a cutscene (or even better, a conversation), so it's a relatively easy win just do to it that way. As part of a dialogue is of course the easiest because then you can just "convert line to cutscene" and put your fade in/out as part of that line. Unfortunately I haven't seen a method via scripting to achieve the same effect.

#3
Challseus

Challseus
  • Members
  • 1 032 messages

AmstradHero wrote...

... As part of a dialogue is of course the easiest because then you can just "convert line to cutscene" and put your fade in/out as part of that line...


Wait, what? I actually need this fade out during a dialogue. Where is this magical option you speak of?! It's probably because it's 1:44 AM, and I've been developing for too many hours to count, but I cannot seem to find it Image IPB

#4
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Select the line in question in the dialogue editor, then go to the edit menu and select Convert Line to Cutscene (keyboard shortcut Ctrl-Alt-C). It's about halfway down the menu. You may need to have the dialogue using a stage, but I'm not sure. But then again, why wouldn't you be using a stage? :-) Stages are awesome.

#5
FergusM

FergusM
  • Members
  • 460 messages
Going the other way, you can also create a cutscene, throw a 'speak line' event on there, then go to the line in the dialogue editor and select 'Associate Cutscene with line.'



Both methods will make the cutscene play when the appropriate line is reached.



And, yep, I do believe you need a stage.

#6
Challseus

Challseus
  • Members
  • 1 032 messages
Thanks for the pointers, I had no idea that aspect of the toolset even existed! So yeah, I'm definitely using a stage, and after some fiddling around with the camera (and erasing some default settings), I was able to get what I want.... somewhat...

It would be nice if I could delay how long it takes to get to the next node after the fade out, so I can simulate it happening for a longer period of time. I could have sworn there was an option for that, but I may be getting it confused with the NWN2 toolset.

Okay, I'm getting tired, I'll re-ask some of these questions later, when I am more coherent Image IPB

#7
FergusM

FergusM
  • Members
  • 460 messages

It would be nice if I could delay how long it takes to get to the next node after the fade out, so I can simulate it happening for a longer period of time.


Do you mean you simply want a black screen longer before the next line shows up? Just make the cutscene longer in the cutscene properties, with the fade out somewhere in the middle of the timeline. Your line plays, fades to black, then just sits there on a black screen for however long.

#8
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
Yeah, that works well. Simply increase the length of the cutscene in its properties and you can leave it on a black screen for however long you want.

#9
Magic

Magic
  • Members
  • 187 messages

AmstradHero wrote...

But then again, why wouldn't you be using a stage? :-) Stages are awesome.

While I agree that there aren't so many options besides using stages, can you assign the behavior of speakers dynamically when using stages (like via scripting, like in conversations of NWN1)? Or at least don't let them snap to a specific position on dialogue? Unfortunately, I missed the awesome part. :( Every conversation became surprisingly complicated for me, compared to NWN1. I hope I'm just missing the right tools?!?

#10
TimelordDC

TimelordDC
  • Members
  • 923 messages
You can assign animations to each line of the conversation in the Cinematics tab. Or are you referring to something else?

#11
Magic

Magic
  • Members
  • 187 messages
Let's say there are some NPCs standing around and the player party is approaching from whatever direction. When the conversation starts, the speaking NPC turns to the player. This works nicely.



But when a second NPC speaks, how can I achieve that this one doesn't need to snap to a particular position? (Only without stages I could get that but this has drawbacks itself.) I assumed there would be scripting functions to handle the camera while the speakers remain where they were in the game world. The campaign is making extensive use of cutscenes, avoiding this problem, it seems. That's quite an effort, though.