Kadafi - Command Disabler ( "Items" commands conflict )

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
Hello !


Script :


http://kakakadafi.blogspot.ch/2014/06/kadafi-command-disabler-version-1.html


I have a conflict with only the command "Items".


There is 3 "Items" level :


#1 MENU


#2 MENU  Items


#3 BATTLE Items


If I using only one of them, it works perfectly, but as soon I use 2 of them, One is not working.


I figured out it's always in the same order, The last one has always priority.


Ex: If I use 1 and 3, 3 is working but not 1.


Ex: If I use 2 and 3, 3 is working but not 2.


Of course I am using different switchs !


I'm using this script for over 1 year only for battle restriction and it works nice, but recently I wanted to try MENU restriction


that unable all the MENU commands but the EQUIP one.


All others commands turn OFF but the ITEMS one. ( and in battle the "Items" is OFF )


I was thinking the problem could be because there is only 1 name in database for "Items" and the game or script


dont know how to manage it ...


I tried in a new project and it looks to work ... do you think another script is messing this one ?


I'll do deeper examinations, but if you can help me to point a clue...


                                                            --------------------------------------------------------------------


EDIT #1: I copied/pasted one by one all of my 22 scripts from my project to the new project, thinking I could find the problem,


               but everything is going well in the new project. I hope I dident touch something in the basics scripts...


                                                            --------------------------------------------------------------------


EDIT#2: I just accidently figured something. Because the last one of them looks to be the "master", If I use only the last one, all


              ITEMS situations are affected. So I using the BATTLE ITEMS switch to unable ITEMS even for the MENU.


Now I hope that's not just a "trick" and It will work longtime.


Personal note: I have to stop to figure out my self when it's something I'am not suppose to have any knowlege about it.


                        Even If I hate to find out by accident, I learned something today !


                                                            --------------------------------------------------------------------


Thanks in advance !
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Of course it won't work, because that config part is stored in a hash.


You can't have duplicate keys in a hash. Well, you can, but only the last one will be loaded, the rest are overwritten.


There are many problems with the way how that is set up. 


First, the problem of duplicate keys used in the hash (which you already figured out).


Second, the possibility of some commands which use the same name on the same scene.


Third, the possibility of multiple command windows using the same class.


If the first issue is fixed, the 2nd and 3rd will still be here, which makes it impossible to do a general setting area for this. Fully individualized checks can only be done if you do a separate check for each of your command buttons yourself.


However, if you don't have any scenes with any command windows using the same names, you can try to use this modified script which is based on scenes, rather than a global setting.


http://pastebin.com/rRGuXzr7


You will notice that the setting layout is a little bit different now. You have to enter the name of the scene class and inside that, enter your button+switch settings (so, a hash in a hash). If you don't know the name of a scene class, you can always check the default "Scene_XYZ" scripts in your script editor, the name of them contains some logic, so you should know what scene is what.


If you need to enter a setting for a custom scene, you need to read a bit of the code in these custom scripts, get the name of the custom scene, and enter the setting for that scene the same way like for the default scenes.
 

Fridjah

Veteran
Veteran
Joined
Jan 13, 2015
Messages
155
Reaction score
7
First Language
French
Primarily Uses
RMVXA
Thank you Sixth I tried it and looks to work.


I will still use the original one, cause of to much switches to change in the project.


But If I suddenly NEED separated "Items" switches, sure I will use !


Honestely I dident understood the last paragraph, with the "Scene_XYZ" that I dident see anywhere and all the custom scenes.


whatever, thank you +1


PS: And cause you know the kadafi script now, please just take a look here please. (If can/want)
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,050
Messages
1,018,548
Members
137,835
Latest member
yetisteven
Top