RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Press Any Key Script (Quickie Fix)

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 85
I've been browsing around for a script that will allow me to hide the "New Game/Continue/Shut Down" box on the title screen until a key is pressed, and thus far this one is the only one I've come across.

Unfortunately, there seems to be an argument error occurring in line 30, stating "wrong number of arguments (2 for 4)." While I'm no scripter myself, I usually understand enough of the logic to troubleshoot these kinds of errors, but this one has me stumped as to the arguments it's referring to. The original scripter, LiTTleDRAgo, doesn't seem to have been a very active member of the community, so I can't really contact him. Hence why I'm posting here.

I'm using virtually no other scripts on this project, and the one or two I am using aren't related to the title generation, so the chance that it's a conflict between scripts is slim to none. Does anyone have any idea what the problem might be?

For reference, line 30 is the fourth line in the following block:

Code: [Select]
  alias init_drgprs_btn initialize unless method_defined?(:init_drgprs_btn)
  def initialize *args
    press_any_button if scene.is_a? Scene_Title
    init_drgprs_btn *args
  end

*
Rep:
Level 82
Whilst it might not affect the title screen directly, this script does modify Window_Command which may be implicitly affecting the title screen process.

The script works fine with my project in VXAce. I haven't tested it with the other two platforms.

I would suggest making a brand new project with no additional scripts and see if you still get the problem. If you get the problem with no scripts, it is likely an issue with the version you have. If you don't get the problem, it is likely a conflict with the other scripts you are using.

A good troubleshooting tip is to not assume that one script doesn't interfere with another on the principle that they have different themes. Their code may contain parts which do interact in some way, which may be the root of the issue.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

**
Rep:
Level 85
I tried the script in a brand new project with no other scripts and encountered the same error. The script was designed to work in RMXP, so it's not just a matter of the script being written for the wrong program. I'm not sure what's causing that line 30 error, though.

**
Rep:
Level 85
No suggestions on how to resolve this error?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
It's difficult to see how that line, by itself, could cause an arguments error (though perhaps this is a failure of imagination on my part). Essentially, the script is only aliasing and redefining the initialize method of Window_Command. It doesn't do anything to the arguments; it takes them as they are passed and then passes them to the original method exactly as they came to it. As such, the error is technically not in that method. Rather it has to do with something creating a new Window_Command object and passing 4 arguments instead of 2.

Since nothing in this script creates a Window_Command, it has to be something external to the script, and it ought to happen whether or not this script is in your game. Assuming you haven't altered anything in the linked script, I would predict that the error would occur even if you removed this script from your project, and then the error would at least lead you to the right place.

If you share the new project where you are getting the error, then I might be able to take a look. As it is, inserting the clean script into a clean project does not create any error.
« Last Edit: June 15, 2013, 11:28:59 PM by modern algebra »

**
Rep:
Level 85
It is creating an error in a clean project for me. Here's a new, clean project with the script replacing Window_Command.

It might be worth noting that I'm apparently using an "old version" of RMXP. I sent a friend of mine some of our old projects we started years ago after he recently re-installed RMXP, and they wouldn't work for him without him resolving a bunch of DLL/compatibility issues first. He got the error message that the projects were made in an old version of RMXP.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Oh, it's not the version; it's the fact that you're deleting the original Window_Command. This script isn't meant to replace Window_Command. For it to work, the original Window_Command still needs to be in your project.

All you need to do is create a new slot right above Main and paste the new script into that.

See D&P3's guide for inserting scripts: How to Insert & Utilize a script
« Last Edit: June 16, 2013, 01:03:23 AM by modern algebra »

**
Rep:
Level 85
...well, that's misleading. I know how most scripts are inserted, but there are plenty made to replace existing RMXP scripts, too, and considering that this one started with the exact same title and formatting as Window_Command, and it didn't contain any instructions implying otherwise, I had just assumed this was one of those scripts.

It's working now, though. Don't I feel like a goof. Thanks.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Yeah, that's alright. I kind of forgot that in RMXP, there were a lot of scripts that directly modified the default scripts.

That practice is strongly discouraged and very rare in RMVX and RMVX Ace (for good reasons), so LiTTleDraGo probably didn't even realize it was something that needed to be instructed not to do.