Second video not playing

Started by , Mon 06/03/2006 17:33:52

Previous topic - Next topic

Monkey Mage

I'm having problems playing videos in my game.  I've gotten one of the videos in a room to work but a few seconds later when it tries to play the second video the game goes to a black screen and doesn't play it.  It looks like the engine is getting stuck because I have to control alt delete my way out of it.  I've checked the code numerous times and there's nothing wrong with it.  What shold i do?

Scorpiorus

When you say "video" do you mean MPEG, AVI that run with the PlayVideo() command, or FLIC animation (PlayFlic) ?

If it's the MPEG etc, can you play those video files (particularly the second one) in the Windows Media player?

In AGS, what if you play the 1st working video twice, i.e. instead if the 2nd one, what happens then, the same black screen?

What version of AGS are you using?

Still, can you post the script code you used to play this two-video sequence?

Monkey Mage

It's a wmv file and basically the first video runs, then there are a few lines of dialog and the second video runs and goes the blank screen.  The code looks like this
// room script file



#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a() {
  // script for Room: First time player enters screen
PlayVideo ("Lord Vader Rise.wmv", 0, 0);
character[DV].ChangeView(11);
RunDialog(2);
SetGlobalInt (3,  1);
}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart room_c  // DO NOT EDIT OR REMOVE THIS LINE
function room_c() {
  // script for Room: Player enters screen (before fadein)
SetGlobalInt (1, 1);
SetGlobalInt (3, 0);
}
#sectionend room_c  // DO NOT EDIT OR REMOVE THIS LINE



#sectionstart room_d  // DO NOT EDIT OR REMOVE THIS LINE
function room_d() {
  // script for Room: Repeatedly execute
GetGlobalInt (3 == 1); {
PlayVideo ("Ice Planet.wmv", 0, 2);
}
}
#sectionend room_d  // DO NOT EDIT OR REMOVE THIS LINE

Scorpiorus

#3
Code: ags
GetGlobalInt (3 == 1); {
PlayVideo ("Ice Planet.wmv", 0, 2);
}



That's why C syntax is believed to be weird, as some people think.
And I can really understand them looking at that piece of code that compiles no problem. :)

What you probably meant is:

if ( GetGlobalInt(3) == 1 ) {

   PlayVideo ("Ice Planet.wmv", 2, 0);
   SetGlobalInt(3, 0); // to run only once
}

See if it works and let us know.


[edit]

If it won't help, replace...

PlayVideo ("Ice Planet.wmv", 2, 0);

with

PlayVideo ("Lord Vader Rise.wmv", 2, 0);

... and see whether it can handle the same file twice

Monkey Mage

I added what you said to the code and it still doesn't work.  It will play the first video again but it won't play any other videos (I tried multiple videos).

A�rendyll (formerly Yurina)

Are you sure you didn't make a silly mistake like spelling or something (spaces should be checked too)?

How big are the videos? The problem could be you have a very large videofiles which are too heavy to play correct in AGS. Or maybe you have a pc which has a hard time dealing with big videos?
Yuna: Give me a Y!
Rikku: Give me an R!
Paine: Give me a break...
~Final Fantasy X-2

I've been

SMF spam blocked by CleanTalk