Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5
Hey just so you know, D.H, I haven't abonded you lol, just been really busy. I asked Night_Runner to help me out with this request and he gave some nice help for me to finish it off. Hopefully I can have this done by the end of the weekend
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
Group: Member
Posts: 7
Type: None
RM Skill: Skilled
Great script! I have 2 problems I can't fix. 1st : I want to make the window invisible, but I can't....
2nd : Night Runner told me about your script from my request for a window that shows me variables. he said I had to chance "Hello World" into $Game_Variables[1], $Game_Variables[2] and so on. but that doesn't work.
CODE
#=============================================================== =============== # ** Window_Text #------------------------------------------------------------------------------ # This class displays text in a window #==============================================================================
Group: +Gold Member
Posts: 1,528
Type: Scripter
RM Skill: Undisclosed
@> henkhuizen Fixed version:
CODE
#============================================================================== # ** Window_Text #------------------------------------------------------------------------------ # This class displays text in a window #==============================================================================
@> kabuto202 It works fine in VX, I just tried it, you may need to change the width / height of the window to suit VX's smaller resolution (544x416), but either way it works perfectly Give it a shot
__________________________
K.I.S.S. Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.
def screen_x # Return after calculating x-coordinate by order of members in party return 20 end
def screen_y # Return after calculating x-coordinate by order of members in party return 10 end end
#============================================================================== # * Window_Message #------------------------------------------------------------------------------ # ** So far, does very little. #==============================================================================
class Window_Message
alias nr_refresh refresh
def refresh @nr_width = 0 @nr_width = x if x > @nr_width # This is all taken from the original, used to determine the size of the # window text = $game_temp.message_text begin last_text = text.clone text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until text == last_text text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end text.gsub!(/\\\\/) { "\000" } text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" } text.gsub!(/\\[Gg]/) { "\002" }
# End of copying.
# If everything is set to nil, go to default spot down the bottom a = gsmi = $game_system.map_interpreter if (gsmi.nr_event_id == nil) & (gsmi.nr_window_x == 0) & (gsmi.nr_window_y == 0) self.x = 80 self.y = 304 self.width = 480 self.height = 160 end
# Call normal refresh, and update @nr_width nr_refresh
# Get the size available text_height = text.scan(/\n/).length*32 + 32 # Pathetic, no?
# If it's set to an event, jump to it if $game_system.map_interpreter.nr_event_id != nil e = $game_map.events[$game_system.map_interpreter.nr_event_id] self.x = e.screen_x self.y = e.screen_y self.width = @nr_width + 40 self.height = text_height bitmap = Bitmap.new(width = 100, height = 100) self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24)) end
end end
#============================================================================== # * Interpreter #------------------------------------------------------------------------------ # ** Create the calls from an event. #==============================================================================
class Interpreter attr_accessor :nr_event_id attr_accessor :nr_window_x attr_accessor :nr_window_y
alias :nr_initialize :initialize
def initialize(depth = 0, main = false) nr_event_id = nil nr_window_x = nil nr_window_y = nil nr_initialize(depth, main) end
end
@Henkhuizen: For your first request to make the window invisible, just add to Night_Runner's script after this line:
@Kabuto: Yeah, Night_Runner pretty much nailed it in the head. All you'd really have to do is readjust the window height and width and you're set to go
This post has been edited by The Law G14: Oct 26 2009, 12:35 PM
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
Group: +Gold Member
Posts: 2,178
Type: Developer
RM Skill: Advanced
Yay, thanks Law (and to night runner). I'm sure this script will be very popular with many out there. It just adds a bit more professionalism to the games somehow. Can't wait to screenshot this once it's made and up and running in a game. Again, thanks for doing this .
def screen_x # Return after calculating x-coordinate by order of members in party return 20 end
def screen_y # Return after calculating x-coordinate by order of members in party return 10 end end
#============================================================================== # * Window_Message #------------------------------------------------------------------------------ # ** So far, does very little. #==============================================================================
class Window_Message
alias nr_refresh refresh
def refresh @nr_width = 0 @nr_width = x if x > @nr_width # This is all taken from the original, used to determine the size of the # window text = $game_temp.message_text begin last_text = text.clone text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] } end until text == last_text text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end text.gsub!(/\\\\/) { "\000" } text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" } text.gsub!(/\\[Gg]/) { "\002" }
# End of copying.
# If everything is set to nil, go to default spot down the bottom a = gsmi = $game_system.map_interpreter if (gsmi.nr_event_id == nil) & (gsmi.nr_window_x == 0) & (gsmi.nr_window_y == 0) self.x = 80 self.y = 304 self.width = 480 self.height = 160 end
# Call normal refresh, and update @nr_width nr_refresh
# Get the size available text_height = text.scan(/\n/).length * 32 + 32 # Pathetic, no?
# If it's set to an event, jump to it if $game_system.map_interpreter.nr_event_id != nil e = $game_map.events[$game_system.map_interpreter.nr_event_id] self.x = e.screen_x self.y = e.screen_y - 80 self.width = 200 self.height = text_height + 40 bitmap = Bitmap.new(width - 32, height - 32)
end
end end
#============================================================================== # * Interpreter #------------------------------------------------------------------------------ # ** Create the calls from an event. #==============================================================================
class Interpreter attr_accessor :nr_event_id attr_accessor :nr_window_x attr_accessor :nr_window_y
alias :nr_initialize :initialize
def initialize(depth = 0, main = true) nr_event_id = nil nr_window_x = nil nr_window_y = nil nr_initialize(depth, main) end
end
To call the script, just go to the script option in the event commands window and put this in:
CODE
@nr_event_id = 1
I'm not sure what else you asked for after allowing the text window to be next to the character so I'm at a road block lol
Oh, and if anybody does the homework can you pleeaase post it, I'd love to see it
This post has been edited by The Law G14: Oct 29 2009, 01:08 PM
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
P.S. "Hola Mundo" is Spanish for "Hello World" ^^;
__________________________
Given the choice - whether to rule a corrupt and failing empire, or to challenge the Fates for another throw, a better throw against one's destiny - what was a king to do?
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
#============================================================================== # *Custom Text Window* #------------------------------------------------------------------------------ # makes a basic text window #==============================================================================
That way the arrows will be gone since you need to remove 32 pixels from the widht and height. Also, try rearrange yor text since it seems that you made that line 16 and 16 because you wanted the text to fit. Good work though
This post has been edited by The Law G14: Nov 1 2009, 06:41 AM
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
Group: Member
Posts: 11
Type: Developer
RM Skill: Beginner
This is mine =/ i think its bad though.....
CODE
#============================================================================== # **Window_Text #------------------------------------------------------------------------------ # This class displays text in a window :D #==============================================================================
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
Group: Member
Posts: 54
Type: Writer
RM Skill: Skilled
This tutorial's great!! And um, I have a problem with the homework. I wanted to try and put the window next to warrior02 and it turned out like this: (I also changed the size of the window....I think)
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One
Group: Member
Posts: 54
Type: Writer
RM Skill: Skilled
The text isn't fitting properly. I wanted it to be right in the middle of the window. Although, I set the text coordinates to 0,0 it was still placed weird.
Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5
@Magic: Oops, sorry for the late reply man Change the y coordinate (second value) to something like -10. Sometimes it doesn't fit properly so you have to go into negative integers.
@RedKnight: Beautiful man! Nice and simple
This post has been edited by The Law G14: Dec 1 2009, 05:48 PM
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One