[VXAce]Bug with Adjust Limits

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
193
Reaction score
3
First Language
French
Primarily Uses
Hello, I found a bug with the script "Adjust limits" from Yanfly.

I tested in a new project with this script only. When I save my game and reload after, there are random items (often armours) in my inventory that I had not before. Can you help me to fix it, please ?

I made a demo, just save and load to see the problem : http://www.mediafire.com/download/qd1ydbngz2d17q7/Bug.exe

The script is here : https://yanflychannel.wordpress.com/rmvxa/core-scripts/adjust-limits/

In the comments, there is someone who explains the same problem :

This script as posted, is broken. I’ve disabled everything but it and the core script, and every time I save a game, when I load it the character has a crap load of weapons which they didn’t have prior to save — and some of those weapons are completely blank.. no name, no stats, no nothing. I suppose they’re taken from blank spots in my weapon database which I’ve saved for expansion use later.

I’d love to be able to change some of the limits on items, but as it stands, this script simply doesn’t work for me at all. It corrupts any save file that it’s used on.

Actually, I take that back. It corrupts any LOADING file. When I get rid of this script, everything loads fine. The items which magically appear when this is in the script list disappear. They’re not in the save, they appear when this is an active script in the LOAD GAME.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Can you please upload the demo project in zipped form, so we can open it in RM?

I did a small test run with a new project, only adding the script without anything else. I could save and load fine without gaining random items.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Try:

Code:
class Scene_Load < Scene_File  def perform_level_check    $game_party.members.each { |member| member.check_levels }  end  end
 

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
193
Reaction score
3
First Language
French
Primarily Uses
You can open the project with RM, the project is just compiled.

I did a small test run with a new project, only adding the script without anything else. I could save and load fine without gaining random items.
Strange. Try to change the max values in database. I know that random items change when I change these values.
 

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
193
Reaction score
3
First Language
French
Primarily Uses
DoubleX, should I replace this :

class Scene_Load < Scene_File

#--------------------------------------------------------------------------
# alias method: on_load_success
#--------------------------------------------------------------------------
alias on_load_success_al on_load_success
def on_load_success
on_load_success_al
perform_level_check
end

#--------------------------------------------------------------------------
# new method: perform_level_check
#--------------------------------------------------------------------------
def perform_level_check
for i in 1..$data_actors.size
next if $game_actors.nil?
$game_actors.check_levels
end
end

end # Scene_Load
 

by this :

 

class Scene_Load < Scene_File

def perform_level_check
$game_party.members.each { |member| member.check_levels }
end

end
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
Treat mine as a separate snippet, or just replace this:

#--------------------------------------------------------------------------# new method: perform_level_check#-------------------------------------------------------------------------- def perform_level_check for i in 1..$data_actors.size next if $game_actors.nil? $game_actors.check_levels end end
With mine :)
 

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
193
Reaction score
3
First Language
French
Primarily Uses
Yes, I replace with yours. It works well. Thanks for you help. I warn you if I have other problems with this script.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
This might produce strange results with actors not currently in the party, though, as they won't get their check_levels method called when loading.

You could add this snippet instead:

class Game_Actors   def check_levels    @data.each{|actor| actor.check_levels if !actor.nil?}  end end
and replace the call with:

Code:
$game_actors.check_levels
 

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

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top