Yanfly Battle System Script causing Name Input crash

Basically, when I try to run a name input processing event for actor 10 (default: Player, have tried with no default name) the game crashes with this error:


"Script yanflybattle line 1295: NoMethodError occurred.


undefined method '[]' for nil:NilClass"


"yanflybattle" is Yanfly's Ace Battle Engine. I do have the Ace Core Engine.


How do I fix this?
Please give a link to the script.


Did you add the script and then resumed a previously-saved game?  That causes a lot of problems like the one you describe.  If that's what you did, start a new game instead and see if it makes a difference.
I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Please give a link to the script.


Did you add the script and then resumed a previously-saved game?  That causes a lot of problems like the one you describe.  If that's what you did, start a new game instead and see if it makes a difference.

Here's the script. https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/


And nope, completely new game.
Do you have any other script in your game? I know it points into that script but sometimes the root problem actually lies elsewhere..
It seems very strange.  That line refers to a state's popup_rules, and the error message indicates that the popup_rules object for the state have not been set up.  This line would only get called in battle, so I have no idea why you're getting an error message on that line in that script when you use Name Input Processing.  
Do you have any other script in your game? I know it points into that script but sometimes the root problem actually lies elsewhere..

Well, like I said I also have Yanfly's Ace Engine Core and his message system, as well as Rbahamut's pre-title screen script.
can you give us a detailed step by step of what you did until you encountered the error? It's really weird if it does call an error on a line that is supposedly only called in battle
I know, it is weird. This name input event is at the start of a game, a label called "1" is added directly before it, and just text before that.
The method which triggers the error is executed even outside of battles, there is no check to see if the party is in battle or not.


It gets executed whenever an actor (or enemy, but there are no enemies on the map) gets a state inflicted or removed.


Regardless, if it can't find the @popup_rules variable for a state, that indicates that it's either


1. A loaded game (but it's not, according to the poster)


2. A compatibility issue with another script dealing with states.


3. Incorrect script settings (specifically, wrong or non-existent settings in the POPUP_RULES setting).


4. Incorrect popup rules note-tag usage (this can be related to the 3rd issue).


Number 3 and 4 is the most probable.


Have you changed the setting I mentioned? If so, how does it look like now?


Have you used any popup rules note-tag for your states? If so, show us those note-tags.


The default POPUP_RULES setting for state infliction uses the "ADDSTATE" key, while the default for state removal uses the "REMSTATE" key.


If you removed those settings, you will get this error for sure, unless you used valid custom popup rules note-tags on all of your states (or at the very least, on the 1st state - the death state - reasons explained below).


Either way, it got nothing to do with Name Input Processing commands. 


When you start the game, the method where the error is called automatically (kinda dumb, but the system inflicts state 1 on the starting actors before actually setting their HP, and hence removing the death state). That is why it happens right at the start, not because of your eventing stuffs.


Edit:


Actually, number 3 and 4 is not really possible just by having incorrect settings and/or note-tags.


Insert this script right before your Main slot, below all other custom scripts:

Spoiler
Code:
class << DataManager

  alias reinit_notes8816 create_game_objects
  def create_game_objects
    load_notetags_abe
    reinit_notes8816
  end

end

This will reinitialize the new data from Yanfly's Battle Engine.


If this works, it is a compatibility issue.


Specifically, something below the battle engine script overwrites the load_database method in the DataManager module.


Some save scripts do this for some unknown reason, and maybe some other badly written scripts.


Check your scripts for that method, and if you find any, move it above the battle engine script (or better yet, above every custom scripts).

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battle-system-script-causing-name-input-crash.71978/