Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Show Text command with script?

Hey guys, I was wondering if you can tell me how to make a script that will do the same thing as "show text" and then how to call it using the "script" command in an event? Thanks for any advice.
 
Veressen, I read the entire post and I did not see anywhere any instruction to call a scripted message from the "script" command in events, mainly because the script in that thread is not called with events. The problem I am having is I want to display message dialogues in japanese in my game, however RPG Maker XP won't let me put japanese characters anywhere inside the editor except inside the script editor. Therefore, in order to do this I need to be able to script the dialogue, then call it with an event.

Something like this:

(Inside script editor)
Message1 = "このメッセージは日本語です"

(Inside call script event)

Message.Call = Message1

Of course this won't work, l am not good at ruby scripting. But this is what I'm trying to do. Does anyone know how I can do this? It seems rather simple but I'm not good at ruby scripting so I wouldn't know for sure. Thanks for any advice. And sorry I wasn't more specific in my first post.
 
Thanks for the reply Vergessen. I don't know exactly what to do with that snippet of script you posted. I need the text that's going to be in the message in a script in the script editor, then I need to be able to call that text in the script editor with an event. Fortunately, I figured out how to get Japanese characters into the editor, so I'm going to do it that way instead. But if for any reason I come across another problem doing it that way, I'll be coming back here.
 
you said you wanted it in a event, so go to the last page of the event options where it says script at the bottom of the right column.
4qquk8.jpg
 
No, that's not what I meant. I wanted the text that will go in the message to be in the "script editor" not the "script" command in an event because before hand I could not put japanese characters in the "script" command in an event or anywhere else in the actual editor except for the "script editor". Then I needed to call the japanese dialogue from the "script editor" by using the "script command" in an event. Thankfully though I did figure out how to get Japanese characters in the editor.
 

Zeriab

Sponsor

First of all you should specify a font that includes Japanese characters such as Arial Unicode MS or you will just get a blank dialog.
Let's assume that you have inserted a new section in the editor somewhere above Main with the following code:
Code:
Font.default_name = ["Arial Unicode MS", "Arial"]

Message1 = "このメッセージは日本語です"

You can use variables to store the message such as:
Code:
$game_variables[42] = Message1
Followed by a Show Message with \v[42] in it.
Storing a string in a variable is dangerous since you can easily crash the game if you use the variable for anything else.

An alternate form as Vergessen mentioned is to deal directly with $game_temp.message_text. You can display the message with two consecutive script calls:
Code:
$game_temp.message_text = Message1.dup
Code:
$game_temp.message_text.nil?

If you have my script call interpreter fix then the second script call should be:
Code:
:wait if $game_temp.message_text != nil

If you have any other interpreter script call 'fix' then it probably won't. (Read: Fixes that work by removing functionality)

*hugs*
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top