Load a movie from a defined variable

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Jezzy
Regular
Posts: 30
Joined: Wed Jun 21, 2017 2:18 pm
Contact:

Load a movie from a defined variable

#1 Post by Jezzy » Mon Mar 25, 2019 1:47 pm

Hello!

I'm trying to load a movie from a random value from a defined array to a variable :

I have a simple array/list such as stage_loop = ["path/to/movie.webm","path/to/movie.webm","path/to/movie.webm","path/to/movie.webm"]

When I try :

Code: Select all

$ selected_movie = random.choice(stage_loop)

image current_scene = Movie(play=selected_movie)

show current_scene 
I get a black screen. However, If I set my image with a string

Code: Select all

image current_scene = Movie(play="path/to/movie.webm")

show current_scene
It work.

I'm puzzled because I don't get any error when I try to give my variable a random choice from my array. I know my variable is correct when I output the result to the screen using a sayer (i.e. narrator "Var = [selected_movie]", I see on screen the path/to/movie.webm). I don't get any error message; only a black screen.

My question is : is it possible to load an image movie from a variable?

Jezzy
Regular
Posts: 30
Joined: Wed Jun 21, 2017 2:18 pm
Contact:

Re: Load a movie from a defined variable

#2 Post by Jezzy » Mon Mar 25, 2019 2:19 pm

I figure it out by myself. Using movie_cutscene instead of movie fixed my issue

https://www.renpy.org/doc/html/movie.ht ... e_cutscene

Post Reply

Who is online

Users browsing this forum: Google [Bot]