(supposedly) Simple fix needed for Yami Pop Messages and Chatter Add On

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Basically I'm having an error between Yami's Pop Message and Quack's Chatter Add On. The error is that I can't save with both of these scripts. The good news is that someone seems to have had the same problem in the past, and although they didn't post their script changes, they did explain what they did:

"Turns out I found that @quack_msgs and @qmsg_windows can't be marshalled. I managed to fix this by turn both of them into an empty array before saving, and redefine them after saving or loading is successful."

Unfortunately, I don't have enough knowledge of Ruby and scripting to make this change myself. Could someone show me how to do this?

Yami Pop Message: https://github.com/suppayami/rmvxa-collection/blob/master/yami-script-ace/10 - Pop Message.txt

Chatter Add On:
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Objects to be included in save files should never have sprites :(

Put this into a new script slot below the other two and see if it helps. I haven't tested it, so if you get any error messages, please post back.

Code:
module DataManager
  class << self

  alias quack_make_save_contents make_save_contents
  def self.make_save_contents
    $game_message.prep_for_save
    contents = quack_make_save_contents
    $game_message.quack_msg_make
    contents
  end

  alias quack_extract_save_contents extract_save_contents
  def self.extract_save_contents(contents)
    quack_extract_save_contents(contents)
    $game_message.quack_msg_make
  end
end
 
class Game_Message
  def prep_for_save
    @quack_msgs = []
    @qmsg_windows = []
  end
end
It's not great, as it's not disposing of the sprites and is then recreating them every time you save. HOPEFULLY Ace has its own garbage collector that will pick them up and dispose of them. If it does start to consume memory and/or lag the more you save, just post back and I'll see if I have time to do a proper fix.
 
Last edited:

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
It's not great, as it's not disposing of the sprites and is then recreating them every time you save. HOPEFULLY Ace has its own garbage collector that will pick them up and dispose of them. If it does start to consume memory and/or lag the more you save, just post back and I'll see if I have time to do a proper fix.
Hmmm...wondering how I should appropriately test that. Would going into a room and saving 100 times or so make it clear whether there's a problem or not? Or would I need to apply certain conditions to make sure there isn't a problem? I.e. constantly saving with a bunch of chatter boxes going off around me 24/7?
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I'd open the task manager and make it show memory and CPU usage. Then yes, you could go into a room and save 100 times (or maybe not that many). I expect the memory usage might go up a tiny bit with each save, but if you wait a while, hopefully it'll come back down again.

Or you could just play as you'd expect players to - they're not likely to be saving over and over again in a short duration. If you do the above and memory usage increases, but goes back down again, it's probably okay unless you notice the game lagging after each save.

Did you try it out and see if it actually runs without crashing? That'd be the first test :)
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Oh I was gonna try it tomorrow. I need to get to bed now. x.x Anyway, I'm only in the early segments of my game right now. I'd say it's an hour long in total at the moment. I want to more or less "get everything right" before moving on. Imagine if I only realized, halfway through my game, that this wasn't working and I had to go all the way back to the start...and fix everything.

Which is why I was trying to find a method to quickly and thoroughly check if this will be a problem. But yeah, I'll try to see if I get the game to lag when I have the chance.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
It's more important right now to know that you can run the script, as I didn't test it before posting. You can check for lag any time after that, and if it lags because of this, we'll fix it :)
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
OK really quick before I go to bed:

1) First time I tested it, it was missing an end. I just added an extra one to the bottom to see if it'd fix things. Keep in mind I don't know anything about Ruby. ^^;

2) After I added this, it crashed with the message "undefined method "quack_msg_make"" for the Chatter script. Note that the Chatter script was still operating (albeit couldn't be saved) before I put this in.

EDIT: Also I double checked. Qonvenience isn't actually necessary for the script itself. To make things easier, I'll just move forward with the assumption that it isn't being used.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
It's not a good idea to just add things to scripts if you don't know what you're doing. I just rechecked mine, and there is no end missing. If there was when you added it to your script, and it specifically said it was that script that was missing an 'end', you may not have copied it correctly.

The only time I'd expect you'd get the "undefined method quack_msg_make" error is if you had removed the quack message script, played and saved a game, added the script, then tried to load the saved game. At what point did you get the error - when saving, or when loading? Try starting a new game, saving it, then loading it and see if you still get the error.
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Yeah, I copied and pasted it in again. "unexpected $end, expecting keyword_end" for line 23. Not seeing why, it looks like there's enough ends to me too...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Are you sure it's on THIS script? Do you have all your script slots named, and does it specifically say that it's this script that has the issue? Can you show a screenshot of your script editor, with this script visible, and a screenshot of the error message?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
That's crazy! I can't see anything wrong with that at all, and even the syntax highlighting matches everything up.

What if you just add an extra blank line at the bottom, so that line 23 has a line break right at the end. Does that make a difference?

Otherwise, maybe someone else can see what's wrong.


edit ... wait a sec. I do see a couple of things I missed, and one of them might cause this. I edited my script - can you copy it again from the earlier post and replace what you have in your project?
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
682
Reaction score
446
First Language
English
Primarily Uses
RMVXA
@Shaz I think you might need an end to enclose the class << self. Like this:
Code:
module DataManager
  class << self
    alias quack_make_save_contents make_save_contents
    def self.make_save_contents
      $game_message.prep_for_save
      contents = quack_make_save_contents
      $game_message.quack_msg_make
      contents
    end

    alias quack_extract_save_contents extract_save_contents
    def self.extract_save_contents(contents)
      quack_extract_save_contents(contents)
      $game_message.quack_msg_make
    end
  end
end
 
class Game_Message
  def prep_for_save
    @quack_msgs = []
    @qmsg_windows = []
  end
end
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Same error from the new version (just on line 24). Moonless' script doesn't crash...but saving still isn't an option either.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
@A-Moonless-Night I'm not seeing a difference between yours and mine, except the extra blank lines I have. Or did you post that while I was doing my edit? The def self.--- always gets me on modules! Does that mean the original script, posted in the first post, would also not work? It doesn't have self. at the start of the DataManager methods either.
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Well neither "work" for the time being, but the one in the first post still crashes at line 24.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
People, pls. If you use "class << ModuleName", then stop using "def self.methodname"
Code:
class << DataManager
  alias quack_make_save_contents make_save_contents
  def make_save_contents
    $game_message.prep_for_save
    contents = quack_make_save_contents
    $game_message.quack_msg_make
    contents
  end

  alias quack_extract_save_contents extract_save_contents
  def extract_save_contents(contents)
    quack_extract_save_contents(contents)
    $game_message.quack_msg_make
  end
end

class Game_Message
  def prep_for_save
    @quack_msgs = []
    @qmsg_windows = []
  end
end
 

KingHazeel

Veteran
Veteran
Joined
Jul 5, 2018
Messages
125
Reaction score
5
First Language
English
Primarily Uses
RMVXA
Theo's version also doesn't crash. It's still impossible to save unfortunately. ^^;
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
Remove any added scripts you got here from the others and add this one instead:
Code:
class Window_Message < Window_Base

  def dispose
    if @speech_bubble_tag
      @speech_bubble_tag.bitmap.dispose
      @speech_bubble_tag.dispose
    end
    if @thought_bubble_tag
      @thought_bubble_tag.bitmap.dispose
      @thought_bubble_tag.dispose
    end
    yse_pop_dispose
  end

end

class Game_Message

  def disp_stuff
    if @quack_msgs
      @quack_msgs.each {|msg| msg.disp_stuff }
      @quack_msgs = []
    end
    if @qmsg_windows
      @qmsg_windows.each {|win| win.dispose }
      @qmsg_windows = []
    end
  end
 
end

class << DataManager
  
  def create_game_objects
    quack_msg_create_game_objects
  end
 
  def setup_new_game
    qmsg_sng
  end
  
end

class Scene_Map < Scene_Base
 
  alias make_quacks0027 create_message_window
  def create_message_window
    $game_message.quack_msg_make
    make_quacks0027
  end
 
  def dispose_all_windows
    $game_message.disp_stuff
    super
  end
 
end

class Scene_Battle < Scene_Base
 
  alias make_quacks0021 create_message_window
  def create_message_window
    $game_message.quack_msg_make
    make_quacks0021
  end
 
  def dispose_all_windows
    $game_message.disp_stuff
    super
  end
 
end
Put it below Yami's and Quack's scripts.
And you should make sure that Quack's script is right below Yami's, and put all these 3 scripts as high as possible on your custom script list, because this fix overwrites some pretty important methods to get rid of issues created by Quack's script.
Alternatively, you can also remove the DataManager part from both Quack's script and from this fix, that should work, and it should be more compatible, leaving you more freedom to position these 3 scripts on your script list.

There are so many wrongs in Quack's script, it hurts. >.>
I can't guarantee that this fix will work with other scripts altering the message box related classes.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top