Script error

Help! I am getting an error with my game. When i tried doing an event this happend:

Script 'Game_event' line 202: NoMethodError occurred.

undefined method '[]' for true:TrueClass
I looked at line 202 of Game_event script and this is there.

     return false unless $game_switches[c.switch1_id]
I have no skill at programming and i don't know how to fix this. Please help.
Some other script must have broken your game somehow.


What custom scripts do you have?
Sleek item popup

Yamfly CM Party Size

Yamfly Custom Menu

Yanfly Core Engine

Item Rarity Colours

WASD Moving

Neon Black Keyboard Input

Neon Black Console

EST Name Input

Allow Battle On Boat
Please give links to the scripts - we cannot help you if we can't read the scripts themselves.
http://pastebin.com/Vfk6eG7F

https://github.com/Archeia/YEARepo/blob/master/Core/Party_Sized_Menu.rb

https://github.com/Archeia/YEARepo/blob/master/Menu/Ace_Menu_Engine.rb

http://pastebin.com/JixNBpBy

http://himeworks.com/redirect.php?type=script&name=Item_Rarity

https://dl.dropboxusercontent.com/u/67149765/RPG%20Maker%20Scripts/WASD%20Movement.txt

http://pastebin.com/raw.php?i=rD4rQtKP

http://pastebin.com/raw.php?i=ZYZ1w1QM

http://pastebin.com/CRxFwGEP

http://rpgmaker.net/scripts/425/code/
That last script is the problem.


It probably was modified or something like that. It's trying to use switches in a really wrong way.
Yea in the last script (the allow battle when on boat one) all the places that has $game_switches well that's a reference to the $game_switches class: so this:

if $game_switches == true endBasically means if the $game_switches class is true do the following. When it should be more like this (which references the array that the switches are held in):

if $game_switches[n] #where n is the id of the switch *note that with if statements #and boolean values you do not need to ask if it is trueendThen these lines which is trying to set the $game_switches class to a boolean value:

$game_switches = true$game_switches = falseShould be:

$game_switches[n] = true #once again n is the id of the switch you want to use.$game_switches[n] = falseHope this helps. 🙂

Edit: Also read Andar's post below probably should not use this script.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Just for info:


That last script is from Soulpour777, and he was banned from this site after we got proof that he took other people's scripts and claimed them as his own after changing credits and function names in them - even to the point of requesting payment for commercial use for himself instead of the person who wrote that script.


Either that script got damaged when he rewrote/renamed parts of it, or he tried to write that himself with not enough understanding of what it does - but I wouldn't use SoulPours scripts anyway because you can never be sure that the credits are correct from him.
Thanks. The problem has been fixed.

Original thread: https://forums.rpgmakerweb.com/threads/script-error.42563/