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
512
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
512
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
512
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,869
Reaction score
1,926
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
512
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,869
Reaction score
1,926
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

Sometimes I wonder why I still try and recruit others to help with my games. It never works.
ScreenShot_10_3_2022_4_27_17.png
welp, thanks to Luna MV, I was able to add the Balloon as a window... thus allowing me to edit the font color and outline... so now it looks like comic bubbles above characters. I have NO idea why I couldn't get this to work through more conventional means, but here we are.
CUTE CUTE CUTE.gif
I cannot cease doing cute art
War and Wonder is a 100% choice-based open-world visual novel.
1664821313732.png
1664821466359.png
1664821547746.png
Going live soon on Twitch, and will continue Fortunastreet's game "Verloren". For those who are curious, you are welcome to join ;)

-> Franz' Twitch channel

Forum statistics

Threads
125,759
Messages
1,173,272
Members
164,916
Latest member
Syczewski
Top