Author Topic: [XP] Script-Command Messages  (Read 8962 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
[XP] Script-Command Messages
« on: July 14, 2010, 11:34:41 PM »
Script-Command Messages
Authors: ForeverZer0
Version: 1.0
Type: Message Add-on
Key Term: Message Add-on

Introduction

Very simple fix to a (personally) irritating problem with the normal text command for events.  I prefer to use slightly smaller font sizes for my games, but with the default event command system, I am forced to break to a new line at intervals, even though the text does not even extend to the end of the message box. This script will fix that issue by using the "Script"command to write your text in, and automatically size the lines correctly and go to the next line only when required, and even to a second box if the total text does not fit in a single message box.

Features

  • Very simple to use, merely uses the "Script" command instead of the "Show Text" command.
  • Automatically breaks to new lines, but only when needed.
  • Automatically breaks to a new message box if total text does not fit in one.
  • Can fit much more text into message boxes.
  • Very high compatibility with all(?) message systems out there. It creates the proper "Show Text" commands on the fly, so it does not alter any scripts, just reorganizes how the event command is interpreted.

Screenshots

None.

Demo

None.

Script

Here's the script.
(click to show/hide)

Instructions

Uses a single, simple script command (see script).

Compatibility

Should be compatible with everything, including exotic message systems.

Credits and Thanks

  • ForeverZer0, for script.
  • Blizzard, for the slice_text method

Author's Notes

Enjoy!
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline WhiteRose

  • Trying to code in Ruby
  • Moderator
  • Lexima Warrior
  • ***
  • Posts: 2341
  • LV: 127
  • Gender: Female
  • <3
    • View Profile
Re: [XP] Script-Command Messages
« Reply #1 on: July 17, 2010, 05:50:08 AM »
<3

You have just corrected one of the last major problems with RMXP.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Script-Command Messages
« Reply #2 on: July 18, 2010, 11:55:04 PM »
<3

You have just corrected one of the last major problems with RMXP.

 8)
Just trying to fix a stupid simple problem in a simple way. Though I know many could care less about this.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline WhiteRose

  • Trying to code in Ruby
  • Moderator
  • Lexima Warrior
  • ***
  • Posts: 2341
  • LV: 127
  • Gender: Female
  • <3
    • View Profile
Re: [XP] Script-Command Messages
« Reply #3 on: July 19, 2010, 01:40:41 AM »
I do have one question. Will messages typed using this script be compatible with scripts (particularly the UMS) that use in-message codes? For example, when I write dialog in games in which the UMS is used, I will add pauses between sentences by typing \p[30] to make it sound more natural, like someone is actually speaking.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Script-Command Messages
« Reply #4 on: July 19, 2010, 02:38:58 AM »
I do have one question. Will messages typed using this script be compatible with scripts (particularly the UMS) that use in-message codes? For example, when I write dialog in games in which the UMS is used, I will add pauses between sentences by typing \p[30] to make it sound more natural, like someone is actually speaking.

I didn't test it with UMS, but it should still work the same. It still runs the code through the normal Window_Message class. I know that in other message systems (not sure about the UMS) the refresh method of this is what searches for patterns to replace. You will still have to use the double backslashes, which is a minor bug I haven't worked out yet.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline lonely_cubone

  • Transcended Spirit
  • ***
  • Posts: 227
  • LV: 6
  • Gender: Male
  • OMG IT'S A CUBONE
    • View Profile
Re: [XP] Script-Command Messages
« Reply #5 on: July 19, 2010, 06:43:59 PM »
8)
Just trying to fix a stupid simple problem in a simple way. Though I know many couldn't care less about this.

Sorry, it really bugs me when people say that wrong. :P

Anyways, this script is amazing! The only problem is, I have to go through all my games now and change all the text, but it's worth it. Level up!

Offline poxy

  • Transcended Spirit
  • ***
  • Posts: 184
  • LV: 16
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #6 on: July 19, 2010, 11:02:13 PM »
This is pretty handy. Nice to put down longer messages in one go if you are using message codes like in UMS. Though RMXP still tries to sneak in return cases where they're not wanted in the script command -.- ...
(click to show/hide)

Offline Sacred Nym

  • Awakened Visionist
  • **
  • Posts: 70
  • LV: 0
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #7 on: July 20, 2010, 09:47:52 AM »
I'm trying not to be rude about this, but this is the single most useless script I have ever seen. It's basically a glorified batch-text entry command (which does exist in RMXP for those who aren't aware) that can't seem to handle line breaks properly. Don't believe me?

Here's what I did with Batch Text Entry:
(click to show/hide)

Same thing, done with the Script:
(click to show/hide)

The Script call of the above, for reference
(click to show/hide)

As a result of this, the user is required to relinquish formatting control to the computer, which is BAD. I want my text boxes done my way.

Also the script removes instances of multiple spaces in a row, and fails to run on strings that start with a space. Yay for removing options! :V:

On top of this, the script fails to function in battle. If it's in the actual game, the script simply does nothing. If it's in Battle test mode however, you get this error.
(click to show/hide)

And ANOTHER thing. The feature of automatically splitting text up into each window, the main reason why Batch text entry exists in RMXP, is severely weakened by the small size of the Call Script box. And no, it doesn't scroll.

Finally, this script brings absolutely nothing new that RMXP can't do already. This is less than a glorified Batch entry window with formatting options thrown out the window. I simply don't understand why everyone is jumping for joy over this.  :uhm:
Quote
昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #8 on: July 20, 2010, 02:55:02 PM »
Use
Code: [Select]
"LINE1\nLINE2" to split lines. I can't remember if the 'n' should be capital or not.

But I'm still wondering: why can't your rewrite the Message script, so that it can also be done with the event command?

Offline lonely_cubone

  • Transcended Spirit
  • ***
  • Posts: 227
  • LV: 6
  • Gender: Male
  • OMG IT'S A CUBONE
    • View Profile
Re: [XP] Script-Command Messages
« Reply #9 on: July 20, 2010, 03:18:33 PM »
But I'm still wondering: why can't your rewrite the Message script, so that it can also be done with the event command?
The whole point is to get rid of the width restrictions imposed by the size of the box in the event command. That's why it uses the script command instead.

Use
Code: [Select]
"LINE1\nLINE2" to split lines. I can't remember if the 'n' should be capital or not.
Again, this defeats the purpose, because the text is supposed to be made to fit into the box automatically. That's the point of the script.

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #10 on: July 20, 2010, 06:31:50 PM »
@Cube: 1) Aha!
2) I was answering Sacred's question.

Offline Sacred Nym

  • Awakened Visionist
  • **
  • Posts: 70
  • LV: 0
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #11 on: July 20, 2010, 07:15:04 PM »
Use
Code: [Select]
"LINE1\nLINE2" to split lines. I can't remember if the 'n' should be capital or not.
The script reads \n as a space. Even if it did work, that sort of thing should be in the instructions, so it would change my criticism instead of removing it.

The whole point is to get rid of the width restrictions imposed by the size of the box in the event command. That's why it uses the script command instead.
This is why you use Batch text entry. I agree that the 3 line box is a flaw in RMXP (which didn't exist in fanlations, if memory serves). But there's Batch text entry which gives you 22 lines of text that will automactically be split into individual show text commands. All without fucking your formatting.Sure it's not completely easy to edit later, but this is a non-issue if you actually prep and proofread in the text editor of your choice.

Again, this defeats the purpose, because the text is supposed to be made to fit into the box automatically. That's the point of the script.
Did you even read my post? :uhm: Taking away options in order to do something that RMXP is already capable of (without revoking aforementioned options or introducing other flaws) is a waste.
Quote
昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

Offline WhiteRose

  • Trying to code in Ruby
  • Moderator
  • Lexima Warrior
  • ***
  • Posts: 2341
  • LV: 127
  • Gender: Female
  • <3
    • View Profile
Re: [XP] Script-Command Messages
« Reply #12 on: July 20, 2010, 07:51:51 PM »
Don't worry; F0 knows what he's doing. Like everyone else around here, he's trying to help people use the RMXP engine to its fullest potential. Take a look at his other scripts -- does that look like something an amateur who doesn't know how to properly use the Batch Entry command would produce? Of course not. Having spent many hours frustrated with the default text entry system and the way it cuts off text for no apparent reason, I'm very appreciative of F0 and his decision to create and release this script. If you don't like it, no one is forcing you to use it.

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #13 on: July 20, 2010, 09:39:56 PM »
Use
Code: [Select]
"LINE1\nLINE2" to split lines. I can't remember if the 'n' should be capital or not.
The script reads \n as a space. Even if it did work, that sort of thing should be in the instructions, so it would change my criticism instead of removing it.

The whole point is to get rid of the width restrictions imposed by the size of the box in the event command. That's why it uses the script command instead.
This is why you use Batch text entry. I agree that the 3 line box is a flaw in RMXP (which didn't exist in fanlations, if memory serves). But there's Batch text entry which gives you 22 lines of text that will automactically be split into individual show text commands. All without fucking your formatting.Sure it's not completely easy to edit later, but this is a non-issue if you actually prep and proofread in the text editor of your choice.

Again, this defeats the purpose, because the text is supposed to be made to fit into the box automatically. That's the point of the script.
Did you even read my post? :uhm: Taking away options in order to do something that RMXP is already capable of (without revoking aforementioned options or introducing other flaws) is a waste.

I thought
Code: [Select]
\s was a space?

Offline poxy

  • Transcended Spirit
  • ***
  • Posts: 184
  • LV: 16
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #14 on: July 21, 2010, 01:08:33 AM »
The batch text entry is new to me... I just read up on it. But it's still flawed, as it has the same width as the show text command.

Scenario: me typing a message using CCoa's UMS, adding /p[10] after commas, the /p[10]s manage to push the last word down one line, where the word would print normally without the /p[10]s. Same story using batch text entry and this script (unfortunately :()

Idea: a script similar to this one that discounts return cases and only allows line break using a visible command such as /n. Though I don't know if that's more likely to cause incompatibility... well, it's just a suggestion.
(click to show/hide)

Offline Sacred Nym

  • Awakened Visionist
  • **
  • Posts: 70
  • LV: 0
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #15 on: July 21, 2010, 04:46:50 AM »
I thought
Code: [Select]
\s was a space?
That's not at all what I was trying to say. That example you gave me, just try it yourself with this script.

The batch text entry is new to me... I just read up on it. But it's still flawed, as it has the same width as the show text command.

Scenario: me typing a message using CCoa's UMS, adding /p[10] after commas, the /p[10]s manage to push the last word down one line, where the word would print normally without the /p[10]s. Same story using batch text entry and this script (unfortunately :()

Idea: a script similar to this one that discounts return cases and only allows line break using a visible command such as /n. Though I don't know if that's more likely to cause incompatibility... well, it's just a suggestion.

Hm, I do see what you mean there. I typically don't use \p for that particular reason. I'm more likely to let soft pauses like commas slide and break to a new window when there's a hard pause (ie. long enough to take a breath). Fit Window to Text helps a lot too. :D

Regarding your idea, and I'm only assuming this is possible, perhaps rather than full manual on line breaks, instead a system where you concatenate one line of text to the next. As an example,
Code: [Select]
Man:
"1 2 3\+
4 5 6"

Would return:
Quote
Man:
"1 2 3 4 5 6"

Much less annoying and less space wasting in the box than \n on every line.
Quote
昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Script-Command Messages
« Reply #16 on: July 22, 2010, 12:04:57 AM »
@sacred nym
Sorry, I did not mean for this script to offend you on such a personal level. I promise you it was not intentional, and I want you to know just how sorry I am for even thinking of writing this, and I beg for your full forgiveness so that I can sleep tonight.

@whiterose
Amen. Thank you, but I'm afraid sacred nym is just so upset from my obvious personal attack of writing the script, and absolute and total ignorance of RMXP to understand what you meant.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Sacred Nym

  • Awakened Visionist
  • **
  • Posts: 70
  • LV: 0
  • Gender: Male
    • View Profile
Re: [XP] Script-Command Messages
« Reply #17 on: July 22, 2010, 07:06:04 AM »
@sacred nym
Sorry, I did not mean for this script to offend you on such a personal level. I promise you it was not intentional, and I want you to know just how sorry I am for even thinking of writing this, and I beg for your full forgiveness so that I can sleep tonight.

@whiterose
Amen. Thank you, but I'm afraid sacred nym is just so upset from my obvious personal attack of writing the script, and absolute and total ignorance of RMXP to understand what you meant.
Hold up right there. I'm not offended at all. Though maybe I should be offended that you think I'm offended. :V: Nah, I was just in a ranty mood when I posted earlier (also it was 2 in the morning).

To add to my earlier statements. Is this script hellishly flawed? Yes. Can it be fixed? Yes. Some if not all of the flaws can be fixed and/or worked around. Like the bit about the tiny Call Script box. Worked around by storing strings in a module or something then calling that. Doesn't even really need effort on your part, just a suggestion amongst the instructions or even the framework already set up.

Again, I'm sorry if I sounded ranty, just felt I needed to point out the flaws so you could try to fix them.

I also mucked with the script a bit to try and add forced Line Breaks with a code. I have something that seems to work though not perfectly, and it seems a bit clunky. If you like I can PM you the edit, perhaps something to work from, maybe. (I have no confidence in my scripting abilities >.>)
Quote
昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Script-Command Messages
« Reply #18 on: July 23, 2010, 10:43:49 PM »
As for a module storing long strings, that kind of defeats the purpose of a quick on the fyly edit. I was just bored and decided to mess around with the message system. I write a lot of stuff, some of it better than others. I post a lot of it and see if anybody can make use it.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline lonely_cubone

  • Transcended Spirit
  • ***
  • Posts: 227
  • LV: 6
  • Gender: Male
  • OMG IT'S A CUBONE
    • View Profile
Re: [XP] Script-Command Messages
« Reply #19 on: August 12, 2010, 11:16:53 PM »
Is there any reason this isn't in the database? I've been using it, and it's a really helpful little script :D