!!

Welcome to Save Point!

Formerly known as RMVXP, Save-Point is a game creational forum that aids users in creating games using software like RPG Maker or Game Maker. Support is also available today for members and members can also upload and download resources and scripts to use in their games. If you are new or experienced we welcome you to register.

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[XP Script] Ending Credits Script
Emily_Konichi
Unregistered

 
Thanks:
Given thank(s) in post(s)

Save Points: 0sp
Awards:

Gender:
Favorite Maker:
Post: #1
Ending Credits Script

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).

Code:
CREDITS_FONT = "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
#------------------------------------------------------------------------------
#  ??????????????????
#==============================================================================

class Scene_Credits

  # This next piece of code is the credits. Please keep the Zelda teams credits.
  
    CREDIT=<<_END_

#Edit here

_END_
def main

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

@sprite = Sprite.new
#@sprite.bitmap = RPG::Cache.title($data_system.title_name)
@backgroundList = [""] #Edit this to the title screen(s) you wish to show in the background. They do repeat. Just put a comma in between each like this ["title1","title2"]
@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_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 #change this to Scene_Title.new if you wish it to go to title screen instead.
       Audio.bgm_fade(10000) #aprox 10 seconds
      return true
    end
      return false
    end

#Check if the credits should be cancelled
def cancel?
    if Input.trigger?(Input::C)
      $scene = Scene_Map.new #change this to Scene_Title.new if you wish it to go to title screen instead.
      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 recomend is 5, after that it gets hard to read.
@frame_index += 1 #This should fix the non-self-ending credits
end
end
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.)
03-07-2008 06:09 AM
Quote this message in a reply
Pherione Offline
I wish I were a bird :3

****
Posts: 280
Joined: May 2011
View My Download Submissions
Thanks: 0
Given 2 thank(s) in 16 post(s)

Save Points: 2,733sp
Awards:

Gender: Male
Favorite Maker: RPG Maker XP
Post: #2
RE: Ending Credits Script

This is a very useful script. Especially if you realize (as I did) that this script is totally not limited to just ending credits.
You can also use it to make for example a splash screen of scrolling text for your game to, for example, tell the game's story.

How? All you gotta do is duplicate the script, change the name and call command, write the text you want and call the script on the correct point of your game.

Upcoming RPG XP project: Legends of the Flaming Falcons
In a distant future an ancient threat stirs...heroes of old take up their arms once more.
For my writing project that includes my rmxp project I'm also maintaining a private wiki; if you wish to follow me, let me know.
My developer blog can be found here:
http://the-otherworld-tales.blogspot.be/

[Image: Gazeteer%20-%20Pherione.gif]
Gazetteer responsible for Pherione's Developer Interviews. My thread here.


More info or questions? PM me
07-01-2011 10:40 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


User(s) browsing this thread:
1 Guest(s)


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
   Battle Report Script Window style mageone 4 1,822 03-20-2013 10:51 PM
Last Post: KasperKalamity
   Z9 Project Protection Script Narzew 5 733 10-02-2012 03:18 PM
Last Post: Narzew
   Weather Script ccoa 26 4,055 08-30-2012 03:31 AM
Last Post: DerVVulfman
   Caterpillar Script ccoa 2 1,157 08-29-2012 04:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 58 14,580 08-04-2012 03:59 PM
Last Post: Zohran
   Data Backup Script 2.2 PK8 7 2,090 06-12-2012 03:15 PM
Last Post: PK8
   Veiw Range Script Near Fantastica 7 2,371 05-25-2012 03:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 3 938 04-09-2012 10:22 PM
Last Post: buddysievers
   Hearts of Iron 3 Menu Script Tigurus Fay 1 1,092 03-28-2012 10:49 PM
Last Post: Tigurus Fay
   Super Simple Vehicle Add-On: Script Call Transfer DerVVulfman 9 3,519 12-22-2010 05:46 AM
Last Post: DerVVulfman



 Quick Theme: