Zelaron Gaming Forum

Zelaron Gaming Forum (http://zelaron.com/forum/index.php)
-   RPGMaker (http://zelaron.com/forum/forumdisplay.php?f=188)
-   -   [RMXP] Intro - scrolling text (http://zelaron.com/forum/showthread.php?t=44506)

ironfist68 2008-01-30 06:46 AM

Intro - scrolling text
 
I know how to make character/text box intros, but what i really want is to make a scrolling text intro with a picture behind the text. Could someone give me a link, or tell me how i would do this? (This is for RPG maker XP)
Thanks in advance.

Goodlookinguy 2008-01-31 09:48 AM

Quote:

Originally Posted by ironfist68
I know how to make character/text box intros, but what i really want is to make a scrolling text intro with a picture behind the text. Could someone give me a link, or tell me how i would do this? (This is for RPG maker XP)
Thanks in advance.

This is easy to do I've done it. Make a picture, then make the screen scroll down, and it give the affect of a scrolling opening.

If you need me to explain more just say so.

I'll make a video if need be!

ironfist68 2008-02-06 05:33 AM

Ok well take this for an example, I found this script;
Code:

#=====================================================
#  *  Scrolling Text v 1.0
#    by shadowball
#    01.14.2008
#=====================================================
class Scrolling_Text < Window_Base
  def initialize
    super(0,480,500,512)
    self.contents = Bitmap.new(width - 32, height - 32)
    @text = {
    100 => 'Evil Eye Productions',
    101 => 'this does not mean anything',
    102 => 'Sentence 3',
    103 => 'Sentence 4',
    104 => 'Sentence 5',
    105 => '',
    106 => 'Sentence 6',
    107 => 'Sentence 7',
    108 => 'Sentence 8',
    109 => 'Sentence 9',
    110 => 'just another line of text',
    111 => 'Sentence 11',
    112 => "I don't know what I'm doing here",
    113 => '',
    114 => 'New Paragraph: Last Sentence'   
    }
    y = -32
    @text.sort.each do |keys, values|
      y += 32
      self.contents.draw_text(0,y,488,32, values)
    end
    self.opacity = 0
    refresh
  end
 
  def refresh
    self.y -= 1 if self.y > -512
  end
 
end

class Scroll

  def main
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.picture('scrollingtext')
    @shb_scroll_window = Scrolling_Text.new
    @shb_scroll_window.x = 80
    @shb_scroll_window.y = 480
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @shb_scroll_window.dispose
    @sprite.dispose
    @sprite.bitmap.dispose
  end

  def update
    # Update windows
    @shb_scroll_window.refresh
    if @shb_scroll_window.y == -512
      $scene = Scene_Map.new
    end
  end

end

And i have seen it work on a demo.. But the bad thing is, i have tried putting this in my script database.. everything seems to go fine, SO i've made my intro (Before the title)And put a conditional branch (if press a go to title) then i would have this script... And the scrolling text won't come up. I typed "$scene = Scroll.new into a Call script command yet it still won't come up, i have also tried this on one of my "Real game" Maos but to no avail...

Goodlookinguy 2008-02-06 01:41 PM

Are you saying that you want text in the form of going from top to bottom see though? Not like credits? Let me take a look at the ruby code I will take this code and try to rewrite it, and see if I can get it to work, I am alright at scripting with ruby.

----
Here is the full code and make sure to make a picture called "scrollingtext.jpg" and place it in pictures.

Code:

#=====================================================
#  *  Scrolling Text v 1.0
#    by shadowball
#    14.01.2008
#=====================================================
class Scrolling_Text < Window_Base
  def initialize(index)
    @index = index
    super(0,480,500,544)
    self.contents = Bitmap.new(width - 32, height - 32)
    case index
    when 0
      @text = {
      100 => 'Este script al menos sirve para dos cosas,',
      101 => 'a no ser que a Uds. se les ocurra otras más.',
      102 => '',
      103 => 'Es útil para esas introducciones con',
      104 => 'la historia de fondo de su juego, para',
      105 => 'dar inicio a un nuevo capítulo...',
      106 => 'O puede servir para los créditos también.',
      107 => 'Siempre me pregunté por qué debían verse',
      108 => 'tan estáticos o por qué se debían crear',
      109 => 'varias imágenes para algo tan sencillo.',
      110 => '',
      111 => 'Este script no les impide usar un fondo de',
      112 => 'pantalla. Si quieren, usen uno a su gusto.',
      113 => '',
      114 => 'Creo que esto es más fácil de editar en caso',
      115 => 'de errores ortográficos o de alineamiento.'
      }
    when 1
      self.contents.font.color = gold_color
      @text = {
      100 => 'Este es un ejemplo de cómo reutilizar el script',
      101 => 'en caso de que necesiten usarlo al inicio de un',
      102 => 'nuevo capítulo. Ah, lo demás está igual.',
      103 => 'Es útil para esas introducciones con',
      104 => 'la historia de fondo de su juego, para',
      105 => 'dar inicio a un nuevo capítulo...',
      106 => 'O puede servir para los créditos también.',
      107 => 'Siempre me pregunté por qué debían verse',
      108 => 'tan estáticos o por qué se debían crear',
      109 => 'varias imágenes para algo tan sencillo.',
      110 => '',
      111 => 'Este script no les impide usar un fondo de',
      112 => 'pantalla. Si quieren, usen uno a su gusto.',
      113 => '',
      114 => 'Creo que esto es más fácil de editar en caso',
      115 => 'de errores ortográficos o de alineamiento.'
      }
    end
    y = -32
    @text.sort.each do |keys, values|
      y += 32
      self.contents.draw_text(0,y,488,32, values)
    end
    self.opacity = 0
    refresh
  end
 
  def refresh
    self.y -= 1 if self.y > -544
  end
 
end

#=====================================================
#  *  Scroll (Scene) v 1.0
#    by shadowball
#    14.01.2008
#=====================================================

class Scroll
 
  def initialize(index = 0, pic = 0)
    @index = index
    @pic = pic
  end
 
  def main
    @sprite1 = Sprite.new
    @sprite1.bitmap = RPG::Cache.picture('scrollingtext')
    @sprite2 = Sprite.new
    if @pic == 1
      @sprite2.bitmap = RPG::Cache.picture('barranegra')
      @sprite2.z = 250
    end
    if @index == 0
      @shb_scroll_window = Scrolling_Text.new(0)
    elsif @index == 1
      @shb_scroll_window = Scrolling_Text.new(1)
    end
    @shb_scroll_window.x = 80
    @shb_scroll_window.y = 480
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @shb_scroll_window.dispose
    @sprite1.dispose
    @sprite1.bitmap.dispose
    if @pic == 1
      @sprite2.dispose
      @sprite2.bitmap.dispose
    end
  end

  def update
    # Update windows
    @shb_scroll_window.refresh
    if @pic == 0
      if @shb_scroll_window.y == -544
        $scene = Scene_Map.new
      elsif Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
      end
    elsif @pic == 1
      if @shb_scroll_window.y == -320
        $scene = Scene_Map.new
      elsif Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
      end
    end
  end
end

class Scene_Title
  def command_new_game
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Stop BGM
    Audio.bgm_stop
    # Reset frame count for measuring play time
    Graphics.frame_count = 0
    # Make each type of game object
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables    = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party        = Game_Party.new
    $game_troop        = Game_Troop.new
    $game_map          = Game_Map.new
    $game_player        = Game_Player.new
    # Set up initial party
    $game_party.setup_starting_members
    # Set up initial map position
    $game_map.setup($data_system.start_map_id)
    # Move player to initial position
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    # Refresh player
    $game_player.refresh
    # Run automatic change for BGM and BGS set with map
    $game_map.autoplay
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scroll.new
  end
end

--EDIT

One more thing make a non-touchable event off screen run this unter the script command "$scene = Scroll.new(1,1)"

ironfist68 2008-02-06 06:46 PM

Ok, your code seems great, i mean it is great. But it won't work.. This is what i have done; In my intro (Before the title) I have put a conditional branch -
COnditional branch - if a button is pressed return to title.. I also have the scrolling text. But the thing is.. The scrolling text won't coem up therefore it
will not go to my title screen... So this event is an auto run (I have also tried it with parralel process) But nothing. I know how to make events and use switches and variables.. But this one just screwes me up.

ironfist68 2008-02-06 06:51 PM

Omg man you rock!!! I fixed up just the thing i had to set it to - Speed: FAster for your script to work! IF you want i will add you to the credits! :D I am so happy now.

Goodlookinguy 2008-02-06 07:14 PM

Quote:

Originally Posted by ironfist68
Omg man you rock!!! I fixed up just the thing i had to set it to - Speed: FAster for your script to work! IF you want i will add you to the credits! :D I am so happy now.

Sure if you want.


All times are GMT -6. The time now is 10:11 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.