• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Auto-Crediting System

#Not Important

All hail the wishmaker
910
Posts
4
Years
  • I've been wanting to make this one for a while, but I thought it would be hard. I thought wrong. It only took me about 20 minutes to make it fully functioning.
    Well, here's how it works:
    • People who use scripts; install it.
    • People who script; use the following snippet to credit yourself:
      Code:
      if defined?(acs_check)
        pbAddCredits(YOUR NAME/USERNAME, WHAT YOU MADE)
      end
      That will make sure you only call the script for people who have it installed.
    It is essentially an edit of Scene_Credits. It uses the same configuration variables as the original script (no config needed).
    Anyway, here's the script (yes I do credit myself):
    Code:
    #==============================================================================
    # * Auto Crediting system (ACS) by #Not Important
    #------------------------------------------------------------------------------
    # For users of scripts:
    #  - Install this script!
    #
    # For scripters (cool people):
    #  - Add the following snippet of code to credit yourself!
    =begin
    if defined?(acs_check)
      pbAddCredits("YOUR NAME/USERNAME","WHAT YOU MADE")
    end
    =end
    #------------------------------------------------------------------------------
    # * Essentially an edit of Scene_Credits
    #==============================================================================
    # * Scene_Credits
    #------------------------------------------------------------------------------
    # Scrolls the credits you make below. Original Author unknown.
    #
    ## Edited by MiDas Mike so it doesn't play over the Title, but runs by calling
    # the following:
    #    $scene = Scene_Credits.new
    #
    ## New Edit 3/6/2007 11:14 PM by AvatarMonkeyKirby.
    # Ok, what I've done is changed the part of the script that was supposed to make
    # the credits automatically end so that way they actually end! Yes, they will
    # actually end when the credits are finished! So, that will make the people you
    # should give credit to now is: Unknown, MiDas Mike, and AvatarMonkeyKirby.
    #                                             -sincerly yours,
    #                                               Your Beloved
    # Oh yea, and I also added a line of code that fades out the BGM so it fades
    # sooner and smoother.
    #
    ## New Edit 24/1/2012 by Maruno.
    # Added the ability to split a line into two halves with <s>, with each half
    # aligned towards the centre.  Please also credit me if used.
    #
    ## New Edit 22/2/2012 by Maruno.
    # Credits now scroll properly when played with a zoom factor of 0.5.  Music can
    # now be defined.  Credits can't be skipped during their first play.
    #
    ## New Edit 20/8/2020 4:44 PM by #Not Important
    # Added auto crediting! <s> cannot be used now (did anyone even use it?).
    #==============================================================================
    
    #------------------------------------------------------------------------------
    # Global vars {do not change}
    $credits_added = []
    #------------------------------------------------------------------------------
    # \/ needed to check if the script exists
    def acs_check; acs=1; end
    #------------------------------------------------------------------------------
    class Scene_Credits
    CREDIT=<<_END_
    "Auto Crediting System" by #Not Important
    "Pokémon Essentials" was created by:
    Flameguru
    Poccil (Peter O.)
    Maruno
    
    With contributions from:
    AvatarMonkeyKirby
    Luka S.J.
    Boushy
    MiDas Mike
    Brother1440
    Near Fantastica
    FL.
    PinkMan
    Genzai Kawakami
    Popper
    help-14
    Rataime
    IceGod64
    SoundSpawn
    Jacob O. Wobbrock
    the__end
    KitsuneKouta
    Venom12
    Lisa Anthony
    Wachunga
    and everyone else who helped out
    
    
    
    "RPG Maker XP" by:
    Enterbrain
    
    Pokémon is owned by:
    The Pokémon Company
    Nintendo
    Affiliated with Game Freak
    
    This is a non-profit fan-made game.
    No copyright infringements intended.
    We just like Pokémon so much we wanted to make a game!.
    Please support the official games!
    
    _END_
    
      def main
    #-------------------------------
    # Animated Background Setup
    #-------------------------------
        @sprite = IconSprite.new(0,0)
        @backgroundList = CreditsBackgroundList
        @backgroundGameFrameCount = 0
        # Number of game frames per background frame.
        @backgroundG_BFrameCount = CreditsFrequency * Graphics.frame_rate
        @sprite.setBitmap("Graphics/Titles/"+@backgroundList[0])
    #------------------
    # Credits text Setup
    #------------------
        new_lines=""
        for i in $credits_added
          new_lines = (new_lines + (i + "\n"))
        end
        credit_lines = new_lines + CREDIT
        credit_lines = credit_lines.split(/\n/)
        credit_bitmap = Bitmap.new(Graphics.width,32 * credit_lines.size)
        credit_lines.each_index do |i|
          line = credit_lines[i]
          line = line.split("<s>")
          # LINE ADDED: If you use in your own game, you should remove this line
          pbSetSystemFont(credit_bitmap) # <--- This line was added
          x = 0
          xpos = 0
          align = 1 # Centre align
          linewidth = Graphics.width
          for j in 0...line.length
            if line.length>1
              xpos = (j==0) ? 0 : 20 + Graphics.width/2
              align = (j==0) ? 2 : 0 # Right align : left align
              linewidth = Graphics.width/2 - 20
            end
            credit_bitmap.font.color = CREDITS_SHADOW
            credit_bitmap.draw_text(xpos,i * 32 + 8,linewidth,32,line[j],align)
            credit_bitmap.font.color = CREDITS_OUTLINE
            credit_bitmap.draw_text(xpos + 2,i * 32 - 2,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos,i * 32 - 2,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos - 2,i * 32 - 2,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos + 2,i * 32,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos - 2,i * 32,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos + 2,i * 32 + 2,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos,i * 32 + 2,linewidth,32,line[j],align)
            credit_bitmap.draw_text(xpos - 2,i * 32 + 2,linewidth,32,line[j],align)
            credit_bitmap.font.color = CREDITS_FILL
            credit_bitmap.draw_text(xpos,i * 32,linewidth,32,line[j],align)
          end
        end
        @trim=Graphics.height/10
        @credit_sprite = Sprite.new(Viewport.new(0,@trim,Graphics.width,Graphics.height-(@trim*2)))
        @credit_sprite.bitmap = credit_bitmap
        @credit_sprite.z = 9998
        @credit_sprite.oy = -(Graphics.height-@trim) #-430
        @frame_index = 0
        @bg_index = 0
        @pixels_banked = 0
        @zoom_adjustment = 1.0/$ResizeFactor
        @last_flag = false
    #--------
    # Setup
    #--------
        #Stops all audio but background music.
        previousBGM = $game_system.getPlayingBGM
        pbMEStop
        pbBGSStop
        pbSEStop
        pbBGMFade(2.0)
        pbBGMPlay(CreditsMusic)
        Graphics.transition
        loop do
          Graphics.update
          Input.update
          update
          if $scene != self
            break
          end
        end
        Graphics.freeze
        @sprite.dispose
        @credit_sprite.dispose
        $PokemonGlobal.creditsPlayed=true
        pbBGMPlay(previousBGM)
      end
    
    ##Checks if credits bitmap has reached it's ending point
      def last?
        if @frame_index > (@credit_sprite.bitmap.height + Graphics.height + (@trim/2))
          $scene = ($game_map) ? Scene_Map.new : nil
          pbBGMFade(2.0)
          return true
        end
        return false
      end
    
    #Check if the credits should be cancelled
      def cancel?
        if Input.trigger?(Input::C) && $PokemonGlobal.creditsPlayed
          $scene = Scene_Map.new
          pbBGMFade(1.0)
          return true
        end
        return false
      end
    
      def update
        @backgroundGameFrameCount += 1
        if @backgroundGameFrameCount >= @backgroundG_BFrameCount        # Next slide
          @backgroundGameFrameCount = 0
          @bg_index += 1
          @bg_index = 0 if @bg_index >= @backgroundList.length
          @sprite.setBitmap("Graphics/Titles/"+@backgroundList[@bg_index])
        end
        return if cancel?
        return if last?
        @pixels_banked += CreditsScrollSpeed
        if @pixels_banked>=@zoom_adjustment
          @credit_sprite.oy += (@pixels_banked - @pixels_banked%@zoom_adjustment)
          @pixels_banked = @pixels_banked%@zoom_adjustment
        end
        @frame_index += CreditsScrollSpeed # This should fix the non-self-ending credits
      end
    end
    
    def pbAddCredits(name,script)
      $credits_added.push(script + ' by ' + name)
    end
    Enjoy!
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    You'll still have to manually check if a script does or doesn't use your Auto-Crediting System, and manually add the author to your credits if it doesn't, though.
     
    Back
    Top