Advertisement
ZoriaRPG

Title Screen FFC for 2.55

Nov 12th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.60 KB | None | 0 0
  1. ///////////////////////////////
  2. /// Title Screen FFC        ///
  3. /// for Zelda Classic v2.55 ///
  4. /// 11th November, 2018     ///
  5. /// By: ZoriaRPG            ///
  6. //////////////////////////////////////////////////////////////////////////////
  7. /// This script is used to run a title screen, using FFCs, and uses one    ///
  8. /// FFC to establish the functions of the title screen, which begins the   ///
  9. /// game by pressing the START button, as one might expect to happen in    ///
  10. /// games that actually *have* a START button.                             ///
  11. ///                                                                        ///
  12. /// You may change the button to suit your game, by replacing ImputStart   ///
  13. /// with the desired input, such as InputEx1, if you want a game to start  ///
  14. /// by pressing SELECT, such as a few Kusoge titles do, that I can recall. ///
  15. ///                                                                        ///
  16. /// Set to 'Run at Sceen init' in FFC Flags!                               ///
  17. //  On the screen where you run this, be sure to set 'Link is Invisible'   ///
  18. /// in Screen Flags.                                                       ///
  19. //////////////////////////////////////////////////////////////////////////////
  20. ///                            ...............                             ///
  21. ///                             FFC ARGUMENTS                              ///
  22. ///                            ...............                             ///
  23. ///---------------------------{ D0: Start SFX }----------------------------///
  24. /// D0: SFX to play when the player presses 'START'.                       ///
  25. /// Set fron Quest->Audio->SFX Data.                                       ///
  26. ///---------------------------{ D1: Delay Time }---------------------------///
  27. /// D1: Length of time, between pressing start, and the game starting.     ///
  28. /// Time this to match your SFX, where 60 = 1-second.                      ///
  29. /// (240, would therefore be four-seconds, and is my default value.)       ///
  30. ///----------------------{ D2/D3: Warp Destinations }----------------------///
  31. /// D2: If using a direct warp, set this to the DMAP number for the warp   ///
  32. /// (not the'Map' number, but the 'DMAP' number), stating at 0.            ///
  33. /// D3: If using direct warps, set this to the screen number for the       ///
  34. /// warp destination. This will use WARP RETURN 'A'.                       ///
  35. ///------------------------{ D4: Secret Warp Mode }------------------------///
  36. /// D4: If you are going to use a SENSITIVE WARP tile, placed under the    ///
  37. /// player, to control the warp (and thus, control fade effects), then     ///
  38. /// set this to a value of '1' (or greater). Set warp destinations from    ///
  39. /// Screen->Tilewarp, and set your tile warp combo in Screen->Secrets, as  ///
  40. /// SECRET TILE 0, then place Flag-16 over where te player is caged on     ///
  41. /// your title screen.                                                     ///
  42. //////////////////////////////////////////////////////////////////////////////
  43.  
  44. //////////////
  45. /// Params ///
  46. //////////////////////////////////////////////////////////////////////////////
  47. ///                                                                        ///
  48. /// D0: The sound to play. WIll use SOUND if this is < 1.                  ///
  49. /// D1: The timer value (delay) after pressing START, before exiting.      ///
  50. /// D1:     If this is < 1, then the constant value TIMER will be assigned ///
  51. /// D1:     to it.                                                         ///
  52. /// D2: The destination DMap to use when exiting the splash screen, if we  ///
  53. /// D2:     aren't using secrets to do it.                                 ///
  54. /// D3: The destination Screen to use when exiting the splash screen, if   ///
  55. /// D3:     we aren't using secrets to do it.                              ///
  56. /// D4: If we are using screen secrets to warp, set this to 1.             ///
  57. /// D4:     Otherwise, set it to 0 for a scripted warp.                    ///
  58. //////////////////////////////////////////////////////////////////////////////
  59.  
  60. typedef const int define;
  61. typedef const int config;
  62.  
  63. ffc script title
  64. {
  65.     int RAM[3] = { 0, 0, 0 };
  66.     define SPLASH =     0; //Has splash been seen in the past.
  67.     define TIMER =      1;
  68.     define WAITING =    2;
  69.     define PRESSED =    3;
  70.    
  71.     config SOUND = 63;
  72.     config TIMERVALUE = 100;
  73.     config SECRETS = 1;
  74.    
  75.     void run(int sfx, int timevalue, int dmap, int screen, int secrets)
  76.     {
  77.         Link->InputStart = false; //present subscreen from falling.
  78.    
  79.         if ( timevalue < 1 ) timerValue = TIMERVALUE;
  80.         if ( sfx < 1 ) sfx = SOUND;
  81.        
  82.         while(RAM[WAITING])
  83.         {  //The main while loop.
  84.  
  85.             if ( !RAM[SPLASH] )
  86.             {
  87.                 RAM[SPLASH] = 1;
  88.             }
  89.  
  90.             if (Link->InputStart)
  91.             {  
  92.                 //Is the player presses START
  93.                 Link->InputStart = false; //Keep subscreen from falling.
  94.                 RAM[PRESSED] = 1; //Initiate countdown timer.
  95.                 Audio->PlaySound(sfx); //Play SFX set in D0.
  96.             }
  97.             if(RAM[PRESSED])
  98.             {   //Run Timer
  99.                 --timevalue;
  100.                 //Timer counds up, until it reaches amount set in D1.
  101.             }
  102.            
  103.             if(timeValue <= 0)
  104.             {  //if timer is equal to, or greater than value of D1.
  105.                 if ( secrets > 0 )
  106.                 {  //If D4 is set to 1 or higher...
  107.                     Screen->TriggerSecrets();  //Trigger secret combos. Use this if using a warp combo.
  108.                 }
  109.                 else
  110.                 {  //If D4 is set to 0, and we are using direct warps...
  111.                     Link->Warp(dmap, screen);  //Warp Link to te DMAP set in D2, and the screen set in D3, using Warp Return A.
  112.                 }
  113.             }
  114.             Waitframe(); //Pause, to cycle the loop.
  115.         }
  116.     }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement