Help - Search - Members - Calendar
Full Version: Quick question involving textboxes
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion
vvalkingman
I know this is probably simple and I can't believe I haven't figured it out as of yet...but when you put up a textbox is there a way to move on to the next line without the player having to mash enter? Example:

I'm attempting a cutscene and I want text boxes to pop up but I don't want the player to be able to just mash through it. Is there any other way to do this than having a picture with text on it already and just timing THAT with the wait command?

I am using rpg maker xp.
Jens of Zanicuud
You'll need a script to do what you need.
In fact, there is no way to force a window closing without modifying the Window_Message class.
I'll make an attempt and post it here while finished.

Jens

EDIT:

CODE
#==============================================================================
#=#============================================================================
# #** Jens of Zanicuud window control script
# #   -version 0.9
# #   -free use, just credit
# #   -free customization, however, posting on RRR the modified version is
# #    mandatory
# #   -you can find me on www.rpgrevolution.com
#=#============================================================================
#==============================================================================

#==============================================================================
# ** Message_Win module
#==============================================================================
module Message_Win
#==============================================================================
# * Invariables
#==============================================================================
  CANT_SKIP_SWITCH_ID = 1 #id of the switch. If this switch is active, message
                          #can't be skipped with Enter or Space
#==============================================================================
# * skip_message - forces the message window to close
# (call it this way: call script - Message_Win.skip_message)
#==============================================================================
  def Message_Win.skip_message
    #if there is a message window
    if $scene.is_a?(Scene_Battle) or
      $scene.is_a?(Scene_Map)     and
      $scene.message_window != nil
      #terminate message
      old_switch = $game_switches[CANT_SKIP_SWITCH_ID]
      $game_switches[CANT_SKIP_SWITCH_ID] = false
      $scene.message_window.terminate_message
      $game_switches[CANT_SKIP_SWITCH_ID] = old_switch
    end
  end
end

#==============================================================================
# *** WINDOWS
#==============================================================================
# edited: Window_Message
#==============================================================================

#==============================================================================
# ** Window_Message
#==============================================================================

class Window_Message < Window_Selectable
#==============================================================================
# * aliases
#==============================================================================
  alias skip_win_terminate_message terminate_message
#==============================================================================
# * terminate_message
#==============================================================================
  def terminate_message
    if $game_switches[Message_Win::CANT_SKIP_SWITCH_ID]
      return
    else
      skip_win_terminate_message
    end
  end
end

#==============================================================================
# *** SCENES
#==============================================================================
# edited: Scene_Battle
# edited: Scene_Map
#==============================================================================

#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#==============================================================================
# * public instance variables
#==============================================================================
  attr_reader :message_window
end

#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
#==============================================================================
# * public instance variables
#==============================================================================
  attr_reader :message_window
end


To close the window via script, use a call script like this:

CODE
Message_Win.skip_message


To prevent the player from skipping the message, choose a switch, set the id in the constant named CANT_SKIP_SWITCH_ID and turn it ON.
While the switch is ON, player can't skip messages.

I hope this can help, ask for troubleshooting anytime smile.gif

Jens
vvalkingman
Dude...your name is going to be in big bold letters in the credits for Monk lmao you are so frickin' awesome! *gives cookie*

edit: So how do you do this in the event? Do you have a text, have wait 20 frames, then script call? or script call, text, 20 frames? Neither work just wondering lol i'm probably missing something simple...

I also noticed that when you call the script no other text boxes after that pop up.
Jens of Zanicuud
It's more simple to do than to say, so I'll proceed with an example...
Basically, you'll need two events (or an event and a common event):

Main:
Event #1
Trigger: Parallel


1. Switches[CANT_SKIP_SWITCH_ID] = ON
2. Switches[id] = ON (a number you like) #activate this switch before every message you want to autoskip
2. Message: Hello!
4. rest of the event...
5. Switches[CANT_SKIP_SWITCH_ID] = OFF

Message autoskip:
Common Event or Event #2
Trigger: Parallel - Switch[id] == ON


1. Wait X frames
2. Script call: Message_Win.skip_message
3. Switch[id] == OFF

Feel free to ask if I wasn't clear enough.

Jens


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.