Movie in the middle of a module

I think we have discussed this here before, but I couldn’t find it and I don’t remember when.
There’s no way to play a movie in the middle of a module, is there? I would so much like to
have a short film playing in a dialogue.

Since @Lance_Botelle seems to be able to do almost anything with XML coding :slightly_smiling_face:…this is not something that would be possible with that I presume?

1 Like

Alright, now I found where we previously had talked about this, and indeed Lance has a solution so I will try and read what he says here:

The following block of text no longer relevant, See instead quote below this instead:
(So, I have tested this out now, and it kind of works for me. I think the problem I have is the way I want the movie to be played. I want it in the middle of a conversation and then after the movie, I want the PC and the party to jump to a waypoint. Right now, and this didn’t surprise me, the game tries to first (or at the same time really) jump the players and then play the movie. So, the way it does things now is that at first the movie flickers and tries to play, then doesn’t succeed and the PC jumps, and then immedately after the movie plays, and then you notice that you’ve jumped to the new area. I will fiddle a bit with the movie playing script and see if there’s anything to be done about this.)

1 Like

@andgalf ,

Give me a shout if you need any more info to get it working, but I think it should be reasonably straightforward.

IMPORTANT: ONLY WORKS IN OUTDOOR AREAS

Therefore, if you wish to have a movie within an interior area, you will need to jump to an outdoor area prior any movie starts and then move back to an interior if required. This can be handled by careful timing of scripts.

EDIT: To others reading this: Since Lance has editied many of the posts here, the conversation between us can seem a bit confused. The thing with the “bug” with the outdoor areas only was concluded at the end of this thread.

I just edited my post at the same time that you replied. :slightly_smiling_face:

@andgalf

Just noticed … :slightly_smiling_face: Let me get to main computer and get more help to you.

@andgalf

OK, I just want to clarify … Is this the process …

  1. Conversation …
  2. Movie …
  3. More conversation …
  4. Jump party.

Or this …

  1. Conversation …
  2. Movie …
  3. Jump …

I think you mean the latter, which means you are after a means of delaying the jump until after the movie has played … is this correct?

However, I also want to check if the movie plays “normally” or if you may have clicked on the movie to “skip” it? As I added a means to just skip a movie by left-clicking or escaping to the code. So there is a slim possibility you may have skipped the movie, but I want to make sure if this first.

Can you explain your conversation logic and let me know how you have the scripts attached to the nodes?

Tried with editing the movie playing script but the game still just flickers with the movie when trying to do that, as if it’s trying to do two things at the same time. I think it’s the jumping that’s always so darn fast in the game and it won’t wait for nothing it seems. My edited script looks like this:

void JumptheParty(string sWaypoint)
{

object oPC = GetFirstPC();

 JumpPartyToArea(oPC, GetWaypointByTag(sWaypoint));

}


void main(string sText, string sWaypoint)
{
   object oPlayer = GetPCSpeaker();
   DisplayGuiScreen(oPlayer,"SCREEN_MOVIE", TRUE, "STARSHIPMOVIE.xml");
   SendMessageToPC(oPlayer, sText);
   
   DelayCommand(20.0, JumptheParty(sWaypoint));
}

It such a shame because it kind of works now. If instead use the default script looking like this (in the second to last node in the conversation):

void main(string sText)
{
   object oPlayer = GetPCSpeaker();
   DisplayGuiScreen(oPlayer,"SCREEN_MOVIE", TRUE, "STARSHIPMOVIE.xml");
   SendMessageToPC(oPlayer, sText);
   
}

and then in the last node:

void main(string sWaypoint)
{

object oPC = GetFirstPC();
	
JumpPartyToArea(oPC, GetWaypointByTag(sWaypoint));

}

Then the game first flickers (I think it is sending the PC to the destination) and THEN it plays the movie. I wish it was the other way around.

EDIT: I notice you have a SetPause(FALSE); in one of the scripts. Maybe that has to do with anything?

@andgalf

Try adding the 20 second delay to the node itself rather than delay in the script, and just have the last node do the jumping after being delayed.

CONV …
CONV (MOVIE LINK) … 20 second node delay here too.
CONV (LAST LINE) Jump players.

Alright. I’ll try that.

I tried like this

CONV …
CONV (MOVIE LINK) … 20 second node delay.
CONV (LAST LINE) Jump players.

Outcome: The movie tries to play itself the just stands flimmering/flickering and you just see the first frame of the movie. Then the game pauses a lot of seconds and the jump the player

Second scenario:

CONV …
CONV (MOVIE LINK) …
CONV (LAST LINE) 20 seconds delay on node. Jump players.

Outcome: The game starts to try to play the movie, gets interupted by the jumping of the PC and the party, and then plays the movie. After the movie, there’s no loading a new area since that area has already been loaded and the party has already jumped apparently.

@andgalf,

OK, I recently worked on a conversation that required some special timing when displaying a specific image … which might be the kind of thing you need for the movie arrangement.

I will take a look at testing something my end. I will be trying to achieve the following; let me know if your requirements differ …

  1. CONV …
  2. MOVIE plays at a conversation link.
  3. Party jump to a new area after movie finished.

That is correct.

EDIT: The strange thing is, now that I tested some more, if I just do the script of playing the movie on the last node in the conversation, the screen still flickers for a minute and the game doesn’t manage to play the movie. However, once I go back to adding a node after that with the jumping of the players, the screen flickers for a second, jumps the player, and then plays the movie without problems.

@andgalf

OK, noted.

By the way, are you doing Cutscene style conversation or another style? (I am currently testing with a MP cutscene style.)

I am using the NWN2 style conversation here (I guess that’s the same as Cutscene style).

@andgalf

IMPORTANT: ONLY WORKS IN OUTDOOR AREAS

Therefore, if you wish to have a movie within an interior area, you will need to jump to an outdoor area prior any movie starts and then move back to an interior if required. This can be handled by careful timing of scripts.

OK, I have it working. Here is what I noted and did …

  1. Make sure you restart your game from afresh (exit and restart) after setting up the movie. For some strange reason, I found I had to do this. Anyway, assuming you are good here …

  2. Use all my original scripts, just using GetPCSpeaker() as the hook function instead.

  3. Have the MOVIE script fire on the second to last CONV node.

  4. Have the jump on the last node, using a very small delay prior to calling it. (I used 0.1 second, but I reckon you may be able to get less. Play around and use any FadeToBlack to hide scenes if need be.)

  5. No NODE delays on conversation required as when the MOVIE starts, it automatically pauses the conversation for us. i.e. The node with the movie pauses the conversation, plays the movie, then drops to the next line. As long as the JUMP has a small delay in the next line, it appears to play the movie fine.

script1 is

void main()
    {
         object oPlayer = GetPCSpeaker();
         DisplayGuiScreen(oPlayer,"SCREEN_MOVIE", TRUE, "LBMovie_TEST.xml");
         SendMessageToPC(oPlayer, "<<< MOVIE PLAYING >>>");
    }
1 Like

EDIT: The answer given by me here can seem odd since it was only at the end of this thread and extensive testing that Lance discovered the bug with the scripts only working with outdoor areas.

I have tested this only from the toolset. Maybe that has anything to do with anything?

Do you mean inside of the script like this:

void Jumptheparty(string sWaypoint)
{

object oPC = GetFirstPC();
	
JumpPartyToArea(oPC, GetWaypointByTag(sWaypoint));

}


void main(string sWaypoint)
{

object oPC = GetFirstPC();
	
DelayCommand(0.1, Jumptheparty(sWaypoint));

}

@andgalf

I always test direct from a game and never from the toolset, as there are differences, so yes, from the game and NOT the toolset.

Yes, your delayed jump script (which must go on the last node) looks fine. :+1:

For the record, here is my own delayed jump script …

void DoJump(object oPC, string sTagDestination)
{	
	object oJump = GetObjectByTag(sTagDestination);
	location lLoc = GetLocation(oJump);
	
	object oFM = GetFirstFactionMember(oPC, FALSE);
	
	while(oFM != OBJECT_INVALID)
	{
		AssignCommand(oFM, JumpToLocation(lLoc));	
		
		oFM = GetNextFactionMember(oPC, FALSE);				
	}			
}

void main(string sTagDestination = "", float fDelay = 0.0)
{
	object oSpeaker = OBJECT_SELF;
	object oPC = GetPCSpeaker();
	
	if(sTagDestination == ""){return;}
	
	else
	{
		DelayCommand(fDelay, DoJump(oPC, sTagDestination));
	}
}
1 Like

It’s the same as before, with the screen just flickering and the movie not playing. After the flickering is done, about the same time as the movie takes, the party jumps just fine.

It sounds like you do not have something setup quite right … OK, here is the trouble shooting …

  1. Set up a lever and have the movie start from the lever. We are testing that the movie works (in the game) at least.

Report back to me …

Re your following post … Changing the movie name should not matter. As I say though, you can always test that the movie plays at least from a lever. Once you know you have the movie setup as working in the game, then we can make it work from the conversation.

EG: In my example on my blogger, the movie name is: MYINTROMOVIE and the XML file that contains that reference movie name is MYINTROMOVIE.xml.

As long as you ensure the following name structure:-

A) Your movie name is the one that appears in the XML file. Eg: MYINTROMOVIE
B) Your XML file name is the one called via your conversation script. Eg: MYINTROMOVIE.xml

I just used the same for ease of description. These two could just have easily been:

A) Andgalf (instead of MYINTROMOVIE) referring to the Andgalf.bik file to play.
B) Andgalfmovie.xml (instead of MYINTROMOVIE.xml) referring to the xml file to fire.

The only thing I can think of is that I changed some of the names in your original scripts because I wanted to. It shouldn’t matter I think, but I’ll try and just use your absolute original things here.

EDIT: I tried changing to exactly what you wrote in your blog but it’s the exact same result (I would have been very surprised if it wasn’t since the name changes I did, I did very carefully, so that’s not the issue apparently)

The movie can obvioulsy be played since it does so when placing the jump after without delay, only that it flickers for a second first since it jumps the player apparently, and then plays like normal, so the game does seem to actually be able to play the video file.

I’ll still try with a placeable and the OnUsed stuff and see what happens, then I’ll try your jump script and see what happens.