Help with "File" function in VX Ace

Hello! I am creating a game that breaks the fourth wall by creating files and such, but I can't get around what "File" is. I did figure out how to make .txt files, but don't really know how to write .exe files that make additional popup(s) when you click on them. I don't intend to make these for malicious purpose, but just for a little spook. I don't really know if making these types of .exe files are possible, though, it wouldn't hurt to try right?

This is a video where I demonstrate the problem. I got the code of how to make a message box in an .exe from another source.


If anyone can help me, thank you very much.


This is the code I used for the .EXE file creation:

Code:
File.open("I AM HERE.exe", 'w') do |file|
  file.print("x=msgbox("START RUNNING",32,"IM HERE")")
end
What?? :dizzy: Why not run the popups from the game's window? Even if you got an exe to run (you can technically do that but not like this),the players computers may think it's malicious...that ruins any effects! What is the intent behind making a new executable for this?

Also that code you pasted isn't gonna work because it's to literally print text:
What you're trying to do is not going to work for many many reasons, but one is that you're trying to run a script call with it...when it's just typing the contents in that script call.
What?? :dizzy: Why not run the popups from the game's window? Even if you got an exe to run (you can technically do that but not like this),the players computers may think it's malicious...that ruins any effects! What is the intent behind making a new executable for this?

Wait, you can do that!?
ahhh, Didn't know.
How do I do this certain popup from the game?
Wait, you can do that!?
ahhh, Didn't know.
How do I do this certain popup from the game?
the same way you would with the script call🤣
set multiple script calls if you want them to happen after the player says OK
Code:
msgbox("text here")
For yes/no message boxes
Code:
a = Win32API.new('user32', 'MessageBox', %w(p p p i), 'i')
a.call(0, "test message", "test caption", 4)
the same way you would with the script call🤣
I've been doing it wrong the whole time?
lol
I always used msgbox_p("text")
Just learned that this way causes the quotes " " to show up but msgbox("text") does not.
you learn something new every day... 😛
msgbox allows for line breaks, too. (automatic or by typing \n)
While msgbox_p will just add \n, I think
the same way you would with the script call🤣
set multiple script calls if you want them to happen after the player says OK
Code:
msgbox("text here")
For yes/no message boxes
Code:
a = Win32API.new('user32', 'MessageBox', %w(p p p i), 'i')
a.call(0, "test message", "test caption", 4)

I've been doing it wrong the whole time?
lol
I always used msgbox_p("text")
Just learned that this way causes the quotes " " to show up but msgbox("text") does not.


Thank you so much!!!
I could notice the only difference between msgbox_p and msgbox is that msgbox_p uses quotes and msgbox doesn't. Which is great, thank you so much.

I forgot to mention... Your "Yes/no message boxes" crashes my game, as well.
Thank you so much!!!
I could notice the only difference between msgbox_p and msgbox is that msgbox_p uses quotes and msgbox doesn't. Which is great, thank you so much.

I forgot to mention... Your "Yes/no message boxes" crashes my game, as well.
Are you using it as a script call? It works for me. (I tried it in a RGSS301.dll ace project...)
what error do you get?
Clarifying the msgbox and msgbox_p differences:

They both perform the same function, except the _p variant does a .inspect call onto the object you pass to it.

Thus this call
Code:
msgbox("this is a string".inspect)
is equivalent to
Code:
msgbox_p("this is a string")
Are you using it as a script call? It works for me. (I tried it in a RGSS301.dll ace project...)
Yep, I'm using a script call.

what error do you get?
I get no error, my game freezes.
Yep, I'm using a script call.


I get no error, my game freezes.
try pasting that code right before
rgss_main { SceneManager.run }
in Main.

If it doesn't even work there I don't know what to say...
((EDIT: I meant to edit the first post, not double post
Sorry hahaha)))

Original thread: https://forums.rpgmakerweb.com/threads/help-with-file-function-in-vx-ace.130918/