Schala crashes the game!!

Help!


https://atelierrgss.wordpress.com/rgss3-schala-battle-system/


Script 'Game_Interpeter' line 1411: NoMethodError occured.


undefined method 'move_to' for nil:NilClass


This is as indepth replicate of the error as I was able to produce


Game_Interpreter:1411:in `eval': undefined method `fade=' for nil:NilClass, NoMethodError
    from Game_Interpreter:1411:in `eval'
    from Game_Interpreter:1411:in `command_355'
    from Game_Interpreter:197:in `execute_command'
    from Game_Interpreter:103:in `run'
    from Schala Battle System:3091:in `run'
    from Game_Interpreter:60:in `block in create_fiber'
Since that battlesystem works for a lot of people, this error means you have done something wrong when you installed it in your project.


Please describe the steps you did to install the script and its resources into your project.


Especially important is to check if you copied everything needed, and configured everything correctly.


You can follow the link "how to use a script" to check the possible steps you might have missed.
Since that battlesystem works for a lot of people, this error means you have done something wrong when you installed it in your project.

Please describe the steps you did to install the script and its resources into your project.

Especially important is to check if you copied everything needed, and configured everything correctly.

You can follow the link "how to use a script" to check the possible steps you might have missed.
It only crashes in one battle against one enemy, like that. But it's the final boss!!!!

It also doesn't happen always, it is very irregular error and  I have absolutely no idea of what's causing it.

Edit: What how to use script? There's nothing like that on the page.
I meant the link in my signature, not on Moghunter's page


Especially important is the error message of the backtracer instead of the incomplete default error message.


And even if it doesn't always happen, we can't help you without you showing us what you did in screenshots
But it doesn't crash on me, I don't get any errrors. A guy can have the error and crash and B guy doesn't. It's extremely conditional and I have no idea what the conditions are. I get reports that a guy who crashed earlier when he played through the game again didn't crash.


That's why gathering any information on it is nearly impossible.
Bump, I really need help with this!
A random occurance error is very difficult to track, and you don't give much info to go on.


I can only suggest that you follow the link "bughunting" in my signature and try to locate the bug by continuous testing until you know when it appears.


Because most probably it's either a timing error or an incompatibility between two scripts.
A random occurance error is very difficult to track, and you don't give much info to go on.


I can only suggest that you follow the link "bughunting" in my signature and try to locate the bug by continuous testing until you know when it appears.


Because most probably it's either a timing error or an incompatibility between two scripts.



I think this is the closest to the move.to problem I have been able to get. I can't get the same error, I've already explained it doesn't crash like that for me. I have no idea about what continuous bug testing you want me to do becausue there's literally no way for me to replicate this bug and it hasn't crashed for any of my testers either. This however, seems to relate to the same problem possibly.


Game_Interpreter:1411:in `eval': undefined method `fade=' for nil:NilClass, NoMethodError
    from Game_Interpreter:1411:in `eval'
    from Game_Interpreter:1411:in `command_355'
    from Game_Interpreter:197:in `execute_command'
    from Game_Interpreter:103:in `run'
    from Schala Battle System:3091:in `run'
    from Game_Interpreter:60:in `block in create_fiber'


I can't give more info because I don't have any info.
Bump
Please help, I'm desperate. I'm willing to even pay a money tip if you help me out.
Please help.
Since 'move_to' is not a default method, you should search for 'def move_to' or '@move_to' with a full search in the script editor (CTRL+SHIFT+F).


Copy the whole method here (if it is a method) and I will check it.


If there is no method named like that, than search for '.move_to' and check on what it has been called. I'm guessing that it is called on an event (as well as that other error you get with the 'fade' stuff), but if there is no event on map or if there is a condition which results in no event selected for the methods, you will get that NoMethod error.
Since 'move_to' is not a default method, you should search for 'def move_to' or '@move_to' with a full search in the script editor (CTRL+SHIFT+F).


Copy the whole method here (if it is a method) and I will check it.


If there is no method named like that, than search for '.move_to' and check on what it has been called. I'm guessing that it is called on an event (as well as that other error you get with the 'fade' stuff), but if there is no event on map or if there is a condition which results in no event selected for the methods, you will get that NoMethod error.

 @SixthHere is the whole method from Schala Battle.


#--------------------------------------------------------------------------
  # ● Move Position
  #--------------------------------------------------------------------------                      
  def move_to(target, px = 0 , py = 0,height = 10)
      jump_count = 0
      jump_peak = 0
      if target_enemy != nil and $game_temp.on_target_size != 0
         case $game_temp.on_target_size
              when 1;   py -= (target_enemy.sprite_size[5]).truncate
              when 2;   py -= (target_enemy.sprite_size[3]).truncate
              when 3;   py += (target_enemy.sprite_size[5]).truncate
              when 4;   py += (target_enemy.sprite_size[3]).truncate                
         end     
      end       
      if target == target_screen
         if height > 0
            jump_position(self.x,self.y,real_cx + px,real_cy + py, height)
         else
            moveto_action(real_cx + px, real_cy + py)
         end  
       else
        if height > 0
           jump_position(self.x, self.y ,target.x + px, target.y + py, height)
        else
           moveto_action(target.x + px , target.y + py )
        end  
      end
  end 
I don't get how you get an error on that method, it is not used anywhere, at least not in the script directly. 


Do you use that 'move_to' method with script calls?
I don't get how you get an error on that method, it is not used anywhere, at least not in the script directly. 


Do you use that 'move_to' method with script calls?



Yes, it's used in several special moves. The crashing comes from one of the special moves which is basically the "Ogre Slayer" from the Schala.
As told before, you need to give us more information if you want help to solve the problem.


For example, you should have automatically included a screenshot of the setting of the skill for that "Ogre Slayer" when that is where the bug happens.


Every time we have to ask you for details, it will only delay the answer.
As told before, you need to give us more information if you want help to solve the problem.


For example, you should have automatically included a screenshot of the setting of the skill for that "Ogre Slayer" when that is where the bug happens.


Every time we have to ask you for details, it will only delay the answer.

Here it is, for you and @Sixth


ogre.pngInsert other media
Seeing that, it is clear that at some point, either the 'user' or the 'target_enemy' becomes 'nil'.


I don't really know what is happening in all those script calls, I just assume that you do some angle changes and movement commands on the user and target of the skill.


And it seems to be random, because your testers either killed the enemy with that skill or was killed by the enemy while that skill was being used, but obviously, that was not the case all the time.


You can add a nil check for every lines using 'user' or 'target_enemy' in the script calls.


For example:

Code:
user.move_to(target_enemy) if user && target_enemy


This would first check if the user and target_enemy is 'nil' or not. If one of them or both are 'nil', it will skip this line, if both are valid (not nil), it will run the line.


It is quite tedious if you use these script calls often, but it should eliminate the error you get. 
Seeing that, it is clear that at some point, either the 'user' or the 'target_enemy' becomes 'nil'.


I don't really know what is happening in all those script calls, I just assume that you do some angle changes and movement commands on the user and target of the skill.


And it seems to be random, because your testers either killed the enemy with that skill or was killed by the enemy while that skill was being used, but obviously, that was not the case all the time.


You can add a nil check for every lines using 'user' or 'target_enemy' in the script calls.


For example:

Code:
user.move_to(target_enemy) if user && target_enemy



This would first check if the user and target_enemy is 'nil' or not. If one of them or both are 'nil', it will skip this line, if both are valid (not nil), it will run the line.


It is quite tedious if you use these script calls often, but it should eliminate the error you get. 



So for something like

Code:
target_enemy.move_to(user,0,0,0)

I'd make it as

Code:
target_enemy.move_to(user,0,0,0) if target_enemy && user

Or is that wrong?


EDIT: It now crashed with


"Set_direction"  for nil:NilClass


Game_Interpreter:1411:in `eval': undefined method `set_direction' for nil:NilClass, NoMethodError
    from Game_Interpreter:1411:in `eval'
    from Game_Interpreter:1411:in `command_355'
    from Game_Interpreter:197:in `execute_command'
    from Game_Interpreter:103:in `run'
    from Schala Battle System:3091:in `run'
    from Game_Interpreter:60:in `block in create_fiber'


and


"restore_position"


It happened becausue the enemy was actually able to attack me while the skill was still going on. I think that is what is causing the issue.
Yes.


The order for the check doesn't really matter. You can use:

Code:
if target_enemy && user

or


if user && target_enemy


as well. Both should work.

Original thread: https://forums.rpgmakerweb.com/threads/schala-crashes-the-game.54887/