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
> Omegas7 Simple Scrolling Text Script.
Omegas7
post Jan 14 2009, 03:43 PM
Post #1


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




Woot my first submission script happy.gif .

Description:

Creates a simple window, where you can put text which scrolls, better look at demo anyways.

Features:

Show text.
Clear text in certain text slots.
Change opacity.

Bugs:

Small simple bug, fixed, look at the post number 4 in this topic.
http://www.rpgrevolution.com/forums/index....st&p=262050

Screenshots:


[Show/Hide] Screenshots.



Demo:

http://www.4shared.com/file/80676685/7f33fb24/Script.html


Script:
[Show/Hide] Script.

CODE
#===========================================================================
# Simple Scrolling Text Window Script.
# By Omegas7.
#===========================================================================
#
# Commands:
# User a in game script call command:
#
# $omegas_text.show_text("text")
# Replace text with the desired text to appear.
#
# $omegas_text.clear_text(N)
# Replace N with a number.
# 0 = Clear all text.
# 1 = Clear text in slot number 1.
# And so on.
#
# $omegas_text.change_opacity(N)
# Replace N with a number.
# The number may be from 0 to 255.
# That will change the window opacity.
#
#===========================================================================




class Omegas_Window < Window_Base
  
  def initialize
    super(0,305,545,110)
    $opacity = 125 if $opacity == nil
    self.contents.font.size = 16
    $text_line = [] if $text_line == nil
    $need_update = false if $need_update == nil
    refresh
    
  end
  
  def refresh
    self.contents.clear
    self.opacity = $opacity
    @text_line = $text_line
    self.contents.draw_text(0,-10,545,30,@text_line[1].to_s)
    self.contents.draw_text(0,10,545,30,@text_line[2].to_s)
    self.contents.draw_text(0,30,545,30,@text_line[3].to_s)
    self.contents.draw_text(0,50,545,30,@text_line[4].to_s)
  end
  
  def update
    
    if $need_update == true
      refresh
      $need_update = false
    end
    
  end
  
  def show_text(text)
    $text_line[4] = $text_line[3]
    $text_line[3] = $text_line[2]
    $text_line[2] = $text_line[1]
    $text_line[1] = text
    $need_update = true
    update
  end
  
  def clear_text(number = 0)
    if number == 0
      $text_line = []
    end
    
    if number == 1
      $text_line[1] = " "
    end
    
    if number == 2
      $text_line[2] = " "
    end
    
    if number == 3
      $text_line[3] = " "
    end
    
    if number == 4
      $text_line[4] = " "
    end
    
    $need_update = true
    update
    
  end
  
  def change_opacity(number)
    $opacity = number
    refresh
  end
  
  
  
end

class Scene_Map
  alias omegas_text_start start
  alias omegas_text_update update
  alias omegas_text_terminate terminate
  
  def start
    omegas_text_start
    $omegas_text = Omegas_window.new
  end
  
  def update
    omegas_text_update
    $omegas_text.update
  end
  
  def terminate
    omegas_text_terminate
    $omegas_text.dispose
  end
  
end
Go to the top of the page
 
+Quote Post
   
omegazion
post Jan 14 2009, 06:36 PM
Post #2


Level 1 / 0
Group Icon

Group: Revolutionary
Posts: 198
Type: Scripter
RM Skill: Masterful




Nice 1st script! Although I don't know why you needed a lot of global variables, since they're just used inside the class anyway, you might want to change those to instance variables instead (or class variables probably).

Nice avatar BTW.


__________________________

Those who live by the sword, Die by the gun.
Go to the top of the page
 
+Quote Post
   
Omegas7
post Jan 14 2009, 07:26 PM
Post #3


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




Thanks!

By the way, do you know how to fix the bug?

A square appears when the text takes 2 lines in the script command... mellow.gif .
Go to the top of the page
 
+Quote Post
   
trizty
post Jan 14 2009, 11:01 PM
Post #4


Level 6
Group Icon

Group: Member
Posts: 77
Type: Event Designer
RM Skill: Advanced




You mean fix it like this?

Ya....

Just so you know, there is an error on the script in the spoiler. It's very tiny, but it's on line 110:
CODE
    $omegas_text = Omegas_window.new

'w' in window should be capitalized. Moving on...

Your script is simple but it definitely works great! It's not exactly what I'd like to see in the overhead view game style RPG maker produces, since it takes up a large portion of the screen.


__________________________
~Trizty~

[Show/Hide] Bored...
[Show/Hide] Mapping Fail

In a contest for the world's biggest failure, I placed 2nd.
[Show/Hide] Personality quiz
Here is the results of some personality quiz I have no idea about:

"You are helium. After hydrogen, helium is the most abundant element in the universe. Helium is stable. Chemically speaking, it tends to keep to itself, with no real inclination to react with other elements. Helium is a gas that is lighter than air. Helium has the lowest melting point of any element. The melting point is so low that it would not solidify even at absolute zero under ordinary pressure."

After doing this personality quiz, it became apparent that I need a life....
[Show/Hide] VX Mini Tutorial: How to check the leader of the party
Create a condition branch. Go to page 4 of this condition branch and select script. Type in this:
CODE
$game_party.members[#] == $game_actors[#]

Change the # in $game_party.members[#] to whichever party member you want to check (0 = leader, 3 = 4th member).
Change the # in $game_actors[#] to whatever actor you want to check (from the database. (according to the actor id number) 1 = first person in database)
If I'm not being helpful, don't shoot me. I'm still Canadian.
Go to the top of the page
 
+Quote Post
   
Omegas7
post Jan 15 2009, 01:20 PM
Post #5


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




Yeah like that fix but I mean, something more simple happy.gif but thanks.

Oh, yes, I know this isn't exactly a very very good script but I think it is ok for now laugh.gif .
Go to the top of the page
 
+Quote Post
   
BigEd781
post Jan 15 2009, 01:34 PM
Post #6


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

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




The squares are there because the window does not properly escape carriage return/line feed characters (i.e., when you press enter). Don't press enter when typing in the text (as shown above), or pass in an array of strings instead of a single one.


__________________________
`
Give me teh codez!!!


I am the master debator!
Go to the top of the page
 
+Quote Post
   
ZFMaster
post Jan 15 2009, 01:37 PM
Post #7


ZFMaster; Master at Zelda Freaking.
Group Icon

Group: Revolutionary
Posts: 160
Type: Developer
RM Skill: Masterful




Dude nice its a pretty damn good script saved me the trouble of trying to script this thankz.


__________________________
<--- Click.

Want a signature like the one above? PM me and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
BigEd781
post Jan 15 2009, 01:44 PM
Post #8


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

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




I would suggest using Window/Game_Message to display the text so that the player can close the window using the action button. Nice progress you are making Omegas, keep it up.


__________________________
`
Give me teh codez!!!


I am the master debator!
Go to the top of the page
 
+Quote Post
   
Omegas7
post Jan 15 2009, 06:40 PM
Post #9


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




Thanks, but I just know working with windows huh.gif and I am not sure what else to do.
Go to the top of the page
 
+Quote Post
   
SojaBird
post Jan 15 2009, 11:36 PM
Post #10


Level 51
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Scripter
RM Skill: Advanced




Very nice work.

Keep it up smile.gif


Greatzz,
SojaBird.


__________________________
Art from the highest shelf?

Scriptology, scripting podcast



HUD's Request Lobby (multiple hud-scripts)


------------------------------------------------------------------

Random Stuff
OMG, it's Hab!!


This is a crazy drawing application! (by me)

How did I learned to script
QUOTE
Hey pim! I'm the Law G14!

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 ;)


Greatzz,
SojaBird.
Go to the top of the page
 
+Quote Post
   
dandanthedan
post Jan 16 2009, 12:01 AM
Post #11


Death Striker
Group Icon

Group: Revolutionary
Posts: 299
Type: Developer
RM Skill: Skilled




wow! so you're on to scripting now too?? nice 1st script btw...hope you'll sill take event requests...happy.gif


__________________________
[Show/Hide] My Current Project


Box by Me


[Show/Hide] click me!



recruiting: writer(for the dialogues), mapper and eventer...
visit this thread to join: Grendis Recruitment Thread
"You can tame a lion, but you can never make it vegetables"
Go to the top of the page
 
+Quote Post
   
Omegas7
post Jan 16 2009, 06:18 PM
Post #12


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




QUOTE (dandanthedan @ Jan 16 2009, 12:01 AM) *
wow! so you're on to scripting now too?? nice 1st script btw...hope you'll sill take event requests...happy.gif


Thanks, sure, I will continue with events, I am just practicing a little with scripting, windows, for making much better evented systems...
Go to the top of the page
 
+Quote Post
   
dandanthedan
post Jan 16 2009, 06:36 PM
Post #13


Death Striker
Group Icon

Group: Revolutionary
Posts: 299
Type: Developer
RM Skill: Skilled




thats good to hear...happy.gif so will you take script requests now? lol...coz if you do i have a simple request...happy.gif


i really need a script that shows more than 4 choices in 1 window


__________________________
[Show/Hide] My Current Project


Box by Me


[Show/Hide] click me!



recruiting: writer(for the dialogues), mapper and eventer...
visit this thread to join: Grendis Recruitment Thread
"You can tame a lion, but you can never make it vegetables"
Go to the top of the page
 
+Quote Post
   
Omegas7
post Jan 16 2009, 07:54 PM
Post #14


Awesome. Epic. Fantastic. Did someone call me?
Group Icon

Group: Revolutionary
Posts: 977
Type: Scripter
RM Skill: Advanced




I don't take script requests.

This isn't even a script request topic.

I don't even know how to do your script request.

I think there is already a script for that, I think that Woratana's Neo Message System Script can do that.
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: 25th May 2013 - 12:39 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker