[ACE] Need help with CDR Guide script

Taiki16

Villager
Member
Joined
Oct 23, 2014
Messages
25
Reaction score
1
First Language
Français
Primarily Uses
Hi everyone,

I use this very useful script in my project who is made by Ceodore but modified by GreatRedSpirit. You can find this script here: https://rpgmaker.net/forums/topics/15877/

However, i encountered one problem:

- When i save the game, the tutorials doesn't save. So when i restart, i lost them.
So if anyone can fix this problem it would be very nice.

Thanks for your help.
 
Last edited:

Taiki16

Villager
Member
Joined
Oct 23, 2014
Messages
25
Reaction score
1
First Language
Français
Primarily Uses
bump again if anyone can resolve this problem
 

Taiki16

Villager
Member
Joined
Oct 23, 2014
Messages
25
Reaction score
1
First Language
Français
Primarily Uses
I had exactly the same problem on another script and thanks to a very generous person, he managed to solve the problem.
He added this in the script:
Code:
module DataManager
  class <<self
    alias fog_init init
    def init
      fog_init
      load_latest_variables rescue nil
    end
  end
 
  def self.load_latest_variables
    File.open(make_filename(latest_savefile_index), "rb") do |file|
      Marshal.load(file)
      contents = Marshal.load(file)
      $game_variables = contents[:variables]
    end
  end
end
But the problem is that CDR tutorial use switches instead of variables. So i tried to replace the variables with switches but no result. :headshake:
And since I'm not very good at scripting, I'm not sure how to do it.
 

Taiki16

Villager
Member
Joined
Oct 23, 2014
Messages
25
Reaction score
1
First Language
Français
Primarily Uses
Help? Nobody?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
1,931
Reaction score
414
First Language
English
Primarily Uses
RMVXA
the problem with the script is that it actually doesn't use the switches for knowing what guides are available or watched. As soon as you get the guide the switch for it is turned off. The data is saved in some other variable.
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
570
Reaction score
392
First Language
English
Primarily Uses
RMVXA
Does this work?
Code:
module DataManager
  class << self
    alias :amn_guides_datamanager_makesavecontents :make_save_contents
    alias :amn_guides_datamanager_extractsavecontents :extract_save_contents
  end
 
  def self.make_save_contents
    contents = amn_guides_datamanager_makesavecontents
    contents[:guides] = {}
    contents[:guides][:memory] = GuideManager.get_memory
    contents[:guides][:read] = GuideManager.get_read
    contents
  end

  def self.extract_save_contents(contents)
    amn_guides_datamanager_extractsavecontents(contents)
    GuideManager.set_memory(contents[:guides][:memory])
    GuideManager.set_read(contents[:guides][:read])
  end

end

module GuideManager
  def self.get_read
    @read
  end
 
  def self.get_memory
    @memory
  end 
 
  def self.set_read(data)
    @read = data
  end
 
  def self.set_memory(data)
    @memory = data
  end
end
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I posted a funny gag reel of Drifty's video's here, but realized it was probably too riskay, so I deleted it, oops, lol.
Another room (actually other half of previous room)
What should I focus on today?

Character Portraits?
OR
Mapping?
Alright, I think I've got tired of VXAce. I guess I will jump to MV.
Just had a stranger SPRINT away from me in the grocery store. Talk about overreaction...
...I don't think I'm that ugly! ^-^

Forum statistics

Threads
95,512
Messages
929,735
Members
125,776
Latest member
FrogScholar
Top