Show Text script call not working

Status
Not open for further replies.

dott

Villager
Member
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.

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.

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.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Whenever you want it to wait until the player confirms the message, you have to use this line:
Code:
wait_for_message
So use it after the last $game_message.add("...") lines to make the game wait for player input before doing anything else that comes below in the script call.

Those m1/m2= parts just make the lines longer, but they won't do anything (well, aside from setting that local variable over and over again), so get rid of those.
If you want to label things in code, use comments instead like you did with those comment lines separating each section of the code.
 

dott

Villager
Member
Joined
Nov 3, 2014
Messages
7
Reaction score
1
First Language
English
Primarily Uses
Thank you very much, this worked perfectly!
 

SlingB

Villager
Member
Joined
Jan 16, 2018
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hi, I have the same problem but in RPG MV.

$gameMessage.add("Blah blah blah.");
wait_for_message;

How do I use this in RPG maker MV scripting?
_ I think a better idea is I will ask this as a new question in the MV forum.
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP
_ I think a better idea is I will ask this as a new question in the MV forum.
Please do as Mv uses an entirely different language than Ace.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top