Question regarding how to make something happen with a button click

fallent

Villager
Member
Joined
Jul 4, 2020
Messages
15
Reaction score
4
First Language
English
Primarily Uses
RMMV
Hi! I'm currently struggling to make an image disappear with the click of a button, below I've attached what I've tried to do. So far, the image just stays and doesn't disappear.
The 'C' button is also the enter button on my keyboard, so I don't think that's the problem either.
I'm new at this so any help would be appreciated, thanks so much!!
 

Attachments

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,355
Reaction score
1,510
First Language
English
Primarily Uses
RMMV
What's the activation type on the event?
 

fallent

Villager
Member
Joined
Jul 4, 2020
Messages
15
Reaction score
4
First Language
English
Primarily Uses
RMMV
What's the activation type on the event?
It's action button. There's dialogue before and after the screenshot I inserted TT
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,355
Reaction score
1,510
First Language
English
Primarily Uses
RMMV
It's action button. There's dialogue before and after the screenshot I inserted TT
Instead of doing it that way, where you currently have your loop, set self switch A ON. Then make a second event page set to "autorun" with self switch A as the activation condition. There, put your conditional branch for pressing C. After the erase picture, turn self switch A OFF.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,355
Reaction score
1,510
First Language
English
Primarily Uses
RMMV
Put the "Self switch A on" after the dialogue.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,462
Reaction score
390
First Language
German
Primarily Uses
RMMV
OP your first shown code was absolutly correct, you just forgot the 1 Frame Wait, else its an endless loop which causes the game to freeze, atleast in vx-ace, in mv it doesnt crash but i believe it has to do with it.

...
1frame wait
repeat above


But there is another solution for your problem, after the picture, just use eventcommand show textmessage, choose transparent box and write nothing in it, after the textbox you do the erase picture command. Thatway you need to press enter for the not visible textbox to go away, which than results in picture getting erased. But your initial code should also work.

show picture
textbox
erase picture
 

fallent

Villager
Member
Joined
Jul 4, 2020
Messages
15
Reaction score
4
First Language
English
Primarily Uses
RMMV
OP your first shown code was absolutly correct, you just forgot the 1 Frame Wait, else its an endless loop which causes the game to freeze, atleast in vx-ace, in mv it doesnt crash but i believe it has to do with it.

...
1frame wait
repeat above


But there is another solution for your problem, after the picture, just use eventcommand show textmessage, choose transparent box and write nothing in it, after the textbox you do the erase picture command. Thatway you need to press enter for the not visible textbox to go away, which than results in picture getting erased. But your initial code should also work.

show picture
textbox
erase picture
Thank you so much! Finally got it to work now.
The second solution is so simply but I totally didn't think of it hahaha ><
 
  • Like
Reactions: Bex

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Got inspired and started writing a simple tower defence battle system last night :o
Good news! I have located an amazing 3D website called SketchFab that has rotatable renderings of famous statues!
Picked up a physical copy of Megadimension Neptunia VII for the PS4 today. It's pretty good. I'm having a lot of fun with it.
The only upside of this remote semester was the plenty of funny photoshop material those facecams provided. Not that I would do that. Ever.

Forum statistics

Threads
100,516
Messages
976,702
Members
132,080
Latest member
nwr
Top