Two Scripts returning Error

I'm using a few scripts together, but the two in question seem to be Modern Algebra's Quest Journal and PAC Main Menu Ace. I had everything working together well until I added the Quest Journal. Game starts up fine but when I open the menu, I get this error:


Script 'PAC Menu' line 337: NoMethodError occurred. undefined method '[]' for nil:NilClass


If it helps, this is line 337 of the PAC Menu script: 


if PAC::MM::Icons && PAC::MM::COMMANDS[index][2] != nil


Has anyone else ran into this problem or know how to fix it? Thanks in advance for any help.
I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


The script forum itself is for presenting scripts you wrote yourself


Please link to the scripts you're using, we can't help without knowing the scripts.


That said, it's easy to break the engine by coding mistakes done when you enter the quests into MA's Quest journal.


To really localise the problem, we will probably need the backtrace of that error - I suggest you follow the link "how to use a script" in my signature to the bughunting and provide us a screenshot of the console output of the backtracer script.
Please link to the scripts you're using, we can't help without knowing the scripts.


That said, it's easy to break the engine by coding mistakes done when you enter the quests into MA's Quest journal.



Sorry about that, thought I was in the right forum. Anyways, here are the links to all the scripts I am currently using:




And about entering code into MA's Quest Journal, I have not yet entered OR altered anything in the Quest Journal. I simply put the script in my game and tried to see if it works. I'm guessing the problem comes from trying to make the Menu Command called "Quest" in my menu list because of this bit of script:


#  MENU_ACCESS - If true, you can access the quest journal through a command 
  # in the menu. If false, there will be no such command.
  MENU_ACCESS = true  <--- I switched this to false and I was able to access my menu without a problem but then I don't have "Quest" in my menu list.
When you set MENU_ACCESS to true, it causes MA's quest journal to overwrite some code related to the menu which PAC's Main Menu script is also changing. You can try swapping the order of the scripts around, i.e. put one above the other in the script editor, and see if that fixes it (I'm guessing it won't but you never know til you try).


The fix you'll likely end up needing is to set MENU_ACCESS to false, and then configure PAC's Main Menu to call MA's quest journal, which - based on a cursory glance at the script - it can totally do. 


EDIT: Yea, so if you add something like:


['Quest',
    'command_personal',
    121,
    'main_commands_enabled',
    'SceneManager.call(Scene_Quest)'],


to the COMMANDS section of PAC's script, then you should be able to call the Quest Journal from the menu.
EDIT: Yea, so if you add something like:


['Quest',
    'command_personal',
    121,
    'main_commands_enabled',
    'SceneManager.call(Scene_Quest)'],

I actually just figured the whole thing out for myself and was coming here to close this out, but yes, you are right but I needed to do both!


The snippet of code you supplied I kind of already knew because I added in another script this way to PAC, the problem was I at first couldn't find the right method to call in the script, then I didn't have the Quest Log above PAC in the script list. After that, the 'command_personal' makes it switch to the actor select side of the Menu screen and you have to click on an actor to activate the Quest Log which I thought is obviously stupid. Anyways, I added in a 'command_quest' into the Script_Menu and now I can call it like normal.


Thanks for checking into it anyways Mobius, I'll still mark it as you solved it 😀  Cheers!

Original thread: https://forums.rpgmakerweb.com/threads/two-scripts-returning-error.60225/