PDA

View Full Version : Playing a Movie


harIII
11-23-2009, 10:20 AM
I'm using this line of code from the Movie Tutorial here on LF:

PlayMovie("PerMov01");

And for some reason it just keeps repeating itself; if you click, hit escape, or let it play all the way through, the movie will just simply play itself over again and again.

JebusJM
11-23-2009, 10:25 AM
loop=false

harIII
11-23-2009, 10:27 AM
How would I enter that in?

DarthStoney
11-23-2009, 10:53 AM
How are you triggering the script to play the movie?

harIII
11-23-2009, 12:56 PM
By an onEnter field in the .are file of the module.

DarthStoney
11-23-2009, 02:26 PM
Then you probably want something like this
void main() {
if (GetLoadFromSaveGame()) {
return;
}
object oEntering = GetEnteringObject();
if ((!GetIsPC(oEntering))) {
return;
}
if ((!GetLocalBoolean(OBJECT_SELF, 40))) {
SetLocalBoolean(OBJECT_SELF, 40, 1);
PlayMovie("PerMov01");
}
}

this way it will only fire once on enter.

stoffe
11-23-2009, 03:33 PM
By an onEnter field in the .are file of the module.

The OnEnter event on areas trigger whenever any creature is spawned into the area, not just the player. This includes the player character, party members, NPCs and monsters.

Also note that the player party is "entering" the area both when you transition to the area, and whenever you load a savegame in that area.

harIII
11-23-2009, 03:57 PM
This is a map that you'll only enter twice, how would I do that; I've not been able to work with booleans that much.

DarthStoney
11-23-2009, 05:04 PM
Do you want the movie to play only once or both times you enter the module?

harIII
11-23-2009, 05:15 PM
Just once

DarthStoney
11-23-2009, 05:32 PM
void main() {
if (GetLoadFromSaveGame()) {
return;
}
object oEntering = GetEnteringObject();
if ((!GetIsPC(oEntering))) {
return;
}
if ((!GetLocalBoolean(OBJECT_SELF, 40))) {
SetLocalBoolean(OBJECT_SELF, 40, 1);
PlayMovie("PerMov01");
}
}

Then this script should work for your purpose. It should only run once and only when PC entering.