THENECROMANCER'S PROFILE
TheNecromancer
3160
RMN sucks
Search
Filter
[RMMV Scripting] How do I split my plugin source code into multiple files?
[RM2K3] Is it possible to disable buttons?
Yeah, that looks good.
I'm not sure how your menu works though. I assume you have another event that handles interacting with the menu. Something that checks key inputs and move a cursor?
The first event you have here, is something that runs all the time during the game. Once you call the menu, it should turn on another event that contains the menu stuff. And it's in THAT event that you should have the code to close the menu, as that is another function along the lines of moving the cursor and selecting a menu item. The first event is no longer used, until you close the menu, turn off the switch, and you are back to the game again. I didn't think of that earlier. So you can remove the else branch from event 1 and relocate that code.
The second event you are showing here is unnecessary(unless this is actually where you will be building your custom menu, which I suppose it is since your Common event list is empty). You should have the show menu picture code in the first event, right after you turn on the menu switch. The idea is that when you press 6, it turns on the menu switch and shows pics/menu, preventing the show menu code from running again until you activate the code that does it in reverse. It should remove the pics/menu, and then turn off the menu switch.
The menu should be a self contained system. With all functions relating to it all inside the same event(except showing it, of course).
Looks like you are on the right track now. Swap the code in those events, remove the else branch in event 1, and build your menu in event 2.
I'm not sure how your menu works though. I assume you have another event that handles interacting with the menu. Something that checks key inputs and move a cursor?
The first event you have here, is something that runs all the time during the game. Once you call the menu, it should turn on another event that contains the menu stuff. And it's in THAT event that you should have the code to close the menu, as that is another function along the lines of moving the cursor and selecting a menu item. The first event is no longer used, until you close the menu, turn off the switch, and you are back to the game again. I didn't think of that earlier. So you can remove the else branch from event 1 and relocate that code.
The second event you are showing here is unnecessary(unless this is actually where you will be building your custom menu, which I suppose it is since your Common event list is empty). You should have the show menu picture code in the first event, right after you turn on the menu switch. The idea is that when you press 6, it turns on the menu switch and shows pics/menu, preventing the show menu code from running again until you activate the code that does it in reverse. It should remove the pics/menu, and then turn off the menu switch.
The menu should be a self contained system. With all functions relating to it all inside the same event(except showing it, of course).
Looks like you are on the right track now. Swap the code in those events, remove the else branch in event 1, and build your menu in event 2.
Making games? What motivates you?
For me, working with other people keeps me motivated. When it's just me, I don't have to answer to anyone for slacking off. I don't want to leave someone else high and dry, plus when you don't have to do everything yourself it just feels...lighter. You don't have that heavy monkey on your back of "i still have to find/make chipsets, and charsets, and add music, and code this, and balance that...".
[RM2K3] Is it possible to disable buttons?
I don't quite follow your solution, but it sounds unnecessary. But hey, at least it works.
I would like to make a few comments and suggestions on what I see here, if you're interested.
Most importantly, for every parallel process you should have at least a 0.0 wait at the bottom, or 0.1. Having no wait means that parallel process runs more often than is needed and after a while of adding more events running alongside, you will end up with lag. It's much easier to plan for that, instead of waiting until your game lags then searching for the reason why. Form the habit early and save yourself the headache, trust me. Those kinds of waits won't have any noticeable effect on the response time of the player pressing that key. If you start to go higher it would.
When you are checking for key input, there should be a wait after the code it triggers. To ensure that holding the button, or pressing it again quickly, isn't registered. Less than a second should do. *The reason it didn't change anything here is because you structured your code wrong*
The best way to structure this kind of thing(to avoid the issue you have) is to separate the key input code from the action. You want it parallel process so it's always checking if the player pressed the button, but you only need the action to happen once. If you take all that picture code and put it on another common event that is NOT parallel/autorun, you can use the call event command in place of all that code. Ensuring that it will only run once per button press. It really cuts down on bugs and problems like this.
It looks like you are setting the key variable to 0. That happens when the player lets go of the button and I don't think setting it to 0 will really help anything. The key input event itself has a check box for 'wait for button', or whatever, that handles it.
What you're doing here is...wait a minute. I'm just realizing something is wrong. Let me show you the proper way to do key input checks.

Here is the most basic example of how to set it up.
The key input comes first. But before you do anything else, it needs to be followed by a conditional branch that checks the variable you selected. So that the code will only trigger if you press the right button.
So going down line by line, the logic of my code is like this:
Check key input, and store the value of whatever key the player pressed in variable 401.
Check what is in variable 401.
.\If it's 11, meaning the player pressed number 1, then do something.
..\ If it's not 11, do nothing. (you don't need an else branch for this to be true)
Wait 0.1 before checking again.
Here is how the logic of your code goes:
Disable the menu (this shouldn't be here as it only needs to happen once)
Check if the menu is already open
.\If it's not, check if the player is pressing cancel.
.\I have no idea what key the player pressed, but I'm turning the menu switch on anyways
This starts the code for the second common event
NOW I'll check which key the player pressed, but the menu is already turned on so it doesn't really matter what it is
And I'll just go ahead and show the menu pictures now
So, you only need one common event, structured the way I have it in my example. You only need one key input process for all of this. It goes at the top. Followed by the branch to check which button was pressed, if it's 6. Then inside that you would put a branch to check if menu switch is ON. Under yes part, put code for opening menu. In the else part, put the code for closing the menu. That will do it.
Oh, and all the stuff you did with labels actually does nothing at all. A label is useless without a matching jump to label command. So label 1 isn't needed. And you are telling the code to jump to label 2, but it was going to do that anyways. I won't get into how to use labels, unless you really want to know.
I would like to make a few comments and suggestions on what I see here, if you're interested.
Most importantly, for every parallel process you should have at least a 0.0 wait at the bottom, or 0.1. Having no wait means that parallel process runs more often than is needed and after a while of adding more events running alongside, you will end up with lag. It's much easier to plan for that, instead of waiting until your game lags then searching for the reason why. Form the habit early and save yourself the headache, trust me. Those kinds of waits won't have any noticeable effect on the response time of the player pressing that key. If you start to go higher it would.
When you are checking for key input, there should be a wait after the code it triggers. To ensure that holding the button, or pressing it again quickly, isn't registered. Less than a second should do. *The reason it didn't change anything here is because you structured your code wrong*
The best way to structure this kind of thing(to avoid the issue you have) is to separate the key input code from the action. You want it parallel process so it's always checking if the player pressed the button, but you only need the action to happen once. If you take all that picture code and put it on another common event that is NOT parallel/autorun, you can use the call event command in place of all that code. Ensuring that it will only run once per button press. It really cuts down on bugs and problems like this.
It looks like you are setting the key variable to 0. That happens when the player lets go of the button and I don't think setting it to 0 will really help anything. The key input event itself has a check box for 'wait for button', or whatever, that handles it.
What you're doing here is...wait a minute. I'm just realizing something is wrong. Let me show you the proper way to do key input checks.

Here is the most basic example of how to set it up.
The key input comes first. But before you do anything else, it needs to be followed by a conditional branch that checks the variable you selected. So that the code will only trigger if you press the right button.
So going down line by line, the logic of my code is like this:
Check key input, and store the value of whatever key the player pressed in variable 401.
Check what is in variable 401.
.\If it's 11, meaning the player pressed number 1, then do something.
..\ If it's not 11, do nothing. (you don't need an else branch for this to be true)
Wait 0.1 before checking again.
Here is how the logic of your code goes:
Disable the menu (this shouldn't be here as it only needs to happen once)
Check if the menu is already open
.\If it's not, check if the player is pressing cancel.
.\I have no idea what key the player pressed, but I'm turning the menu switch on anyways
This starts the code for the second common event
NOW I'll check which key the player pressed, but the menu is already turned on so it doesn't really matter what it is
And I'll just go ahead and show the menu pictures now
So, you only need one common event, structured the way I have it in my example. You only need one key input process for all of this. It goes at the top. Followed by the branch to check which button was pressed, if it's 6. Then inside that you would put a branch to check if menu switch is ON. Under yes part, put code for opening menu. In the else part, put the code for closing the menu. That will do it.
Oh, and all the stuff you did with labels actually does nothing at all. A label is useless without a matching jump to label command. So label 1 isn't needed. And you are telling the code to jump to label 2, but it was going to do that anyways. I won't get into how to use labels, unless you really want to know.
[RMMV Scripting] How do I split my plugin source code into multiple files?
I'm not suggesting you give up, but that you face the strong possibility you can't do this. To my knowledge no (or very few) RPGmaker programs support subfolders in any way. If subfolders don't work for any other resource folders, which would need to be tested I don't know MV, then that would be another clue this isn't possible. It's unlikely they would enable subfolders for just plugins.
I would think that if this was possible you would have found some information on it by now, assuming you did sufficient searching. A feature like this wouldn't be so hidden and mysterious. The obvious ways of doing it don't work. I highly doubt if they did add this ability, that they would make it so difficult to use. So, you know...
I think maybe you're being a little too optimistic. I'm not being defeatist, I'm being realist based on the evidence and my experience with RPGmaker programs(a long ass time). Good luck, but perhaps your time and effort would be better spent finding a way to work within the limits of the program. Something that has always been sort of a golden rule of RMs since like 1995 heh.
I would think that if this was possible you would have found some information on it by now, assuming you did sufficient searching. A feature like this wouldn't be so hidden and mysterious. The obvious ways of doing it don't work. I highly doubt if they did add this ability, that they would make it so difficult to use. So, you know...

I think maybe you're being a little too optimistic. I'm not being defeatist, I'm being realist based on the evidence and my experience with RPGmaker programs(a long ass time). Good luck, but perhaps your time and effort would be better spent finding a way to work within the limits of the program. Something that has always been sort of a golden rule of RMs since like 1995 heh.
What age range are the characters in your games?
If you google "tellfunnyjokes.com" something about the results seem odd. They are rarely that uniform haha
THE Captain's Log! #58 SPECiAL (?): Demo release Date
[RMMV Scripting] How do I split my plugin source code into multiple files?
Have you tried reading the RPGmaker help file? Maybe it's not possible and the help file may state that.
Have you seen any other game use subfolders in this way? If yes, then you could ask them. If no, maybe that points more to it not being possible.
Have you seen any other game use subfolders in this way? If yes, then you could ask them. If no, maybe that points more to it not being possible.
[RM2K3] Is it possible to disable buttons?
It has to do with how you code it, using switches and conditional branches.
Your code for checking if you can press B to bring up the menu should be inside a branch. The condition for that branch should be a switch, oh let's say, MENU OPEN is OFF. It's off by default, so the player will be able to press B and it runs that code.
As part of that code, first thing, it should turn ON that switch MENU OPEN. This will not allow the open menu code to run again until that switch is turned off. Which you would add at the end of the code that hides the menu.
This is the basic idea and is actually something you should do with most code. By turning on a switch when you do any action, you can then use it to tell other code what is happening. For example, if you didn't want the player to be able to press SHIFT to swing their sword(assuming that is possible), then you would put all the code for swinging the sword inside a branch that checks if MENU OPEN is OFF. That way, if the menu is open(because the switch is on) then without doing anything extra your sword will be disabled while the menu is open.
Your code for checking if you can press B to bring up the menu should be inside a branch. The condition for that branch should be a switch, oh let's say, MENU OPEN is OFF. It's off by default, so the player will be able to press B and it runs that code.
As part of that code, first thing, it should turn ON that switch MENU OPEN. This will not allow the open menu code to run again until that switch is turned off. Which you would add at the end of the code that hides the menu.
This is the basic idea and is actually something you should do with most code. By turning on a switch when you do any action, you can then use it to tell other code what is happening. For example, if you didn't want the player to be able to press SHIFT to swing their sword(assuming that is possible), then you would put all the code for swinging the sword inside a branch that checks if MENU OPEN is OFF. That way, if the menu is open(because the switch is on) then without doing anything extra your sword will be disabled while the menu is open.













