home *** CD-ROM | disk | FTP | other *** search
/ Greatest Childrens Stories Ever Told / Greatest_Stories.iso / movies / ripvan / shared.dir / 01009_Script_1009 < prev    next >
Text File  |  1994-11-07  |  10KB  |  408 lines

  1. --update 8/15/94 ch2/tales
  2. --SHARING HANDLES
  3. on holdmyplace
  4.   global returnframe,holdreturnframe
  5.   set holdreturnframe=returnframe
  6.   set returnframe=500
  7. end
  8.  
  9.  
  10.  
  11. on checkWhichMovie
  12.   global nextmovie
  13.   sound stop 1
  14.   if marker(-1)=marker("atend") then dontpassevent
  15.   if the soundenabled then 
  16.     if marker(0)<marker("end" ) then
  17.       if (nextmovie=1 and (the last char of the movie contains "1")) ¼
  18. or (nextmovie=2 and (the last char of the movie contains "2")) or ¼
  19. (nextmovie=3 and (the last char of the movie contains "3")) then
  20.         go marker(1)-1
  21.         abort
  22.       end if
  23.     end if
  24.   end if
  25. end
  26.  
  27. --FOR THE FORWARD BUTTON
  28. on goahead
  29.   global qa,goforward,questions,returnframe,moviename
  30.   set the timeOUtScript to empty
  31.   if marker(-1)=marker("atend") then exit
  32.   sound stop 1
  33.   if questions=1 and returnframe<500 then
  34.     checkWhichMovie
  35.     if returnframe>the frame then
  36.       if returnframe<marker(1)-1 or the frame>marker("end") then
  37.         go to frame(returnframe)
  38.         exit
  39.       else
  40.         if (returnframe>the frame) and (the frame<marker("end")-1) then
  41.           go marker(1)-1
  42.           set qa=1
  43.           exit
  44.         end if
  45.       end if
  46.     end if
  47.     
  48.     
  49.     if the frame>=marker("end") and (questions=0 or qa<>0 or returnframe=500) then 
  50.       IF QA=1 AND questions=1 and RETURNFRAME=MARKER(0)+2 THEN EXIT
  51.       unloadcast
  52.       GO movie moviename 
  53.     else
  54.       if questions=0  then
  55.         UNLOADCAST
  56.         go marker(1)-1
  57.       else if the frame=marker(0) then
  58.         go marker(0)+1
  59.         EXIT
  60.       else 
  61.         if qa=3  then 
  62.           set qa=0
  63.           go marker(1)-1
  64.           exit
  65.         else if qa=0 and returnframe<=the frame then 
  66.           go marker(0)+2
  67.           EXIT
  68.         else if qa<>0  and (returnframe>marker(0)+2 and returnframe>=marker(1)) then 
  69.           go marker(1)-1
  70.           EXIT
  71.         else if returnframe=marker(0)+2 then 
  72.           go marker(0)+2
  73.           exit
  74.         ELSE IF( QA=1 AND RETURNFRAME<>MARKER(0)+5) THEN 
  75.           go marker(1)-1
  76.           EXIT
  77.         else if qa="2nd" and returnframe<marker(1) then 
  78.           go marker(0)+5
  79.           EXIT
  80.         end if
  81.       end if
  82.     END IF
  83.   else
  84.     if marker(0)<>label("end") then 
  85.       go marker(1) -1 
  86.       exit
  87.     else 
  88.       UNLOADCAST
  89.       go movie moviename
  90.     end if
  91.   end if
  92.   
  93.   
  94.   
  95.   
  96. end goahead
  97.  
  98. --FOR THE BACK BUTTON
  99. on goback
  100.   global qa,clicked,returnframe,backmovie
  101.   set the timeOUtScript to empty
  102.   if  the frame<=marker("1")+1 then
  103.     beep 1 
  104.     exit
  105.   end if
  106.   sound stop 1
  107.   if (RETURNFRAME<THE FRAME) then ¼
  108. put the frame into returnframe
  109.   if the frame<=marker("begin")+1 then
  110.     unloadcast
  111.     holdmyplace
  112.     go frame"end"  of movie backmovie
  113.     exit
  114.   else
  115.     if ((qa=1 or qa=3) and returnframe>=the frame) and (marker(0)=the frame ¼
  116. or marker(0)+1=the frame) then  
  117.       set qa=1 
  118.       go marker (-1)   
  119.     else    
  120.       if (qa=0 and (marker(0)+1=the frame or marker(0)=the frame))¼
  121. or (qa="2nd" and returnframe>the frame) then
  122.         go marker(-1)
  123.       else
  124.         go marker(0)   
  125.       end if
  126.     end if
  127.   end if
  128.   
  129. end goback
  130.  
  131. on texthasquestions
  132.   -- text has questions corrected 3/30 part 1
  133.   global qa,goforward,returnframe,questions,nextmovie,MOVIENAME
  134.   checkWhichMovie
  135.   if questions=1 and returnframe<500 then
  136.     
  137.     if returnframe<=the frame then 
  138.       ansques(0)
  139.     else 
  140.       if not the soundenabled then pause
  141.       else     
  142.         if returnframe>the frame then
  143.           if returnframe<marker(1) or (marker(0)=marker("end")) then
  144.             ansques(1)
  145.             go to frame(returnframe)
  146.             exit
  147.           else
  148.             if returnframe>the frame then set qa=1
  149.             if marker(0)<>marker("end") then go marker(1)-1
  150.           end if
  151.         end if
  152.       end if
  153.     END IF
  154.     
  155.     
  156.     if not the soundenabled then
  157.       pause
  158.     end if
  159.     
  160.     if the pauseState=false and qa<>0 then    
  161.       if qa="2nd" and returnframe<marker(1) then 
  162.         go marker(0)+5
  163.         exit
  164.       else
  165.         if qa=1 and returnframe>the frame then
  166.           if marker(0)<>label("end") then 
  167.             go marker(1) -1 
  168.             exit
  169.           else 
  170.             UNLOADCAST
  171.             go movie moviename
  172.             exit
  173.           end if
  174.         end if
  175.       end if
  176.     end if
  177.   else
  178.     if not the soundenabled then
  179.       pause
  180.     else
  181.       set qa=1
  182.       if marker(0)<>label("end") then 
  183.         go marker(1) -1 
  184.         exit
  185.       else 
  186.         UNLOADCAST
  187.         go movie moviename
  188.         exit
  189.       end if
  190.     end if
  191.   end if
  192. end texthasquestions
  193.  
  194. on textnoquestions
  195.   global returnframe,goforward,MOVIENAME
  196.   ansques(1)
  197.   if returnframe<=the frame then set returnframe=the frame
  198.   if not the soundenabled then
  199.     pause
  200.   else
  201.     if marker(0)<>label("end") then 
  202.       go marker(1) -1 
  203.     else
  204.       UNLOADCAST
  205.       go movie moviename
  206.     end if
  207.   end if
  208.   
  209. end textnoquestions
  210.  
  211. on GetOut
  212.   global questions,scoremovie,menumovie,RETURNFRAME,HOLDRETURNFRAME,QA,wpath
  213.   sound stop 1
  214.   when keydown then nothing
  215.   SET RETURNFRAME=0
  216.   SET HOLDRETURNFRAME=0
  217.   SET QA=0
  218.   if questions=1 then go movie SCOREMOVIE
  219.   if questions=0 then go  frame wpath of movie menumovie
  220. end GetOut
  221.  
  222.  
  223. --FOR THE SOUND ON AN OFF BUTTON
  224. on changesound x
  225.   if x then set the soundenabled=not the soundenabled
  226.   PUPPETSPRITE 21,TRUE
  227.   if the soundenabled=false then
  228.     set the castnum of sprite 23 to ¼
  229. the number of cast "nomusica"
  230.   else
  231.     set the castnum of sprite 23 to the number of cast "musica"
  232.   end if  
  233.   if the frame=marker(0)+1 then
  234.     go marker(0)
  235.   end if
  236.   updatestage
  237. end changesound
  238.  
  239. --FOR THE TEXT ON AN OFF BUTTON
  240. on changetext
  241.   global textoff
  242.   puppetsprite 21,true
  243.   if textoff=1 then 
  244.     set the castnum of sprite 21 to the number of cast "Text Off"
  245.     puppetsprite 2, true
  246.     puppetsprite 18,true
  247.     set the locV of sprite 2 to -500
  248.     set the locV of sprite 18 to -500
  249.   else
  250.     set the castnum of sprite 21 to ¼
  251.   the number of cast "Text On"
  252.     puppetsprite 2, false
  253.     puppetsprite 18,false
  254.     if the frame=marker(0)+1 then go the frame
  255.     updatestage
  256.   end if
  257.   updatestage
  258. end changetext
  259.  
  260.  
  261.  
  262. -- make sure you put when keydown then nothing in getout handler
  263. on hideallbuttons state
  264.   repeat with buttons=19 to 24
  265.     puppetsprite buttons,true
  266.     set the type of sprite buttons to state
  267.   end repeat
  268.   if not the soundenabled then go the frame
  269.   updatestage
  270. end hideallbuttons
  271.  
  272. -- else if (the keycode=49 or the key=" ") and (THE FRAME<MARKER("END")-1) then  --lastmovie
  273. --else if the keycode=124 AND THE FRAME<MARKER("END") then goahead --LAST MOVIE
  274.  
  275. on checkkey --**
  276.   global spacehit,textoff,OK
  277.   
  278.   if the key="s" or the key="S" then DOBUTTON 21, "changesound 1",1
  279.   else if the keycode=124 then DOBUTTON 24,"GOAHEAD",1
  280.   else if the keycode=123 then DOBUTTON 19,"GOBACK",1
  281.   else if the key>="1" and the key <="7" then set the soundlevel=value(the key)
  282.   else if the key="t" or the key="T" then 
  283.     set textoff= not textoff
  284.     DOBUTTON 20,"CHANGETEXT",1
  285.   else if (the keycode=49 or the key=" ") and (the frame >= marker("1")) then
  286.     if spacehit=0 then 
  287.       hideallbuttons 0
  288.       set spacehit=spacehit+1
  289.     else     
  290.       if spacehit=1 then 
  291.         hideallbuttons 1
  292.         set spacehit=0
  293.       end if
  294.     end if
  295.   end if
  296.   
  297.   dontpassevent
  298.   
  299. end checkkey
  300.  
  301.  
  302. on fixpuppets
  303.   changetext
  304.   changesound 0
  305.   when keydown then checkkey
  306. end fixpuppets
  307.  
  308. on texit
  309.   puppetsprite 20,true
  310.   set the castnum of sprite 20 to ¼
  311. the number of cast "Text Off"
  312.   puppetsprite 2, true
  313.   puppetsprite 18,true
  314.   set the loch of sprite 2 to -500
  315.   set the loch of sprite 18 to -500
  316. end texit
  317.  
  318.  
  319.  
  320. on setpuppets state
  321.   repeat with buttons=19 to 24
  322.     puppetsprite buttons,state
  323.   end repeat
  324. end setpuppets
  325.  
  326. on normpause
  327.   global returnframe
  328.   if the frame=returnframe then  SET QA=0
  329.   pause
  330. end normpause
  331.  
  332.  
  333. on ansques i
  334.   global qa,returnframe
  335.   set qa=i
  336.   if returnframe<the frame then set returnframe=the frame
  337.   WHEN MOUSEDOWN THEN NOTHING
  338.   When keydown then checkkey
  339. end ansques
  340.  
  341. on clearvariables all
  342.   global clicked,goforward
  343.   if all then
  344.     put 0 into clicked
  345.     put 0 into goforward
  346.   else 
  347.     put 0 into clicked
  348.     put 1 into goforward
  349.   end if
  350. end clearvariables
  351.  
  352. on wrongans a
  353.   --wrong answer expl normal
  354.   global wrong,goforward,returnframe
  355.   starttimer
  356.   set the timeoutLength to 30*60
  357.   set the timeOUtScript to "goahead"
  358.   if returnframe< the frame then put wrong+1.0 into wrong
  359.   else clearvariables(0)
  360.   if a=2 then ansques ("2nd") 
  361.   else ansques (1)
  362.   pause
  363. end wrongans
  364.  
  365. on correctans a
  366.   --correct answer normal
  367.   global numr,goforward,returnframe
  368.   starttimer
  369.   set the timeoutLength to 30*60
  370.   set the timeOUtScript to "goahead"
  371.   if returnframe< the frame then put numr+1.0 into numr
  372.   else clearvariables(0)
  373.   if a=2 then ansques ("2nd")
  374.   else ansques (1)
  375.   pause
  376. end correctans
  377.  
  378. on wrong2follow
  379.   --wrong answer expl with passage question to follow
  380.   global wrong,goforward,returnframe
  381.   starttimer
  382.   set the timeoutLength to 30*60
  383.   set the timeOUtScript to "goahead"
  384.   if returnframe< the frame then 
  385.     put wrong+1.0 into wrong
  386.   else
  387.     clearvariables(1)
  388.   end if
  389.   ansques(3)
  390.   pause
  391. end wrong2follow
  392.  
  393. on corr2follow
  394.   global numr,goforward,returnframe
  395.   starttimer
  396.   set the timeoutLength to 30*60
  397.   set the timeOUtScript to "goahead"
  398.   if returnframe< the frame then put numr+1.0 into numr
  399.   else clearvariables(1)
  400.   ansques (3)
  401.   pause  
  402. end corr2follow
  403.  
  404.  
  405. --END MOVIE SCRIPT 11/6/93, Part 2, 3, or 4 of movie
  406.  
  407.  
  408.