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

Tapael

Veteran
Veteran
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
Veteran
Joined
Nov 17, 2019
Messages
517
Reaction score
219
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

Veteran
Veteran
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
Veteran
Joined
Nov 17, 2019
Messages
517
Reaction score
219
First Language
English
Primarily Uses
RMXP
You simply post a link here.
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
517
Reaction score
219
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

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

Tapael

Veteran
Veteran
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

Veteran
Veteran
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
Veteran
Joined
Nov 17, 2019
Messages
517
Reaction score
219
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

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,870
Reaction score
1,927
First Language
Spanish
Primarily Uses
RMVXA
@kyonides my earlier post was a covert joke. ;)
 

Tapael

Veteran
Veteran
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

New sprites & animations for Mint and Beri are coming along!
Guh-Colorbound.gif
ScreenShot_10_5_2022_4_44_8.png
Mad O' Malley... a stick figure that's afraid of it's existence being erased. so they always start battle in an anxious state.
Before, I was drawing all the sprite work, super big and shrinking it down. Which was really time consuming if thing's changed. So instead I'm drawing the characters sketch, and then remaking it with pixel art instead.
Why are job interviews so terrifying. :kaodes:

Forum statistics

Threads
125,801
Messages
1,173,666
Members
164,964
Latest member
oliveleaf
Top