////////////////////////// /// Title Screen FFC /// /// By: ZoriaRPG /// /// With Assistance /// /// From: MasterManiac /// ////////////////////////////////////////////////////////////////////////////// /// This script is used to run a title screen, using FFCs, and uses one /// /// FFC to establish the functions of the title screen, which begins the /// /// game by pressing the START button, as one might expect to happen in /// /// games that actually *have* a START button. /// /// /// /// You may change the button to suit your game, by replacing ImputStart /// /// with the desired input, such as InputEx1, if you want a game to start /// /// by pressing SELECT, such as a few Kusoge titles do, that I can recall. /// /// /// /// Set to 'Run at Sceen init' in FFC Flags! /// ////////////////////////////////////////////////////////////////////////////// /// ............... /// /// FFC ARGUMENTS /// /// ............... /// ///---------------------------{ D0: Start SFX }----------------------------/// /// D0: SFX to play when the player presses 'START'. /// /// Set fron Quest->Audio->SFX Data. /// ///---------------------------{ D1: Delay Time }---------------------------/// /// D1: Length of time, between pressing start, and the game starting. /// /// Time this to match your SFX, where 60 = 1-second. /// /// (240, would therefore be four-seconds, and is my default value.) /// ///----------------------{ D2/D3: Warp Destinations }----------------------/// /// D2: If using a direct warp, set this to the DMAP number for the warp /// /// (not the'Map' number, but the 'DMAP' number), stating at 0. /// /// D3: If using direct warps, set this to the screen number for the /// /// warp destination. This will use WARP RETURN 'A'. /// ///------------------------{ D4: Secret Warp Mode }------------------------/// /// D4: If you are going to use a SENSITIVE WARP tile, placed under the /// /// player, to control the warp (and thus, control fade effects), then /// /// set this to a value of '1' (or greater). Set warp destinations from /// /// Screen->Tilewarp, and set your tile warp combo in Screen->Secrets, as /// /// SECRET TILE 0, then place Flag-16 over where te player is caged on /// /// your title screen. /// ////////////////////////////////////////////////////////////////////////////// /////////////////////// /// Global Variable /// ////////////////////////////////////////////////////////////////////////////// /// Place this at the head of your scripts, as a global variable. This is /// /// an array thatuses two booleans, to set if Link is, or is not visible, /// /// on the destination screen, when using the afterTitleScreen FFC script. /// /// The point of this, is to prevent afterTitleScreen from making Link /// /// visible, if he is using an ITEM that makes him INVISIBLE. /// /// /// /// The purpose of the afterTitleScreen FFC is to make Link visible again, /// /// after leaving the title screen, and entering normal gameplay. There /// /// are other ways to do this, but using a second FFC ensures that the /// /// code to make Link visible again always runs AFTER he warps, and to /// /// ensure that if Link is not set to visible when using an item on that /// /// screen in normal play, this boo.ean array check is Link was on the /// /// title screen, immediately before the afterTitleScreen FFC runs, and /// /// if the title screen set hin to be invisible. /// ////////////////////////////////////////////////////////////////////////////// bool titleScreenBools[3] = { false, false, false }; ///////////// /// TABLE /// //////////////////////////////////////////////////////////////////// /// wasOnTitleScreen, isInvisibleFromTitleScreen, isOnTitleSceen /// //////////////////////////////////////////////////////////////////// ffc script titleScreen { void run(int SFX, int timeValue, int W_DMAP_NUMBER, int W_SREEN_NUMBER, int secrets) { Link->InputStart = false; //present subscreen from falling. bool waiting = true; //Establish main while loop. bool pressed = false; //Establish timer rquirements. int timer = 0; //Set timer to exist. titleScreenBools[0] = true; titleScreenBools[2] = true; while(waiting){ //The main while loop. Link->Invisible = true; //Make Link Invisible. if ( Link->Invisible && titleScreenBools[1] == false ) { titleScreenBools[1] = true; } if (Link->InputStart) { //Is the player presses START Link->InputStart = false; //Keep subscreen from falling. pressed = true; //Initiate countdown timer. titleScreenBools[2] = false; Game->PlaySound(SFX); //Play SFX set in D0. } if(pressed){ //Run Timer timer++; //Timer counds up, until it reaches amount set in D1. } if(timer >= timeValue){ //if timer is equal to, or greater than value of D1. if ( secrets > 0 ) { //If D4 is set to 1 or higher... Screen->TriggerSecrets(); //Trigger secret combos. Use this if using a warp combo. } else { //If D4 is set to 0, and we are using direct warps... Link->Warp(W_DMAP_NUMBER, W_SREEN_NUMBER); //Warp Link to te DMAP set in D2, and the screen set in D3, using Warp Return A. } } Waitframe(); //Pause, to cycle the loop. } } } ////////////////////////////// /// FFC - afterTitleScreen /// ////////////////////////////////////////////////////////////////////////////// /// Place this FFC on the screen that Link starts on. This is the same /// /// screen that you set either as a warp destination (in Direct-Warp mode) /// /// or as a Tile Warp, in Tile-Warp mode. /// /// /// /// This FFC returns link's visible state, using the titleScreen booeans /// /// and if Link enters this screen in another way (other than being sent /// /// here fron the title screen), he can safely use items that make him /// /// invisible. /// ////////////////////////////////////////////////////////////////////////////// ffc script afterTitleScreen { void run() { if ( titleScreenBools[0] == true && titleScreenBools[1] == true ) { titleScreenBools[0] = false; titleScreenBools[1] = false; titleScreenBools[2] = false; Link->Invisible = false; } } } /////////////////////// /// EXTRA FUNCTIONS /// /////////////////////////////////////////////////////////////////////////////// /// These are extra functions that you may want to use, but aren't actually /// /// used by these scripts. (i.e. Bonus Content). /// /////////////////////////////////////////////////////////////////////////////// void setLinkVisible(){ if ( titleScreenBools[0] == true && titleScreenBools[1] == true && titleScreenBools[2] == false ) { Link->Invisible = false; } } //This is useful if you may have random locations, where you want to send Link //fron the title screen. You can call it in your main global loop, to change //the visibility state of Link, instead of using an FFC. //This would go before Waitdraw().