Yanfly Battle System Script causing Name Input crash

jsn2001

Villager
Member
Joined
Mar 10, 2014
Messages
22
Reaction score
1
First Language
English
Primarily Uses
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?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,380
Reaction score
8,537
First Language
English
Primarily Uses
RMMV
I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
 

jsn2001

Villager
Member
Joined
Mar 10, 2014
Messages
22
Reaction score
1
First Language
English
Primarily Uses

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Do you have any other script in your game? I know it points into that script but sometimes the root problem actually lies elsewhere..
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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.  
 
Last edited by a moderator:

jsn2001

Villager
Member
Joined
Mar 10, 2014
Messages
22
Reaction score
1
First Language
English
Primarily Uses
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 

jsn2001

Villager
Member
Joined
Mar 10, 2014
Messages
22
Reaction score
1
First Language
English
Primarily Uses
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.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
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:

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).
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

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,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top