Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed
Character's Textbox Version 1.0 by Woratana Release Date: 21/05/2008
Introduction This script will create the text box for each character (Player and events).
You can set and remove text for each character by call script. You can also set SE for textbox, and change textbox properties (Position / Opacity / Windowskin).
Features Version 1.0 - Show Textbox above character (Player and/or Event) - Change textbox's opacity and position (in script) - Choose to use sound effect when show textbox (in script)
- There is instruction in the script 1. Setup this script in SETUP part below
2. To set text to character's textbox, call script:
CODE
set_text(character, new_text)
* character: What character you want to set this text? ** -1 for 'Player', 0 for 'This Event', and 1 or more for Event ID * new_text: What is the text you want to show? ** write text in 'text here' or "text here"
For example:
CODE
set_text(10,'Hello!')
* Script above will show text 'Hello!' over event ID 10.
3. To clear textbox, call script:
CODE
set_text(character, '')
Author's Notes Free for use in your work if credit is included.
Please do not redistribute this script without permission. If you want to post it on any forum, please link to this topic.
Bug Report? Please give me these informations:
QUOTE
- What is it says in error window? - When is it get error? (Right after run game, when you choose something, etc.) - What have you changed in setting part? - Do you have any other scripts running in your game that may crash with this script?
nice one wora but can't we change the font color or sth? I actualy want to use this as a '!' and '?' system for questing...I tried some myself but can't figure out jet how to change the font.color (and not to 'normal_color' or 'system_color')
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
Group: Member
Posts: 46
Type: Event Designer
RM Skill: Advanced
Hey Wortana is there a way to erase all the boxes at once? when i try to put erase each one individualy it gives me an error, probably for putting more than 1 set_text on one event
Group: Member
Posts: 23
Type: None
RM Skill: Undisclosed
I tried this script but I don't see the window. I just get the letters. I thought maybe I don't have my window skin in the system folder, but I checked and I do, so what am I doing wrong?
Group: Member
Posts: 23
Type: None
RM Skill: Undisclosed
QUOTE (enix2 @ Oct 10 2008, 11:56 PM)
change line 47 from:
CODE
TEXTBOX_OPACITY = 0 # Textbox Opacity (0 - 255)
to:
CODE
TEXTBOX_OPACITY = 255 # Textbox Opacity (0 - 255)
Thank you for the answer. In the mean time I managed to figure it out myself, but now I have another problem. It seems I cannot make long sentances because I get a syntax error. I can only write one liners like Hello, or How are you? When I try something longer I get a syntax error. I also don't know how to turn off the textbox once I have talked with the character. It says in the script you have to type: set_text(character, ''), but when I do that I can't get my first dialog screen with Hello at all. What am I doing wrong? :S
In the mean time I managed to write a longer sentance but I get a square instead of my text going down and everything is in one line :S I want to make it look like this: Hi there! My name is Sonya and I need your help. You see I have lost a gem not far from here.
and I get this: Hi there! My name is Sonya and I need your help. [_] You see I have lost a gem not far from here.
I can't even see the whole sentance. :S
This post has been edited by Mareus: Oct 11 2008, 02:20 AM
Group: Member
Posts: 47
Type: Event Designer
RM Skill: Skilled
QUOTE (Mareus @ Oct 11 2008, 05:12 AM)
QUOTE (enix2 @ Oct 10 2008, 11:56 PM)
change line 47 from:
CODE
TEXTBOX_OPACITY = 0 # Textbox Opacity (0 - 255)
to:
CODE
TEXTBOX_OPACITY = 255 # Textbox Opacity (0 - 255)
Thank you for the answer. In the mean time I managed to figure it out myself, but now I have another problem. It seems I cannot make long sentances because I get a syntax error. I can only write one liners like Hello, or How are you? When I try something longer I get a syntax error. I also don't know how to turn off the textbox once I have talked with the character. It says in the script you have to type: set_text(character, ''), but when I do that I can't get my first dialog screen with Hello at all. What am I doing wrong? :S
In the mean time I managed to write a longer sentance but I get a square instead of my text going down and everything is in one line :S I want to make it look like this: Hi there! My name is Sonya and I need your help. You see I have lost a gem not far from here.
and I get this: Hi there! My name is Sonya and I need your help. [_] You see I have lost a gem not far from here.
I can't even see the whole sentance. :S
Maybe, and just maybe you can set it up like this (and don't forget the event ID):
set_text('Hi there! My name is Sonya and I need your help.') set_text('You see I have lost a gem not far from here.')
This may or may not do what you want it to do. I haven't tried this script, so I don't really know. Give me a moment to check it out.
Nevermind, you may have to make it appear separately, as in one sentence in the first pop up, and the second sentence in another text box, at least until Wora gives you some assistance.
Oh well, very neat script anyway, I have some use for this...<insert manical laughter here>
This post has been edited by andani: Oct 11 2008, 03:42 AM
__________________________
My name's Andani. I am a very blunt person who says what they feel. I usually do not reveal my thoughts except when I feel obliged.
Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed
QUOTE (Mareus @ Oct 11 2008, 06:12 AM)
QUOTE (enix2 @ Oct 10 2008, 11:56 PM)
change line 47 from:
CODE
TEXTBOX_OPACITY = 0 # Textbox Opacity (0 - 255)
to:
CODE
TEXTBOX_OPACITY = 255 # Textbox Opacity (0 - 255)
Thank you for the answer. In the mean time I managed to figure it out myself, but now I have another problem. It seems I cannot make long sentances because I get a syntax error. I can only write one liners like Hello, or How are you? When I try something longer I get a syntax error. I also don't know how to turn off the textbox once I have talked with the character. It says in the script you have to type: set_text(character, ''), but when I do that I can't get my first dialog screen with Hello at all. What am I doing wrong? :S
In the mean time I managed to write a longer sentance but I get a square instead of my text going down and everything is in one line :S I want to make it look like this: Hi there! My name is Sonya and I need your help. You see I have lost a gem not far from here.
and I get this: Hi there! My name is Sonya and I need your help. [_] You see I have lost a gem not far from here.
I can't even see the whole sentance. :S
this is what you do for multi liners:
CODE
set_text(<event_position>,"this is line 1..." + "\n" + "this is line 2!")
note, you can keep on doing that:
CODE
set_text(<event_position>,"this is line 1..." + "\n" + "this is line 2!" + "\n" + "line 3!")
__________________________
Got 30 minutes? Then you've enough time to play this awesome game: - potentially promising project page - thanks holder
Group: Member
Posts: 10
Type: None
RM Skill: Undisclosed
Hello everyone, I would like to report a bug in this script, if you make the call script (to show the message) in a map, and in it there is also an event with a battle, the battle does not start and appears an error, Chace Line 75 (cannot convert nil into String)
While if the messages are called in a map where they have to start fights, do not show errors
This post has been edited by tiauz: Feb 24 2009, 04:23 PM
Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed
QUOTE (tiauz @ Feb 24 2009, 05:17 PM)
Hello everyone, I would like to report a bug in this script, if you make the call script (to show the message) in a map, and in it there is also an event with a battle, the battle does not start and appears an error, Chace Line 75 (cannot convert nil into String)
While if the messages are called in a map where they have to start fights, do not show errors
I think I fixed this bug in version II. Which can be found in my giftbox
Group: Member
Posts: 14
Type: Developer
RM Skill: Skilled
Awesome!
This post has been edited by JJ9779: Oct 4 2010, 10:09 AM
__________________________
Remember remember the fifth of november, the gunpowder, treason and plot. I know of no reason why the gunpowder treason should ever be forgot. V for vendetta.
Check out my game when it is released, The valley of Gahl!
Group: Member
Posts: 86
Type: Event Designer
RM Skill: Advanced
Idk if the creator of this script is still active, but if someone can fix this issue it would be greatly appreciated.
This script recognizes the apostrophe as the beginning and end of a line of text. If you need to use an apostrophe in a word, like don't, it recognizes that apostrophe as the end of the line of text, so if you keep typing after it the script gets confused and you get an error.
This post has been edited by Mufalmar: Dec 15 2010, 10:19 AM
__________________________
The gate of tomorrow is not the light of heaven, but the darkness in the depths of the earth...