1
!------------------------------------------------------- -*- Inform -*- ----
2
! Movie.H An Inform 6.0 library to put non-interactive
3
! Version 2 "cut scenes" into a game. By L. Ross Raszewski
5
! This is a minor re-release as I just realized I uploaded the wrong copy
9
! I know what you're thinking. You're thinking, "non-interactive cut scenes"?
10
! What would I want a thing like that for? Well, It may at times be useful,
11
! or at least novel, to have the player suddenly be stopped and watch a sort
12
! of anecdote. It could be used for an introduction, and endgame, or a
13
! flashback. The player may, if they wish, choose not to view movies
14
! automatically. This library allows players to review movies they have
17
! In a print statement: (PlayMovie) 1
18
! (Call PlayMovie(movie,1); if you want the movie to play regardless of
19
! autoplay and replay settings!)
20
! The programmer must provide a DoMovie(movie) sub, which reads its argument,
21
! and writes the movie based on it as such:
23
! switch(m){1: "This is the first movie";
27
! The first time a call to PlayMovie(movie); is made, if you have a footnote
28
! library installed (especially mine) define the constant MovieNote with a
29
! value equal to one of your footnotes, and that footnote will be called.
30
! (To alert players to the fact that they can watch movies later).
31
! If the global "ShowMovies" is equal to 1, movies will not be shown, but
32
! a message will alert players to the fact that one is being played.
33
! If the global replayMovie is set to 1, the movie will only play the first
34
! time it is callled, and the alert message will be shown all subsequent
35
! times. The global nextmovie can be read, but should be left alone by
36
! the game (unless you're trying to do something really sneaky).
38
! In addition to DoMovie, the user must provide an array (a bit array
39
! will do) called 'movies', of a length _greater_ then the number of movies
40
! in the game (because I use movies-->0 for internal things.)
41
! The game should provide a word array, MovieTitle-->, which names the movies
42
! (This MUST start at MovieTitle-->1, not -->0, for internal reasons.)
43
! and a MovieTL-> which holds (again, starting one entry in) the number of
44
! letters for the corresponding MovieTitle _divided by 2_ for DoMenu.
45
! The user need also define either a global or constant (depending on how
46
! you plan to use it) called MMTitle (The banner you want to display when the
47
! movies are called from a menu) and another called MMWidth, (half the width
50
! When called from the screen, PlayMovie will prompt for a keypress
51
! (the WaitForKey("Message"); routine is available for public use.)
52
! then clear the screen, show the movie, wait for a keypress, then clear the
55
! Typing "Movie" will bring up the movie menu. The names of viewed movies will
56
! appear in the same order as the player saw them, and the player can view his
57
! choice of movie. "Movie On" and "Movie Off" will enable and disable movie
58
! autoplaying. (A verb to change the replay mode is "left as an exercise to the
61
! Calling DoMovie alone will write the movie but not update the counter. The
62
! movie will not appear on on the Movie review screen. (Nor will the screen be
65
! MoviePlayed(movie) returns true if the movie in question has been played, false
67
! FindMovie(i) finds which movie was "i-th" played.
70
! Questions, Comments, bugs, e-mail me at rraszews@skipjack.bluecrab.org
78
[ PlayMovie movie flag;
80
if (movies-->0==0) { Note(MovieNote);
81
new_line; movies-->0=1;};
83
if (flag ~= 1 &&(ShowMovies==1 || (MoviePlayed(movie)==1 && replayMovie==1)))
84
{ style underline; print "^^[Movie: ";
85
print (string) MovieTitle-->movie;
86
print "]^^"; style roman;
87
if (MoviePlayed(movie)==0) {
88
movies-->nextmovie=movie;
91
WaitForKey("^^^Press [SPACE]");
95
WaitForKey("^^^Press [SPACE]"); @erase_window -1;
96
if (MoviePlayed(movie)==0) {
97
movies-->nextmovie=movie;
101
[ MoviePlayed movie i;
102
for(i=1:i<=nextmovie:i++) {
103
if (movies-->i==movie) rtrue;};
107
DoMenu(WriteMovieList,MovieRC,MoviePF);
109
[ WriteMovieList i j;
111
for(i=1:i<=nextmovie:i++) {
113
if (j~=0) { new_line;
114
spaces(5); print (string) MovieTitle-->j;};
121
if (menu_item==0) { item_name=MMtitle; item_width=MMwidth; return (nextmovie-1);};
122
item_name=MovieTitle-->FindMovie(menu_item);
123
item_width=MovieTL->FindMovie(menu_item);
126
i=FindMovie(menu_item);
131
"Movie autoplay disabled.";
135
"Movie autoplay enabled.";
138
verb meta "Movies" "Movie" * -> MovieMenu
144
if (str==0) str="(Please Press Any Key)";