- Joined
- Nov 3, 2014
- Messages
- 7
- Reaction score
- 1
- First Language
- English
- Primarily Uses
For various reasons, I have two sets of dialogue that must be processed within a script instead of the event manager. I've been using the script calls I found here, and while they mostly work, the 'Show Text' call doesn't. The dialogue box appears, but it doesn't wait for the player to finish reading and hit a button for the script to keep running. I can't find anything about what needs to be included for the script call to work the same way as the event manager text box, and nothing I've tried seems to work.
If more detail is needed, an in-depth explanation of how my scripts interact with the problem is below.
If more detail is needed, an in-depth explanation of how my scripts interact with the problem is below.
The code below combines both messages into one long message with the face graphic of the second message. Both bubble icons appear at the same time, and when the player moves on from the dialogue box the screen fades out and the script continues. The fifth line of text appears in a new box, since each box can only have four lines, and still has the second message's face graphic. The game waits for the player to finish with the dialogue boxes before fading out the screen.
The code below shows the first dialogue box, runs all events other than the second message while the first message is active, and fades out the screen as soon as the message is gone. I attempted to debug this one further by shortening the first message to one line and adding '\^' so that it would immediately close the dialogue box. In that case, it displayed the second dialogue box while the screen faded out, then waited for the second dialogue box to exit before continuing with the script.
I debugged both scripts with console messages at each line of code, confirming that the game isn't just skipping them. The messages weren't originally labeled "m1" and "m2", but adding the names did nothing, and I left them in for clarity. Putting an Input.trigger? command between the boxes almost works, but it doesn't start waiting for input until after the dialogue box is gone, making the player hit the confirm button twice. Putting a wait command after the message means the game won't run the rest of the code until the wait is over, so the player has time to read, but once the wait is over the problem persists, so the solution only works if the wait is the same as the amount of time it takes the player to read, which is impossible to predict.
Code:
# suprise icon over monster
$game_map.events[ 1 ].balloon_id = 1
# monster dialogue
m1 = $game_message.face_name = 'Monster1'
m1 = $game_message.face_index = 0
m1 = $game_message.background = 0
m1 = $game_message.position = 2
m1 = $game_message.add("Hey, what are you doing out of your")
m1 = $game_message.add("room? Get back there now or I'll make")
m1 = $game_message.add("you!")
# angry icon over player
$game_player.balloon_id = 5
# player dialogue
m2 = $game_message.face_name = 'faces'
m2 = $game_message.face_index = 1
m2 = $game_message.background = 0
m2 = $game_message.position = 2
m2 = $game_message.add("Keep your filthy hands off me, you")
m2 = $game_message.add("monster!")
# fadeout screen
Fiber.yield while $game_message.visible
screen.start_fadeout(30)
wait(30)
The code below shows the first dialogue box, runs all events other than the second message while the first message is active, and fades out the screen as soon as the message is gone. I attempted to debug this one further by shortening the first message to one line and adding '\^' so that it would immediately close the dialogue box. In that case, it displayed the second dialogue box while the screen faded out, then waited for the second dialogue box to exit before continuing with the script.
Code:
# monster dialogue 1
m1 = $game_message.face_name = 'Monster1'
m1 = $game_message.face_index = 7
m1 = $game_message.background = 0
m1 = $game_message.position = 2
m1 = $game_message.add("Well well well, the little Princess")
m1 = $game_message.add("managed to escape her room.")
m1 = $game_message.add("Guard!")
# flip switch so teleporting guard is visible
$game_switches[47] = true
# move guard to just below player facing up
$game_map.events[8].set_direction(8)
$game_map.events[8].moveto( $game_player.x, $game_player.y + 1 )
RPG::SE.new("Teleport", 80, 100).play
wait(20)
# monster dialogue 2
m2 = $game_message.face_name = 'Monster1'
m2 = $game_message.face_index = 7
m2 = $game_message.background = 0
m2 = $game_message.position = 2
m2 = $game_message.add("Take the Princess back to her chamber.")
m2 = $game_message.add("Make sure she stays there this time.")
# angry icon over player
$game_player.balloon_id = 5
# fadeout screen
Fiber.yield while $game_message.visible
screen.start_fadeout(30)
wait(30)
I debugged both scripts with console messages at each line of code, confirming that the game isn't just skipping them. The messages weren't originally labeled "m1" and "m2", but adding the names did nothing, and I left them in for clarity. Putting an Input.trigger? command between the boxes almost works, but it doesn't start waiting for input until after the dialogue box is gone, making the player hit the confirm button twice. Putting a wait command after the message means the game won't run the rest of the code until the wait is over, so the player has time to read, but once the wait is over the problem persists, so the solution only works if the wait is the same as the amount of time it takes the player to read, which is impossible to predict.


