What should I do? (in script editor, about dispose window, rgss3)

Tapael

Regular
Regular
Joined
Oct 23, 2021
Messages
31
Reaction score
8
First Language
n
Primarily Uses
RMVXA
I ask you again following the previous article.

Through a recent search, I learned how to remove certain windows.


For example, @window = Window_textbox.If you made a window with new,

@window.dispose has figured out how to delete that window.


However, I don't know how to apply this in the script editor.


First of all,

def deletebox
if Input trigger?( : B )
@window.dispose
end
end

I tried making it this way (if Input trigger?( : B ) in this line, ( and : and B are attachted.) but it didn't work.


How can I make it work?




* Below this is the full code.
[#spoiler]

class Window_Test < Window_Base
def initialize(x = 256,y = 192,width = 130, height = 50)

super(x,y,width,height)

end



def event_text(text)
return unless text.is_a?(String)
draw_text(text, 0, 0, 128, 25)
end






def draw_text(text, x, y, text_width, text_height, aligment = 0)
contents.draw_text(x, y, text_width, text_height, text, aligment)



end
end
[#/spoiler]
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
Send me a simple demo so I can take a look at it and leave some useful notes there on how to do it right and what's simple a terrible mistake or a bad design.
 

Tapael

Regular
Regular
Joined
Oct 23, 2021
Messages
31
Reaction score
8
First Language
n
Primarily Uses
RMVXA
How can I send it to you?
Send me a simple demo so I can take a look at it and leave some useful notes there on how to do it right and what's simple a terrible mistake or a bad design.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
You simply post a link here.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
This is weird. Your demo has no error except for the lack of a call for the window's dispose method. You know, you can't keep opening new windows every single time you talk to that lonely maid. That could be considered a very basic form of memory leak.
 

gstv87

Regular
Regular
Joined
Oct 20, 2015
Messages
3,275
Reaction score
2,447
First Language
Spanish
Primarily Uses
RMVXA
@kyonides ahem:
"Do you understand?" -> type mismatch, expected Boolean, got Nil.
 

Tapael

Regular
Regular
Joined
Oct 23, 2021
Messages
31
Reaction score
8
First Language
n
Primarily Uses
RMVXA
This is weird. Your demo has no error except for the lack of a call for the window's dispose method. You know, you can't keep opening new windows every single time you talk to that lonely maid. That could be considered a very basic form of memory leak.
Yes, that's exactly what I want.

I want to make the window turn off when a particular key is pressed, such as a decision key or a cancel key, while the window is open.

But I don't know how.
 

Tapael

Regular
Regular
Joined
Oct 23, 2021
Messages
31
Reaction score
8
First Language
n
Primarily Uses
RMVXA
@kyonides ahem:
"Do you understand?" -> type mismatch, expected Boolean, got Nil.
Does type mismatch mean that the types became out of sync while deleting the window?
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,763
Reaction score
892
First Language
English
Primarily Uses
RMXP
I never got a type mismatch and I did dispose of the window. The only difference here might have been that I didn't add a push button condition. Even if I had, the event should close or exit right after the window gets disposed. If he didn't consider that ever before, he should start doing so from now on.
 

gstv87

Regular
Regular
Joined
Oct 20, 2015
Messages
3,275
Reaction score
2,447
First Language
Spanish
Primarily Uses
RMVXA
@kyonides my earlier post was a covert joke. ;)
 

Tapael

Regular
Regular
Joined
Oct 23, 2021
Messages
31
Reaction score
8
First Language
n
Primarily Uses
RMVXA
@kyonides my earlier post was a covert joke. ;)
I never got a type mismatch and I did dispose of the window. The only difference here might have been that I didn't add a push button condition. Even if I had, the event should close or exit right after the window gets disposed. If he didn't consider that ever before, he should start doing so from now on.
I don't understand still...but I will try to find solution. And if I still don't find a solution, I'll ask you again. Thank you, everyone!
 

Latest Threads

Latest Posts

Latest Profile Posts

Wow, it's almost a month since the last time I made a full-scale drawing. But I'm back to the drawing board again.
F7L1ME2aMAAo4jK
Well, I think it’s a competent enough sketch. Definitely a lot of smaller details that will get inked and the hands and feet naturally need a ton of revision (legs might be a little long too). Yes. I will also draw the second hand…I just think I’ve suffered enough, OK?

IMG_0488.jpeg
wahh, it's good to be back! A lot of stuff happened (like always lmao) but I've been extremely productive lately, so I decided to hop on back onto the forum I definitely have warm feelings to! haroo eberyoneee :kaohi:


I got encouraged to finish the piece a bit more thanks to u guys <3

Forum statistics

Threads
134,893
Messages
1,251,689
Members
177,706
Latest member
kylen__
Top