Help - Search - Members - Calendar
Full Version: AlphaWhelp's Comic Book Scenes
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
AlphaWhelp
Version - 0.1a
Author - AlphaWhelp
Release Date - 5/15/09


Introduction

For those of us who can draw... or have a big budget, but not nearly enough for a full animated movie, I have created a script which will add a comic book scene to your game. If you have ever played Folklore, you get the idea what kind of scene this can create for you (although it won't look anywhere near as fancy). This script is great for creating cut scenes in which you want to show action that simply can't be done with sprites and animations. You're on your own to get the comic pages, though.

Yes I know this can be done with events--but I wrote this script because...

1. It was an experiment to see if I could do it.
2. I was motivated to do it.
3. I like to program.
4. This makes adding comic book cutscenes to your game very very easy so you can do it without being an event command master.
5. The process for adding comic scenes is more streamlined with a script.

Features

Uhh, in case it wasn't obvious, this script only has one feature--add a comic book cutscene to your game


Script

[Show/Hide] AlphaWhelp's Comic Book Scene
CODE
=begin

This script allows you to quickly and easily add a comic book scene to
your game. When the script is called, it opens up by displaying the
first page of your comic. Pressing the enter key will turn to the
following page in your comic, accompanied by a nifty little page flip
sound effect. When you have reached the last page of your comic,
pressing the enter key once more returns you to the map.

Instructions:
To call a comic scene, make an script event command that looks like:
$scene = Scene_Comic_A.new

To put pages into your comic scene, first import your comic pages into
the Pictures folder in the resource manager, then, between the lines:
COMIC=<<_END_ and ENDCOMIC type the names of the pages in the order
that you wish to appear. Do not leave any blank lines between these
two lines because doing so will cause a black page.

Currently this script does not support multiple comic scenes, however
for every comic scene you wish to have in addition to the first,
simply copy and paste this script directly underneath itself, then
change the line "class Scene_Comic_A" into "class Scene_Comic_B" then
delete the lines in the second script between COMIC=<<_END_ and
ENDCOMIC and replace them with the pages of your second comic scene.
Then, to call the second comic scene, make a script event command:
$scene = Scene_Comic_B.new

There is no theoretical limit to the number of comic scenes you can
have this way, have fun and enjoy the script. Credit to AlphaWhelp.

-AlphaWhelp

Comic Book Scenes version 0.1a
Created 5/15/09 11:22 p.m.

=end

class Scene_Comic_A

# BEGIN CONFIGURATION

COMIC=<<_END_
Scene1
Scene2
Scene3
Scene4
ENDCOMIC
_END_

# END CONFIGURATION

def main
comic_pages = COMIC.split(/\n/)
@sprite = Sprite.new
Audio.me_stop
Audio.bgs_stop
Audio.se_stop
@firsttime = true
comic_pages.each_index do |i|
@page = comic_pages[i]
@keypressed = false
if @firsttime
@sprite.bitmap = Cache.picture(@page)
Graphics.transition
Graphics.update
@firsttime = false
else
until @keypressed
Input.update
Graphics.transition
Graphics.update
continue
end
end
if $scene != self
break
end
end
end

def cancel?
if Input.trigger?(Input::C)
if @page == "ENDCOMIC"
$scene = Scene_Map.new
@keypressed = true
return true
else
@sprite.bitmap = Cache.picture(@page)
@keypressed = true
Audio.se_play("Audio/SE/PageFlip")
return true
end
end
return false
end

def continue
return if cancel?
end
end


Customization

The only thing you will be able to change about this script is the sound effect that plays when flipping a page. There are many sound effect websites you can look up to find a page flip sound effect. It's a common enough sound effect that you can probably find one that is public domain, but if you get one with a credit for the one who recorded it, you must remember to credit that person in addition to me when using this script.


Compatibility

Barring bizarre circumstances that I can't even imagine, this script should be compatible with every other script you have in your game.


Screenshot

Can't really show you the script with screenshots.


DEMO

http://www.megaupload.com/?d=J7K8Z4M9


Installation

To install this script into an existing game, you will need these files...
http://www.megaupload.com/?d=SY1J62W2

Import PageFlip into Audio/SE and import the PNG files into Graphics/Pictures
the PNG files are provided for you to test the comic book scene--they are not an actual comic, just testing files.


FAQ

Q: How do I install this script?

A: Copy and paste it below Materials and above Main, but it doesn't matter where in between it goes. Do not forget to download the accompanying files or else your game will crash when it tries to access them.



Q: There's a completely blank black page in my comic?

A: You left a blank line in a place where the instructions specifically said don't leave a blank line. Please reread and follow the instructions provided in the script in its comments.


Credits

All credits to AlphaWhelp, please and thank you.

Terms and Conditions

You must credit me if you use the script, and you must credit whoever drew your comic. If you can draw your own comics, congratulations. YOU MAY NOT USE THIS SCRIPT AT ALL IF YOU PLAN ON USING COPYRIGHTED IMAGES IN YOUR COMIC SCENE WITHOUT PERMISSION FROM THE PERSON WHO DREW THEM. I DON'T CARE HOW OBSCURE THE IMAGE OR ARTIST IS. DON'T DO IT.
Lurking
Cool, but wish it was a little more robust.
AlphaWhelp
QUOTE (Lurking @ May 15 2009, 10:09 PM) *
Cool, but wish it was a little more robust.


What would you like me to add? No guarantees but if I think your suggestions are cool enough I'll get to work.

When I made this script, I stopped programming features once it accomplished everything that I needed it to accomplish for my game, so I understand that it might be a little lacking.

Edit: Lurking I can tell you're still reading this thread based on the little box at the bottom and you haven't replied for a while now. Honestly, if you're not going to give constructive criticism then don't reply. I would rather my thread be empty than filled up with useless garbage like that.
SojaBird
Perhaps you can look at my Read! script.
It can do the same, so perhaps you want to look in to it to find some usefull tips?

(Or just leave it and use my script tongue.gif)


Greatzz,
SojaBird.
AlphaWhelp
QUOTE (pim321 @ May 15 2009, 11:39 PM) *
Perhaps you can look at my Read! script.
It can do the same, so perhaps you want to look in to it to find some usefull tips?

(Or just leave it and use my script tongue.gif)


Greatzz,
SojaBird.


Your Read! script is very nice, and I like looking at other scripts to learn how to write them but yours doesn't really do the same thing mine does. Mine is a lot more simple. I made it in like 10 minutes.
SojaBird
10 min. is a quick one smile.gif

Well, my script CAN DO the same (display several pictures in a row (check the demo (in the bookshop on the counter))), though you can scroll trough them.

Well anyway, keep it up.
You'll be a good scripter soon and you'll be able to make it more easy to let the player use this script even with more easy wink.gif


Greatzz,
SojaBird.
CerberusXV
This seems fairly useful. I'll have to try and use it in one of my future games. (The comic in the demo is so beautiful...I've never seen a comic like that before =D)
AlphaWhelp
QUOTE (CerberusXV @ Jun 9 2009, 12:16 AM) *
This seems fairly useful. I'll have to try and use it in one of my future games. (The comic in the demo is so beautiful...I've never seen a comic like that before =D)


I no rite
amiko_16
Awesome idea smile.gif I'll have to try this out
Neosky5k
Sorry to necro, but that's the the great american way, that site is blocked so we can't download the demo, or the files that are needed. Does anyone have it? I'm sure we can just use the script but I don't remember what files were needed...
Night_Runner
The only necessary file is an audio file called PageFlip, which has to be played in the Audio/SE folder (see line 91 of the code, I'd probably just change "PageFlip" to "Cursor" or something that comes with RMVX by default since I'm lazy).

Other than that, you can see on lines 43 - 48 the code:
CODE
COMIC=<<_END_
Scene1
Scene2
Scene3
Scene4
ENDCOMIC
_END_

That tell the script to look for the fullscreen (544x416) images, called Scene1, Scene2, Scene3, Scene4 and ENDCOMIC which need to be put in the Graphics/Pictures folder.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.