Credits Script Remake
#1
Credits Script Remake
by avatarmonkeykirby
Mar 10 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


A newer version has been made, click here to see it.



Hello.
Many of you have seen this script I'm sure, and if you did you probably noticed that after the credits where through they didn't disappear and you had to push C instead. Well I got sick of it and decided to fix it. Now it ends when it should, and it also fades out the BGM automatically.
Here's the script. I've also got a demo, not that you should actually need it. But it's there if you do.

Code:
CREDITS_FONT = ["Calligraph421 BT", "Viner Hand ITC", "Arial", "Times New Roman"]
CREDITS_SIZE = 24
CREDITS_OUTLINE = Color.new(0,0,127, 255)
CREDITS_SHADOW = Color.new(0,0,0, 100)
CREDITS_FILL = Color.new(255,255,255, 255)

#==============================================================================
# ¦ 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: UNKOWN, MiDas Mike, and AvatarMonkeyKirby.
#                                             -sincerely yours,
#                                               Your Beloved
# Oh yea, and I also added a line of code that fades out the BGM so it fades
# sooner and smoother.
#==============================================================================

class Scene_Credits

# This next piece of code is the credits.
#Start Editing
CREDIT=<<_END_
Credits Script DEMO

Director
---------------
Paul Baker

Scripts
---------------
Unknown
MiDas Mike
Paul Baker

Graphics
---------------
Enterbrain::RTP

Music and sound
---------------
Enterbrain::RTP

Mapping and Eventing
---------------
Enterbrain

Storyline
---------------


Beta Testers
---------------

Special Thanks
---------------

_END_
#Stop Editing
def main

#-------------------------------
# Animated Background Setup
#-------------------------------

@sprite = Sprite.new
#@sprite.bitmap = RPG::Cache.title($data_system.title_name)
@backgroundList = ["Black"] #Edit this to the title screen(s) you wish to show in the background. They do repeat.
@backgroundGameFrameCount = 0
# Number of game frames per background frame.
@backgroundG_BFrameCount = 3.4
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])

#------------------
# Credits text Setup
#------------------

credit_lines = CREDIT.split(/\n/)
credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
credit_lines.each_index do |i|
line = credit_lines[i]
credit_bitmap.font.name = CREDITS_FONT
credit_bitmap.font.size = CREDITS_SIZE
x = 0
credit_bitmap.font.color = CREDITS_OUTLINE
credit_bitmap.draw_text(0 + 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 + 1,i * 32 - 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 - 1,640,32,line,1)
credit_bitmap.font.color = CREDITS_SHADOW
credit_bitmap.draw_text(0,i * 32 + 8,640,32,line,1)
credit_bitmap.font.color = CREDITS_FILL
credit_bitmap.draw_text(0,i * 32,640,32,line,1)
end
@credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
@credit_sprite.bitmap = credit_bitmap
@credit_sprite.z = 9998
@credit_sprite.oy = -430 #-430
@frame_index = 0
@last_flag = false

#--------
# Setup
#--------

#Stops all audio but background music.
Audio.me_stop
Audio.bgs_stop
Audio.se_stop

Graphics.transition

loop do

Graphics.update
Input.update


update
# ????????????????
if $scene != self
break
end
end
# ?????????
Graphics.freeze
@sprite.dispose
@credit_sprite.dispose
end

##Checks if credits bitmap has reached it's ending point
def last?
    if @frame_index > (@credit_sprite.bitmap.height + 500)
       $scene = Scene_Map.new
       Audio.bgm_fade(10000) #approx 10 seconds
      return true
    end
      return false
    end

#Check if the credits should be canceled
def cancel?
    if Input.trigger?(Input::C)
      $scene = Scene_Map.new
      return true
    end
      return false
    end

#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
@backgroundGameFrameCount = @backgroundGameFrameCount + 1
if @backgroundGameFrameCount >= @backgroundG_BFrameCount
@backgroundGameFrameCount = 0
# Add current background frame to the end
@backgroundList = @backgroundList << @backgroundList[0]
# and drop it from the first position
@backgroundList.delete_at(0)
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])
end
return if cancel?
return if last?
@credit_sprite.oy += 1 #this is the speed that the text scrolls. 1 is default
#The fastest I'd recommend is 5, after that it gets hard to read.
@frame_index += 1 #This should fix the non-self-ending credits
end
end
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Emotion Script Ánemus 0 2,542 08-29-2008, 01:00 PM
Last Post: Ánemus
  Beran's iPod script Sniper308 0 3,006 08-09-2008, 01:00 PM
Last Post: Sniper308
  NeoABS & NeoSABS ()enemy processes script azrith001 0 2,703 04-04-2008, 01:00 PM
Last Post: azrith001
  Blur Effect Script Hadriel 0 2,953 01-30-2008, 01:00 PM
Last Post: Hadriel
  Warp Script Sheol 0 2,873 12-28-2007, 01:00 PM
Last Post: Sheol
  The Credits - Reloaded avatarmonkeykirby 0 2,571 11-19-2007, 01:00 PM
Last Post: avatarmonkeykirby
  AIM Script Pack vgvgf 0 3,190 09-13-2007, 01:00 PM
Last Post: vgvgf
  Audio Encryption Script InfiniteSpawn 0 2,577 05-09-2007, 01:00 PM
Last Post: InfiniteSpawn
  Leon Blade's Percent Script Leon Blade 0 2,590 03-05-2007, 01:00 PM
Last Post: Leon Blade
  Cogwheels original pixelmovement script!!! mechacrash 0 2,531 01-14-2007, 01:00 PM
Last Post: mechacrash



Users browsing this thread: 2 Guest(s)