Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Basic Messages On Screen, This is my first and Simple Script^^
Rafidelis
post Sep 19 2008, 07:52 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 71
Type: Scripter
RM Skill: Beginner




Messages Basic On Screen
By: Rafidelis


About Script:

This script allows the creation of windows with texts by command
Call script.
How is my first script it very simple and even ^ ^

Features:

This script and super basic, so you can not show faces,
Icons, or pictures in messages.
But you can display, name of the character, amount of steps, quantity
From money, using the seguints codes in the text when calling the script:

Name of Character = $ game_party.members [ID PERSONAGEM]. Name
Quantidade_de_Gold = $ game_party.gold
Steps = $ game_party.steps

ScreenShots





Instructions:

• To call the script Use Command call script and write:
• Mensagen_Basica.new (window_x,window_y,window_Width ,window_height , window_opacity , text_x,
text_y, text,size_text)

• window_x = X position of the window, namely the horizontal position of the window
• window_y = Y position of the window, or the vertical position of the window
• window_Width = Width From Window Where the text appears
• window_height = height of the window where the text appears
• window_opacity = opacity of the window, you can use from 0 to 255
• text_x = x position of the text, or horizontal position of the text
• texto_y = Position and the text, or vertical position of the text
• Text = Text to Be Displayed (must be in quotes ( "")
• size_text = size of text, you must use a number between 0 and 32

NOTE: Remember that the size of the window should be in accordance with the text size and position it,
because otherwise there will be shown only a piece of the message, for example if the text is too large,
you should create a window with a width great, because otherwise there will be shown so a part of the text.

CODE
#===============================================================================
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
#                        MESSAGES ON SCREEN |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# BY: RAFIDELIS |
# RAFA_FIDELIS@HOTMAIL.COM | www.ReinoRpg.com | |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
#===============================================================================
|
#===============================================================================
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
INSTRUCTIONS # |
# • To call the script Use: |
• # Mensagen_Basica.new (Mensagen_Basica.new (window_x, window_y, window_widht, |
# window_height, window_opacity, text_x, text_y, text, size_text) |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
• window_x # = X position of the window, namely the horizontal position of the window |
• window_y # = Y position of the window, or the vertical position of the window |
• window_widht# = Width From Window Where the text appears |
• window_height# = Height of window where the text appears |
• window_opacity# = Opacity of the window, you can use from 0 to 255 |
• text_x # x = position of the text, or horizontal position of the text |
• text_y # = Position and the text, or vertical position of the text |
• Text = # Text to Be Displayed (must be in quotes ( "") |
• size_texto # = size of text, you must use a number from 0 to 32 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
# EXAMPLE OF USE |
# Mensagem_Basica.new (0,0180100255,30,0, Raphael, 32) |
# The above example will show the window in positions xeyo, the width of the window |
# Is 180, the height will be 100, the opacity of the window will be 255, the position of x |
# Text will be equal to 30, and the position and will be 0, # and the text to be displayed will be |
# Rafael in size 32. |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
class Mensagem_Basica < Window_Base
  def initialize(janela_x,janela_y,janela_largura,janela_altura,opacidade_janela,texto_x,text
o_y,texto,tamanho_texto)
    @opacidade_janela = opacidade_janela  
    @tamanho_texto = tamanho_texto
    @texto_x = texto_x
    @texto_y = texto_y    
    @texto = texto    
    @janela_largura = janela_largura
    @janela_altura = janela_altura
    super(janela_x,janela_y,janela_largura,janela_altura)
    refresh
  end
end

def refresh
  self.contents.clear
  self.opacity = @opacidade_janela  
  self.contents.font.size = @tamanho_texto
  self.contents.draw_text(@texto_x,@texto_y,@janela_largura/2,@janela_altura/2,@texto)
end
#===============================================================================
|
#                            END  OF SCRIPT                                      |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|


This post has been edited by Rafidelis: Sep 19 2008, 07:55 AM


__________________________
Nothing Special Today!
Go to the top of the page
 
+Quote Post
   
jens009
post Sep 19 2008, 07:02 PM
Post #2


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




Good job for your first script but I think you want to make this more user friendly.
For example, this call script:
[code]
Mensagen_Basica.new (window_x,window_y,window_Width ,window_height , window_opacity , text_x,
text_y, text,size_text)
[/b]
Is just too huge and inconvenient. Instead of having too much values to input on, it should be just the text so that the window readjusts itself depending on the text shown.
Other inputs such as coordinates, window sizes or properties should be from a different call script.

But it's a good starter script nonetheless regarding windows. =]


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
theDante
post Sep 21 2008, 05:17 PM
Post #3


Level 1
Group Icon

Group: Member
Posts: 12
Type: Event Designer
RM Skill: Beginner




I think this could come in handy, it's nice to have scripts like this in the tool kit for when you need them. Are you going to add picture & icon capability to it?
Go to the top of the page
 
+Quote Post
   
BigEd781
post Sep 21 2008, 05:30 PM
Post #4


No method: 'stupid_title' found for `nil:NilClass'
Group Icon

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed




So, I know that this is your first script and all, but I don't see anything that could not already be accomplished by creating a new Window_Base object.

CODE
win = Window_Base.new(x, y, w, h)
win.back_opacity = 128
win.contents.font.size = 12
win.contents.font.color = Color.new(128,128, 0)
win.contents.draw_text(0, 0, 120, WLH, "text")


These are great practice, but I would not release a script that doesn't really do anything.


__________________________
`
Give me teh codez!!!


I am the master debator!
Go to the top of the page
 
+Quote Post
   
Rafidelis
post Sep 23 2008, 07:48 AM
Post #5


Level 5
Group Icon

Group: Member
Posts: 71
Type: Scripter
RM Skill: Beginner




really, jens, I will take care not to create commands so unpleasant, and I already did 2 more new scripts ~ ^
And I will not adapt to display images, since it is designed only to display text.

Thanks for the opinion of you.


__________________________
Nothing Special Today!
Go to the top of the page
 
+Quote Post
   
Mefisno
post Sep 23 2008, 08:06 AM
Post #6


Is most likly drunk somewhere. But I'm sure he will get back
Group Icon

Group: Revolutionary
Posts: 165
Type: Event Designer
RM Skill: Advanced




QUOTE
So, I know that this is your first script and all, but I don't see anything that could not already be accomplished by creating a new Window_Base object.

win = Window_Base.new(x, y, w, h)
win.back_opacity = 128
win.contents.font.size = 12
win.contents.font.color = Color.new(128,128, 0)
win.contents.draw_text(0, 0, 120, WLH, "text")


These are great practice, but I would not release a script that doesn't really do anything.


Ouch are you plesent to anyone?
Thats quite harsh for someones first script.

Meanwhile on topic.

Hey nice script for a first time.
But could you please post up a screenshot so I could see what it looks like?


__________________________
Go to the top of the page
 
+Quote Post
   
Rafidelis
post Sep 30 2008, 06:03 AM
Post #7


Level 5
Group Icon

Group: Member
Posts: 71
Type: Scripter
RM Skill: Beginner




Thanks friend ^ ^
I posted an image, alias 2 in the beginning of the script, but in any event I thank you ^ ^


__________________________
Nothing Special Today!
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 07:02 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker