|
  |
[Scripting][Series]RGSS: Windows - Lesson 1: An Introduction to Windows |
|
|
|
|
Feb 25 2008, 10:06 PM
|

Group: Member
Posts: 4
Type: None
RM Skill: Undisclosed

|
I tried to make two windows but ran into a problem... I tried renaming the "class Window_First" part on one of them to "class Window_Second" both in their own separate scripts at different coordinates. It worked fine except after a couple seconds one of the windows disappears on its own. How do I fix this?
|
|
|
|
|
|
|
|
|
Feb 25 2008, 10:20 PM
|

Storm Goddess

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

|
QUOTE (S_n_a_k_e @ Feb 21 2008, 02:09 PM)  Nice tutorial (Y)
i have a question.. if you would want to remove the window, when you press a button, lets say C, how would you script that? ^^ If you wouldn't want to wait 80 frames and then the window is removed automaticlly, but make it so that the player can press a button to remove it himself..
i hope you understand what i mean ^^ Thx. Well, if you wanted to do it through events like this, you could add a parallel process that listens for a button press and dispose the window when it's found. However, the better way would probably be to build it into the scene. QUOTE (Daldraeic @ Feb 25 2008, 10:13 PM)  I tried to make two windows but ran into a problem... I tried renaming the "class Window_First" part on one of them to "class Window_Second" both in their own separate scripts at different coordinates. It worked fine except after a couple seconds one of the windows disappears on its own. How do I fix this? I'm not sure what the problem is. I'd have to see what you're doing.
__________________________

|
|
|
|
|
|
|
|
|
Feb 25 2008, 10:51 PM
|

Group: Member
Posts: 4
Type: None
RM Skill: Undisclosed

|
First Window... CODE class Window_First < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(384, 224, 256, 256) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.draw_text(0, 0, 256, 32, "A B C D E F G H I J K L M") self.contents.draw_text(0, 25, 256, 32, "N O P Q R S T U V W X Y") self.contents.draw_text(0, 50, 222, 32, "1", 1) self.contents.draw_text(0, 75, 222, 32, "2", 2) self.contents.draw_text(0, 100, 256, 32, "0", 0) self.contents.draw_text(0, 125, 256, 32, "I used 25 height spacing") self.contents.draw_text(0, 150, 256, 32, "for each line.") self.contents.draw_text(0, 200, 256, 32, "...oh and Z.") end end And second... CODE class Window_Second < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 256, 256) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.draw_text(0, 0, 256, 32, "test") end end they are each in their own part in the script editor, I wouldn't know how or if I should put them in the same one. If theres anything else you need to know let me know. Oh and, if it matters, the way I brought them up was CODE $window = Window_First.new; $window = Window_Second.new I tried putting them in separate events, but it didn't change anything. Its always the lower right (first) one that disappears.
This post has been edited by Daldraeic: Feb 25 2008, 10:55 PM
|
|
|
|
|
|
|
|
|
Feb 27 2008, 10:07 AM
|

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

|
QUOTE Well, if you wanted to do it through events like this, you could add a parallel process that listens for a button press and dispose the window when it's found. However, the better way would probably be to build it into the scene. yeah, i would like to build it into the scene, but i can't quite figure out how to do it. If it's not to much, can you please show me how to do it? Thanks //Gando
|
|
|
|
|
|
|
|
|
Feb 27 2008, 12:46 PM
|

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

|
Okaay, that sounds good, thanks ^^
|
|
|
|
|
|
|
|
|
Mar 5 2008, 08:01 AM
|

Level 8

Group: Revolutionary
Posts: 111
Type: None
RM Skill: Beginner

|
Wait i have a question..... you said that CODE self.contents = Bitmap.new(width - 32, height - 32 is for text and images.....so how do i put an image?
This post has been edited by Someonation: Mar 5 2008, 08:04 AM
|
|
|
|
|
|
|
|
|
Mar 8 2008, 10:46 PM
|

Twirling towards freedom

Group: +Gold Member
Posts: 2,791
Type: Scripter
RM Skill: Advanced

|
What would I need to change in this to make it RGSS2 compatible? I'm getting a blank window. CODE class Window_First < Window_Base def initialize super(0, 0, 256, 96) self.contents = Bitmap.new(width - 32, height - 32) end def refresh self.contents.clear self.contents.draw_text(0, 0, 256, "Hello World") end end It's just the original code from the tutorial pretty much, but uncommented.
__________________________
|
|
|
|
|
|
|
|
|
Mar 9 2008, 12:17 AM
|
Level 7

Group: Member
Posts: 91
Type: Developer
RM Skill: Skilled

|
I think you need to call refresh from inside initialize as well.
Cheers, SQ
__________________________
Current Skills: Writing(Str) Lv. 4, Writing(Evt) Lv. 4, Scripting Lv. 3, Mapping Lv. 1, Spriting Lv. 0, Composing Lv. 0 Currently expanding: Scripting QUOTE (Arthur C. Clarke) We have to abandon the idea that schooling is something restricted to youth. How can it be, in a world where half the things a man knows at 20 are no longer true at 40 - and half the things he knows at 40 hadn't been discovered when he was 20? (link)
|
|
|
|
|
|
|
|
|
Mar 9 2008, 09:03 AM
|

Twirling towards freedom

Group: +Gold Member
Posts: 2,791
Type: Scripter
RM Skill: Advanced

|
QUOTE (storymasterq @ Mar 9 2008, 12:24 AM)  I think you need to call refresh from inside initialize as well.
Cheers, SQ Well call me a monkey's uncle. It worked. Thanks a lot for your help.
__________________________
|
|
|
|
|
|
|
|
|
Mar 17 2008, 07:43 AM
|
Level 7

Group: Member
Posts: 91
Type: Developer
RM Skill: Skilled

|
QUOTE (LOD @ Mar 17 2008, 09:27 PM)  dammit what happened? i followed all the steps by copying the scripting and all i get is a message of error saying that an error ocurred on Window_First! Can you be specific and tell us what the error was? Cheers, SQ
__________________________
Current Skills: Writing(Str) Lv. 4, Writing(Evt) Lv. 4, Scripting Lv. 3, Mapping Lv. 1, Spriting Lv. 0, Composing Lv. 0 Currently expanding: Scripting QUOTE (Arthur C. Clarke) We have to abandon the idea that schooling is something restricted to youth. How can it be, in a world where half the things a man knows at 20 are no longer true at 40 - and half the things he knows at 40 hadn't been discovered when he was 20? (link)
|
|
|
|
|
|
|
|
|
Apr 11 2008, 04:17 PM
|

Group: Member
Posts: 2
Type: None
RM Skill: Undisclosed

|
QUOTE (LOD @ Mar 17 2008, 09:34 AM)  dammit what happened? i followed all the steps by copying the scripting and all i get is a message of error saying that an error ocurred on Window_First! You placed the script in the wrong area.. notice in the left pane where Window_Base is located? If your script is above that, then the call to it as a super will not work. Best to move your scripts down to the section called Materials, where the ( Insert here ) is at.
|
|
|
|
|
|
|
|
|
Jun 2 2008, 12:30 AM
|

Scribe & Defender of RRR.

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

|
Okay, I've managed to tinker around with this on VX but I can only manage to make a window that says something that I've already put in the script menu. I'm totally lost as to figuring out how to call a window through an event and input what it says in there. Halp!
Mainly because I don't want to have to make a script page for EVERY time the player completes a Quest Objective ^^;
__________________________
 I'm not arrogant, I'm confident. "Only the wicked shall fear my blade, for the grace of God shall defend the innocent from my wrath." ^ A quote that popped into my head during a hot summer night. Come visit my devblog for my RMVX project: Exile of the Sun. Or check out the Topic here at RRR!
|
|
|
|
|
|
|
|
|
Jun 2 2008, 12:51 AM
|

Scribe & Defender of RRR.

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

|
When I try to use that (and put in values) it says: QUOTE Script 'Window_Base' line 45: RGSSError occurred.
failed to create bitmap Syntax is so confusing @_@ Oh! I must have put in bad values, because when I tried some of the values that the other people used, I got a window! Now to move on to figuring out how to put text in it o.o!!
__________________________
 I'm not arrogant, I'm confident. "Only the wicked shall fear my blade, for the grace of God shall defend the innocent from my wrath." ^ A quote that popped into my head during a hot summer night. Come visit my devblog for my RMVX project: Exile of the Sun. Or check out the Topic here at RRR!
|
|
|
|
|
|
|
|
|
Jun 2 2008, 02:55 PM
|

Scribe & Defender of RRR.

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

|
I'll definitely do that! Thanks a lot for your help
__________________________
 I'm not arrogant, I'm confident. "Only the wicked shall fear my blade, for the grace of God shall defend the innocent from my wrath." ^ A quote that popped into my head during a hot summer night. Come visit my devblog for my RMVX project: Exile of the Sun. Or check out the Topic here at RRR!
|
|
|
|
|
|
|
|
  |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|