RPG maker are full of internal bugs. Some have a known solution and others not yet. That's why I decided to make some sort of a compilation of them and I tried also to fix some.
I will post some of them, you can do the same.
Here's a template
[size=18pt][b][u][Maker] Bug's name[/u][/b][/size]
[size=14pt][b]Description[/b][/size]
> Short description of the bug <
[size=14pt][b]Examples[/b][/size]
> Examples about the problem (optional) <
[size=14pt][b]Screenshots[/b][/size]
> Only if it's necessary to understand the bug <
[size=14pt][b]Solution[/b][/size]
> If there is not a solution specify it <
[XP] Interpreter Script Call BugDescriptionOn Script Call from events, when the final eval is 'false' the game crashes.
Examples$game_system.timer_working = false
There are some ways to avoid it but it's not a real solution for the bug
SolutionThere is an official bugfix for this internal bug;
Interpreter Script Call Fix
[XP] Float Speed BugDescriptionIf you change the speed of the player to a float, the map and the events do not scroll exactly overlapped.
ScreenshotsSolutionThere is not a known solution for this bug.
[XP] F12 Stack Level Too DeepDescriptionIf you press F12 in-game the game has to stop and go to the Title Screen. But sometimes the game will crash with a 'stack level too deep' exception.
SolutionIt's an alias problem. What you have to do is simple; look for all the 'alias' in your scripts, for example
and add 'unless $@' on the back.
alias nmode7_setup setup unless $@
[XP] The 'Remove and restore Sprite Battler' problemDescriptionOn battle, if you call a common event to remove an actor and later you call another common event (for example with an item) to get him again to the party (easy way to do an invocation system) its sprite reappears in the same place as before and it should not (I didn't found this bug and I don't understand exactly how it's supposed to work, sorry)
SolutionQuote from: OrochiiI found the problem. That is solved with one line of code in the right place...
Find this on Sprite_Battler:
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If battler is nil
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
And replace that with this:
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If battler is nil
if @battler == nil
@battler_name = nil
self.bitmap = nil
loop_animation(nil)
return
end
This solves the problem. What happens is that the game deletes the image but not the variable that tells which image is loaded. So when you restore the same hero the script does not reload the image because it thinks the image was already loaded. I added @battler_name = nil so the variable is cleared too.
The new bugfix of 'Screen animation to multiple sprites' by LittleDrago fixes this one too.
[XP] The 'Teleport and Collision' weird problemDescriptionYou are in a map (Map1) which has an event that teleports you wherever in the Map2. In the same coordinates than the event but in Map2 there's another event with collision condition which does whatever. That second event should not be activated, but it is.
SolutionPut this above main:
class Game_Event
alias transferring_fix_cet_auto check_event_trigger_auto unless $@
def check_event_trigger_auto
if @trigger == 2 and $game_temp.transition_processing
return
end
transferring_fix_cet_auto
end
end
[XP] Parallel process in the first mapDescriptionWhen you initialize a new game from the title things are loaded is that sequence:
1) Events with Parallel Process start working
2) Transition from Title Screen to the game (20 frames)
3) $game_map and all its things are loaded
4) Auto-start Events, map's music, etc. start working
The problem is, if you start a parallel process which uses something related to the map, $game_map was not loaded yet when it starts so the game crashes, and if you use an Auto-start to solve that, it starts when the transition was done so maybe it will look bad. Also if you use a script call with 'if $
scene.is_a?(Scene_Map)' or you use a 'Wait x frames', to try to solve the problem.
SolutionI did an script for an engine of my game and by chance this fixes the problem, but the fix by LittleDrago is much more concise.
Put the script above main:
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Constant
#--------------------------------------------------------------------------
Nothing = Struct.new(:update,:dispose)
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
$@ || alias_method(:main_parallel_process_fix, :main)
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
init_parallel_process_fix
main_parallel_process_fix
end
#--------------------------------------------------------------------------
# * init_parallel_process_fix
#--------------------------------------------------------------------------
def init_parallel_process_fix
Input.update
@spriteset = Nothing.new
update_systems
transfer_player if $game_temp.player_transferring
return $scene = Scene_Gameover.new if $game_temp.gameover
return $scene = Scene_Title.new if $game_temp.to_title
end
#--------------------------------------------------------------------------
# * update_systems
#--------------------------------------------------------------------------
def update_systems
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
end
end
[XP] Screen animation to multiple spritesDescriptionWhen a screen animation (position == 3) is shown to different sprites at the same time, it is displayed overlapping itself and it should be displayed just once.
SolutionEdit: New script by LiTTleDRAgo
Put the script above main:
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
$@ || alias_method(:update_fix_animation, :update)
$@ || alias_method(:animation_set_sprites_fix, :animation_set_sprites)
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update(*args)
if @battler.nil?
@battler_name = nil
elsif @battler_visible && @battler.animation_id != 0
@disable_animation = @battler.instance_variable_get(:@disable_animation)
end
update_fix_animation(*args)
end
#--------------------------------------------------------------------------
# * Animation Set Sprites
#--------------------------------------------------------------------------
def animation_set_sprites(sp, *args)
return sp[0..15].each {|s| s && s.visible = false } if @disable_animation
animation_set_sprites_fix(sp, *args)
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
$@ || alias_method(:update_phase4_step4_fix, :update_phase4_step4)
#--------------------------------------------------------------------------
# * Frame Update (main phase step 4 : animation for target)
#--------------------------------------------------------------------------
def update_phase4_step4(*args)
if @animation2_id != 0
@target_battlers.each_with_index do |s,i|
s.instance_variable_set(:@disable_animation,false)
if i > 0 && $data_animations[@animation2_id].position == 3
s.instance_variable_set(:@disable_animation,true)
end
end
end
update_phase4_step4_fix(*args)
end
end
[XP] Disabling skills State bugDescriptionThere's a type of states restriction which disables the usage of skills to the actor (usually used as the "silence" state). But it doesn't work in the menu because the variable restriction when disabling skills equals 1 and the Skills on menu is disabled when it equals >= 2 by default (so it's so easy, if you change that to >= 1 it will work well). But the problem is the next one: You can go to the Skills scene from an actor who has not the state and with Q / W change to another actor who has the state.
SolutionPut this LiTTleDRAgo's script above main:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
$@ || alias_method(:update_status_fix, :update_status)
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status(*args)
if Input.trigger?(Input::C)
case @command_window.index
when 1 # skill
restrict = $game_party.actors[@status_window.index].restriction >= 1
return $game_system.se_play($data_system.buzzer_se) if restrict
$game_system.se_play($data_system.decision_se)
return $scene = Scene_Skill.new(@status_window.index)
end
end
update_status_fix(*args)
end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs skill screen processing.
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
$@ || alias_method(:update_skill_fix, :update_skill)
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
def update_skill(*args)
return update_skill_lr(1) if Input.trigger?(Input::R)
return update_skill_lr(-1) if Input.trigger?(Input::L)
update_skill_fix(*args)
end
#--------------------------------------------------------------------------
# * update_skill_lr
#--------------------------------------------------------------------------
def update_skill_lr(type = 1)
return if $game_party.actors.size == 1
actor = @actor_index
loop do
@actor_index = (@actor_index + type) % $game_party.actors.size
break unless $game_party.actors[@actor_index].restriction >= 1
break if @actor_index == actor
end
return $game_system.se_play($data_system.buzzer_se) if @actor_index == actor
$game_system.se_play($data_system.cursor_se)
$scene = Scene_Skill.new(@actor_index)
end
end
[XP] Enemy Action Regarding SkillsDescriptionIf any enemy has the ability to use a skill, it will add it as a potential action it can make regardless if the enemy is even capable of using the skill in the first place (e.g. not enough SP, silenced, etc.).
ExamplesGive an enemy the ability to do a normal attack and use a skill that requires SP. Make it so that the enemy has enough SP to only use the skill once. Make sure both actions have a similar priority. Go into battle and notice that the enemy sometimes skips their turn.
SolutionIn Game_Enemy, find the method
make_action and replace EVERYTHING below it with this:
def make_action
# Clear current action
self.current_action.clear
# If unable to move
unless self.movable?
# End Method
return
end
# Extract current effective actions
available_actions = []
rating_max = 0
for action in self.actions
# Confirm can use skill
if action.kind == 1 && !skill_can_use?(action.skill_id)
next
end
# Confirm turn conditions
n = $game_temp.battle_turn
a = action.condition_turn_a
b = action.condition_turn_b
if (b == 0 and n != a) or
(b > 0 and (n < 1 or n < a or n % b != a % b))
next
end
# Confirm HP conditions
if self.hp * 100.0 / self.maxhp > action.condition_hp
next
end
# Confirm level conditions
if $game_party.max_level < action.condition_level
next
end
# Confirm switch conditions
switch_id = action.condition_switch_id
if switch_id > 0 and $game_switches[switch_id] == false
next
end
# Add this action to applicable conditions
available_actions.push(action)
if action.rating > rating_max
rating_max = action.rating
end
end
# Calculate total with max rating value at 3 (exclude 0 or less)
ratings_total = 0
for action in available_actions
if action.rating > rating_max - 3
ratings_total += action.rating - (rating_max - 3)
end
end
# If ratings total isn't 0
if ratings_total > 0
# Create random numbers
value = rand(ratings_total)
# Set things that correspond to created random numbers as current action
for action in available_actions
if action.rating > rating_max - 3
if value < action.rating - (rating_max - 3)
self.current_action.kind = action.kind
self.current_action.basic = action.basic
self.current_action.skill_id = action.skill_id
self.current_action.decide_random_target_for_enemy
return
else
value -= action.rating - (rating_max - 3)
end
end
end
end
end
end
[XP][VX][VXA] Testing for File Existence in Encrypted GamesDescriptionEncrypted games cannot use methods like [tt]FileTest.exist?[/tt] or [tt]
File.open[/tt].
ExamplesIf using RMXP, add
print FileTest.exist?("Data/Scripts.rxdata")
to the top of [tt]Main[/tt]. Encrypt your game. Then run the encrypted game. It should say
false.
SolutionLiTTleDRAgo provided a work-around here:
https://pastebin.com/krvZgfPj