Hey there,
a friend and I are making a game for college project in Processing. Before the game starts, a cutscene is played which works perfectly fine when tested in the editor, but when exported as a build (Windows), it does not play and the game cannot start.
Does anybody have an idea or experience with something like this?
Thank you in advance for any help!
Hi @blackwood
Welcome to the forum!
It would help if you posted the code for others to test.
When you build the project you get the 32bit and 64bit version. Are you running the compatible version with your windows version?
If so, check if the data folder the building version has all images that are in your data folder of the Processing sketch directory
Best regards
Thank you!
Of course, sorry. The is the bit considering the cutscene:
import processing.video.*;
Movie cutscene;
boolean isCutsceneOver = false;
boolean cutsceneStarted = false; //one time indicator to play cutscene when ready
void setup(){
// initialising of player, background and objects [...]
if(!isCutsceneOver){
cutscene = new Movie(this, "cutscene.mp4");
}
}
void draw(){
if(millis() > 30000 && isCutsceneOver == false){
cutscene.stop();
isCutsceneOver = true;
}
if(isCutsceneOver==false){
if(!cutsceneStarted){
cutscene.play();
cutscene.volume(0.5);
cutsceneStarted = true;
}
image(cutscene, 0, 0, width, height);
}
if (isCutsceneOver){
// calls update function of the various objects, arrays and background movement [...]
}
void movieEvent(Movie m) {
m.read();
}
As I said, it works in Processing but not when exported as build.
Best regards!
Hi,
The code is straightforward and since it worked on the PDE can you please check if you have the following folders at least?
In the root directory of your sketch (\sketch_name)…
...\sketch_name
|___\applications.windows32
| |___\data
| | |___\cutscene.mp4
| |___\sketch_name.exe
|
|___\applications.windows64
| |___\data
| | |___\cutscene.mp4
| |___\sketch_name.exe
|
|___\Data
| |___\cutscene.mp4
|
|___sketch_name.pde
Hope it helps
Yes, the structure is exactly as you stated! Cutscene is inside the data folder.
My friend and I, we tried in both on different computers and the build with cutscene never works.
Any other ideas? If not, thank you anyway!
Hi @blackwood
I tried your code and it worked for me
You had a missing parenthesis after
if (isCutsceneOver){
The code that I ran and exported is the one below
import processing.video.*;
Movie cutscene;
boolean isCutsceneOver = false;
boolean cutsceneStarted = false; //one time indicator to play cutscene when ready
void setup(){
// initialising of player, background and objects [...]
if(!isCutsceneOver){
cutscene = new Movie(this, "cutscene.mp4");
}
}
void draw(){
if(millis() > 30000 && isCutsceneOver == false){
cutscene.stop();
isCutsceneOver = true;
}
if(isCutsceneOver==false){
if(!cutsceneStarted){
cutscene.play();
cutscene.volume(0.5);
cutsceneStarted = true;
}
image(cutscene, 0, 0, width, height);
}
if (isCutsceneOver){
// calls update function of the various objects, arrays and background movement [...]
}
}
void movieEvent(Movie m) {
m.read();
}
Give it a try