Comments are causing my game to crash due to a script

Hi friends. I tried to find a way to reach the person who wrote the script in question but wasn't able to, and figured this may be a broader problem that somebody here could help with. For some reason events with comments in them are adversely interacting with the script "Xail System Core / XS Core" prompting a crash and the following error:

Script 'XailCore' line 481: TypeError occurred.

can't convert Regexp into String

 

I'd prefer not to quit using the script. I looked at the referenced line and couldn't figure out what the problem may be. The code in question handles "Adding methods to check for comments on events" and I pasted the whole block into a pastebin in case it might help. http://pastebin.com/uHx0dHQh (line 13 is the referenced "line 481")

 
I think it's a good idea to just post the whole script, not the error part only. Because I can't see what is this script for in a whole.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


No, don't post the whole script. Post a LINK to the original script. And post a screenshot of your event that's causing the crash.
Sorry, friend. Here is a link to the entire script http://niclas-thornqvist.se/rpg/scripts/ace/xs-core.txt

It isn't any specific event, it's literally any event that has a comment -- new, old, regardless of what else is in the event. Thanks much.
Is that this line?

if evt.parameters[0].include?(comment)
It isn't any specific event, it's literally any event that has a comment -- new, old, regardless of what else is in the event. Thanks much.
What about the comment? Is it a specific comment or any comment too?
The method seems to expect a string, however a regular expression is passed instead, which causes the error. The method does not seem to be called anywhere in this script, so the error probably lies either within another script or within an event script command.

You could try to add this script below the troubleshooting one. It won't fix your problem but it should add information about the call stack to find out where the method was called from. However, I improvised the script, so I cannot guarantee it will work correctly.

Code:
class Game_Event  alias_method(:comment_ILC_catchRE, :comment?)  def comment?(comment)    begin      return comment_ILC_catchRE(comment)    rescue      set = $!.backtrace.map do |s|        s.sub(/\{(\d+)}\d+)(.*)/) do          "Script #{$1}: '#{$RGSS_SCRIPTS.fetch($1.to_i, [])[1]}', line #{$2}  #{$3}"        end      end      fail $!.class, "#{$!.message}\n\n#{set.join('\n')}"    end  endend
Thanks Another Fen for the gracious amount of effort. With the advice, I played around with some of the other scripts until the problem went away. Not a very clinical solution or one that will prove helpful to others in the future, but somehow I did it. Thanks again pals.

Original thread: https://forums.rpgmakerweb.com/threads/comments-are-causing-my-game-to-crash-due-to-a-script.36090/