Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
EmilyAnnCoons

Ending Credits Script

Recommended Posts

Note: This is NOT my script. I found it in the Project Zelda Engine. I did, however, edit it so that it may be called with $scene = Scene_Credits.new instead of having it appear on the Title Screen (which is very annoying). Also, it was edited by AvatarMonkeyKirby to actually end by itself. So if used, at least give credit to the two of us, and label one other as "Unknown" as I currently don't know who made it.

If you are the original author of this script, please say so and I will give credit ASAP (basically...whenever I see your post).

 

CREDITS_FONT = ["Times New Roman"]CREDITS_SIZE = 24CREDITS_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 (now known as Emily_Konichi) 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, Emily_Konichi, 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.#==============================================================================class Scene_Credits# This next piece of code is the credits.CREDIT=<<_END_#Start EditingCredits!--------------Here you can makea list of people whomade the project.Like regular endingcredits to any normalvideo game out there!Yay!#Stop Editing_END_def main#-------------------------------# Animated Background Setup#-------------------------------@sprite = Sprite.new#@sprite.bitmap = RPG::Cache.title($data_system.title_name)@backgroundList = ["Pic_2"] #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 txt 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_FONTcredit_bitmap.font.size = CREDITS_SIZEx = 0credit_bitmap.font.color = CREDITS_OUTLINEcredit_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_SHADOWcredit_bitmap.draw_text(0,i * 32 + 8,640,32,line,1)credit_bitmap.font.color = CREDITS_FILLcredit_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_stopAudio.bgs_stopAudio.se_stopGraphics.transitionloop doGraphics.updateInput.updateupdateif $scene != selfbreakendendGraphics.freeze@sprite.dispose@credit_sprite.disposeend##Checks if credits bitmap has reached it's ending pointdef last?	if @frame_index > (@credit_sprite.bitmap.height + 500)	   $scene = Scene_Map.new	   Audio.bgm_fade(10000) #aprox 10 seconds	  return true	end	  return false	end#Check if the credits should be cancelleddef cancel?	if Input.trigger?(Input::C)	  $scene = Scene_Map.new	  return true	end	  return false	enddef update@backgroundGameFrameCount = @backgroundGameFrameCount + 1if @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])endreturn if cancel?return if last?@credit_sprite.oy += 1 #this is the speed that the text scrolls. 1 is default#The fastest I'd recomend is 5, after that it gets hard to read.@frame_index += 1 #This should fix the non-self-ending creditsendend

 

So, anyway, what this does is it plays the ending credits. You simply start the music you want (usually I put the player on a special map specifically for the Ending Credits) and then run an Auto-run process and call the script "$scene = Scene_Credits.new" (without the quotation marks...DUH!!!)

 

It will automatically put the words in the center of the screen, so you won't have to worry about that. Any questions, feel free to ask...not sure if I can answer or not, though...It is SDK compatible (thanks to Master Inuyasha for finding out for me.)

 

DEMO: http://www.rmxpunlimited.net/forums/index....amp;showfile=10

Ending Credits Script.zip

Share this post


Link to post
Share on other sites

I have this on my site :P . But you dont have to put them at the end you know.. you could put them at the start of the game.. but i prefer not using script for that. I just use events :D and a intro scene kind of thing...

Share this post


Link to post
Share on other sites
Can u putt a BMG on this script??

Yep just add this under def main

Audio.bgm_play("Audio/BGM/" + "Name of your music here", 100, 100)

 

I have one question. Can you make it where it ends and goes to the map (without hitting space) after the credits are done?

Share this post


Link to post
Share on other sites

For anyone who is using this script, please update to the new version (The new version isn't in the demo, it's only in the codebox...sorry). It ends after the credits finish rolling, and switches to the map afterwards.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...