Different Difficulties problem

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
i have this script called Different Difficulties for Tons of Add-ons
Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Different Difficulties by Blizzard
# Version: 1.3b
# Date: 24.3.2007
# Date v1.1b: 27.3.2008
# Date v1.2b: 18.4.2008
# Date v1.3b: 22.4.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Instructions:
#
#   You can always check the current difficulty of the game by using
#   
#     $game_system.difficulty_name == 'NAME'
#   
#   in your conditional branch. The NAMEs are the same as you specify in the
#   configuration below.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if TONS_OF_ADDONS::DIFFICULTY

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Congfiguration
#
# Use the following template to create difficulties in your game
# ['NAME', EXP_RATE, GOLD_RATE, ACTOR_DAMAGE_RATE, ENEMY_DAMAGE_RATE]
# Note that all the "rates" are in %. Values over 100 will increase, values
# under 100 will decrease the given attribute. Of course you can add/remove
# any difficulties you want, be sure to separate them with commas.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

DIFFICULTIES = [['Peaceful', 250, 250, 200, 50],
                ['Easy', 150, 150, 160, 75],
                ['Normal', 100, 100, 100, 100],
                ['Hard', 80, 80, 80, 160],
                ['Hardcore', 50, 50, 50, 200]]

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Congfiguration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Game_System
#==============================================================================

class Game_System
 
  attr_reader :difficulty_name
  attr_reader :exp_rate
  attr_reader :gold_rate
  attr_reader :actor_rate
  attr_reader :enemy_rate
 
  def init_difficulty(index)
    @difficulty_name, @exp_rate, @gold_rate, @actor_rate, @enemy_rate =
        DIFFICULTIES[index]
  end
 
end

#==============================================================================
# Window_BattleResult
#==============================================================================

class Window_BattleResult
 
  attr_accessor :gold
  attr_accessor :exp
 
end

#==============================================================================
# Window_BattleStatus
#==============================================================================

class Window_BattleStatus
 
  attr_accessor :level_up_flags
 
end

#==============================================================================
# Game_Battler
#==============================================================================

class Game_Battler
 
  alias attack_effect_difficulty_later attack_effect
  def attack_effect(attacker)
    last_sr = self.sr if $crls && self.is_a?(Game_Actor)
    last_hp = self.hp
    result = attack_effect_difficulty_later(attacker)
    if result && self.damage.is_a?(Numeric)
      self.hp = last_hp
      self.hp = self.hp
      if attacker.is_a?(Game_Actor)
        self.sr = last_sr if $crls && self.is_a?(Game_Actor)
        self.damage = self.damage * $game_system.actor_rate / 100
      elsif attacker.is_a?(Game_Enemy)
        self.damage = self.damage * $game_system.enemy_rate / 100
      end
      self.hp -= self.damage
    end
    return result
  end
 
  alias skill_effect_difficulty_later skill_effect
  def skill_effect(user, skill)
    last_sr = self.sr if $crls && self.is_a?(Game_Actor)
    last_hp = self.hp
    result = skill_effect_difficulty_later(user, skill)
    if result && self.damage.is_a?(Numeric)
      self.hp = last_hp
      self.hp = self.hp
      if user.is_a?(Game_Actor)
        self.damage = self.damage * $game_system.actor_rate / 100
        self.sr = last_sr if $crls
      elsif user.is_a?(Game_Enemy)
        self.damage = self.damage * $game_system.enemy_rate / 100
      end
      self.hp -= self.damage
    end
    return result
  end
 
end
 
#==============================================================================
# Scene_Title
#==============================================================================

class Scene_Title
 
  alias main_difficulties_later main
  def main
    main_difficulties_later
    @difficulty_window.dispose if @difficulty_window != nil
  end
 
  alias command_new_game_difficulties_later command_new_game
  def command_new_game
    $game_system.se_play($data_system.decision_se)
    d = []
    DIFFICULTIES.each {|diff| d.push(diff[0])}
    @difficulty_window = Window_Command.new(@command_window.width, d)
    @difficulty_window.x = @command_window.x
    @difficulty_window.y = @command_window.y -
        (@difficulty_window.height - @command_window.height) / 2
    @difficulty_window.back_opacity = @command_window.back_opacity
    @command_window.active = @command_window.visible = false
  end
 
  alias upd_difficulties_later update
  def update
    if @difficulty_window == nil
      upd_difficulties_later
      return
    end
    @difficulty_window.update unless defined?(SDK)
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = @command_window.visible = true
      @difficulty_window.dispose
      @difficulty_window = nil
    elsif Input.trigger?(Input::C)
      command_new_game_difficulties_later
      $game_system.init_difficulty(@difficulty_window.index)
    end
  end
 
end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle
 
  alias start_phase5_difficulty_later start_phase5
  def start_phase5
    old_gold, old_exp, old_levels = $game_party.gold, [], []
    $game_party.actors.each {|actor|
        old_exp.push(actor.exp)
        old_levels.push(actor.level)}
    start_phase5_difficulty_later
    new_gold = $game_party.gold - old_gold
    $game_party.lose_gold(new_gold)
    @result_window.gold = new_gold * $game_system.gold_rate / 100
    $game_party.gain_gold(@result_window.gold)
    new_exp = 0
    $game_party.actors.each_index {|i|
        if $game_party.actors[i].exp - old_exp[i] > 0
          new_exp = $game_party.actors[i].exp - old_exp[i]
        end
        $game_party.actors[i].exp = old_exp[i]}
    @result_window.exp = new_exp * $game_system.exp_rate / 100
    @result_window.refresh
    $game_party.actors.each_index {|i|
        @status_window.level_up_flags[i] = false
        unless $game_party.actors[i].cant_get_exp?
          $game_party.actors[i].exp += @result_window.exp
          @status_window.level_up(i) if $game_party.actors[i].level > old_levels[i]
        end}
  end
 
end

end
but it errors at line 98
vvvvvvvv
Code:
self.damage = self.damage * $game_system.actor_rate / 100
do you have any ideas how to fix it?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,497
First Language
Indonesian
Primarily Uses
RMVXA
I don't do RMXP but if you could at least tell the error message (preferable with a screenshot), it probably easier to figure it out why.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
i think here is the difference
Peaceful [AKA n00b as default name]
1591245788804.png

and here is Normal
1591246113943.png

this is an example
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
@TheoAllen when i enter Battle Test mode
1591246220561.png

and try to attack
1591246287956.png

it errors like this
1591246334456.png

any idea on how to fix it?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,497
First Language
Indonesian
Primarily Uses
RMVXA
Oh, I see the problem now.
The difficulty setting is not properly initialized.
Everything is set when you start a new game from the title screen. So if you go straight to the battle test, the game doesn't know what kind of difficulty you have.
In my opinion, this isn't a good design for a published script.

Try to put this patch below the script. It will set the default the default setting for the difficulty.
Code:
class Game_System
  alias system_init initialize
  def initialize
    system_init
    init_difficulty(0) # <-- change the difficulty here
  end
end
Go change 0 to the index of the difficulty setting. For example, the default setting has these
Code:
DIFFICULTIES = [['Peaceful', 250, 250, 200, 50],
                ['Easy', 150, 150, 160, 75],
                ['Normal', 100, 100, 100, 100],
                ['Hard', 80, 80, 80, 160],
                ['Hardcore', 50, 50, 50, 200]]
If you put 0, it means it will use 'Peaceful' difficulty setting.
If you put 4, it will use 'Hardcore' difficulty setting.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
bump!
new problem!
i have the Easy LVL Up Notifier Script from Tons of Add-ons
Ruby:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Easy LvlUp Notifier by Blizzard
# Version: 2.2
# Type: Battle Report Display
# Date: 27.8.2006
# Date v1.2b: 3.11.2006
# Date v1.3b: 11.3.2007
# Date v1.4b: 22.8.2007
# Date v2.0: 25.9.2007
# Date v2.1: 4.12.2009
# Date v2.1b: 15.3.2010
# Date v2.11b: 19.3.2010
# Date v2.2: 23.3.2019
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#   This work is licensed under BSD License 2.0:
#
# #----------------------------------------------------------------------------
# #
# # Copyright (c) Boris "Blizzard" Mikić
# # All rights reserved.
# #
# # Redistribution and use in source and binary forms, with or without
# # modification, are permitted provided that the following conditions are met:
# #
# # 1.  Redistributions of source code must retain the above copyright notice,
# #     this list of conditions and the following disclaimer.
# #
# # 2.  Redistributions in binary form must reproduce the above copyright
# #     notice, this list of conditions and the following disclaimer in the
# #     documentation and/or other materials provided with the distribution.
# #
# # 3.  Neither the name of the copyright holder nor the names of its
# #     contributors may be used to endorse or promote products derived from
# #     this software without specific prior written permission.
# #
# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# # POSSIBILITY OF SUCH DAMAGE.
# #
# #----------------------------------------------------------------------------
#
#   You may use this script for both non-commercial and commercial products
#   without limitations as long as you fulfill the conditions presented by the
#   above license. The "complete" way to give credit is to include the license
#   somewhere in your product (e.g. in the credits screen), but a "simple" way
#   is also acceptable. The "simple" way to give credit is as follows:
#
#     Easy LvlUp Notifierlicensed under BSD License 2.0
#     Copyright (c) Boris "Blizzard" Mikić
#
#   Alternatively, if your font doesn't support diacritic characters, you may
#   use this variant:
#
#     Easy LvlUp Notifierlicensed under BSD License 2.0
#     Copyright (c) Boris "Blizzard" Mikic
#
#   In general other similar variants are allowed as long as it is clear who
#   the creator is (e.g. "Easy LvlUp Notifiercreated by Blizzard" is
#   acceptable). But if possible, prefer to use one of the two variants listed
#   above.
#
#   If you fail to give credit and/or claim that this work was created by you,
#   this may result in legal action and/or payment of damages even though this
#   work is free of charge to use normally.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
#   98% compatible with SDK v1.x. 80% compatible with SDK 2.x. WILL corrupt old
#   savegames. May cause slight problems with following systems and would need
#   therefore slight recalibration:
#   - exotic CBS-es
#   - exotic skill systems
#   - exotic stat systems (additional stats like Wisdom, Luck etc.)
#
#
# Features:
#
#   - shows increased stats and learned skills at level up
#   - animated
#   - shows EXP gain for each actor (!) only after gaining EXP after a battle
#   - more simple and less laggy than other Level Up Notifiers
#   - you can set up any sound to be played when a higher level is reached or a
#     new skill is learned (LVLUP_SE and LEARN_SE further below)
#
# new in v1.2b:
#   - better window movement
#   - higher compatibility
#   - fixed a few "eventual" bugs
#
# new in v1.3b:
#   - fully compatible with Tons of Add-ons
#
# new in v1.4b:
#   - improved coding
#   - rewritten conditions using classic syntax to avoid RGSS conditioning bug
#
# new in v2.0:
#   - completely overworked and improved
#   - now MUCH more simple than other Level Up Notifiers
#   - halved the number of lines of code
#   - much more compatible: can show increase of any stats after the battle in
#     combination with any script, just put this script below those attribute
#     modifying scripts
#
# new in v2.1:
#   - improved coding
#   - increased compatibility with CBS-es
#
# new in v2.1b:
#   - fixed "stack level too deep" problem
#
# new in v2.11b:
#   - fixed crash during escape
#
# new in v2.2:
#   - added new license
#   - added usage and crediting instructions
#
#
# Instructions:
#
# - Explanation:
#
#   This script will notify you when any character is leveled up after a
#   battle. It will show any stats that were increased and any skills that were
#   learned. The windows are animated, the code is less complex than any other
#   so far and it is most efficient as well as highly optimized and detailed
#   worked out.
#
# - Configuration:
#  
#   There are a few options you can set up below.
#  
#   LVLUP_SE            - sound effect played when a new level was reached
#   LEARN_SE            - sound effect played when a new skill was learned,
#                         keep in mind that the script takes into account that
#                         skills can only be learned after a level up
#   WINDOW_BACK_OPACITY - set this value to the window's back opacity (0-255)
#   NO_EXP_DISPLAY      - set this value to true if you want to disable the EXP
#                         gaining display in the level up windows
#   OLD_EXP_DISPLAY     - set this value to true if you want to display the EXP
#                         in the normal result window again
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#          RPG::AudioFile.new('FILENAME', VOLUME, PITCH)
LVLUP_SE = RPG::AudioFile.new('PKMN SS Level Up', 100, 100)
LEARN_SE = RPG::AudioFile.new('SkillLearnedP5', 100, 100)
WINDOW_BACK_OPACITY = 160
NO_EXP_DISPLAY = false
OLD_EXP_DISPLAY = false

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

$easy_lvlup_notifier = 2.2

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

  def all_exp
    return @exp
  end

  def all_exp=(exp)
    @exp = exp
  end

end

#==============================================================================
# Window_BattleResult
#==============================================================================

class Window_BattleResult < Window_Base

  alias easy_lvlup_notfier_refresh refresh
  def refresh
    if $tons_version != nil && $tons_version >= 4.02 &&
        $game_system.WINDOW_BATTLERESULT || OLD_EXP_DISPLAY
      easy_lvlup_notfier_refresh
    else
      self.contents.clear
      x = 4
      self.contents.font.color = system_color
      cx = contents.text_size('Gained').width
      self.contents.draw_text(x, 0, cx+4, 32, 'Gained')
      x += cx + 4
      self.contents.font.color = normal_color
      cx = contents.text_size(@gold.to_s).width
      self.contents.draw_text(x, 0, cx+4, 32, @gold.to_s)
      x += cx + 4
      self.contents.font.color = system_color
      self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
      (0...@treasures.size).each {|i| draw_item_name(@treasures[i], 4, (i+1)*32)}
    end
  end

end

#==============================================================================
# Window_LevelUp
#==============================================================================

class Window_LevelUp < Window_Base

  attr_reader :limit

  def initialize(a, d)
    if $tons_version != nil && $tons_version >= 4.98 &&
        $game_system.CENTER_BATTLER
      x = case $game_party.actors.size
      when 1 then 240
      when 2 then a.index * 320 + 80
      when 3 then a.index * 160 + 80
      when 4 then a.index * 160
      end
    else
      x = a.index * 160
    end
    text = []
    text.push(['Level:', d[0], a.level]) if d[0] != a.level
    text.push([$data_system.words.hp[0, 3], d[1], a.maxhp]) if d[1] != a.maxhp
    text.push([$data_system.words.sp[0, 3], d[2], a.maxsp]) if d[2] != a.maxsp
    text.push([$data_system.words.str[0, 3], d[3], a.str]) if d[3] != a.str
    text.push([$data_system.words.pdef[0, 3], d[7], a.pdef]) if d[7] != a.pdef
    text.push([$data_system.words.int[0, 7], d[6], a.int]) if d[6] != a.int
    text.push([$data_system.words.mdef[0, 7], d[8], a.mdef]) if d[8] != a.mdef
    text.push([$data_system.words.agi[0, 3], d[5], a.agi]) if d[5] != a.agi
    text.push([$data_system.words.dex[0, 4], d[4], a.dex]) if d[4] != a.dex
    h = text.size * 24 + (NO_EXP_DISPLAY ? 32 : 56)
    @limit, y = 320 - h, 480 - h + (h/64+1)*64
    super(x, y, 160, h)
    self.z, self.back_opacity = 100, WINDOW_BACK_OPACITY
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    if $fontface != nil
      self.contents.font.name = $fontface
    elsif $defaultfonttype != nil
      self.contents.font.name = $defaultfonttype
    end
    self.contents.font.size = 18
    unless NO_EXP_DISPLAY
      self.contents.font.name = "TF2 Build"
      self.contents.font.color = normal_color
      self.contents.draw_text(0, 0, 128, 24, "#{a.exp - d[9]} EXP", 1)
    end
    text.each_index {|i|
        index = NO_EXP_DISPLAY ? i : i + 1
        self.contents.font.name = "TF2 Secondary"
        self.contents.font.color = system_color
        self.contents.draw_text(0, index*24, 128, 24, text[i][0])
        self.contents.font.name = "Times New Roman"
        self.contents.draw_text(80, index*24, 32, 24, '»')
        self.contents.font.name = "TF2 Secondary"
        self.contents.font.color = normal_color
        self.contents.draw_text(0, index*24, 76, 24, text[i][1].to_s, 2)
        if text[i][1] > text[i][2]
          self.contents.font.color = Color.new(255, 64, 0)
        else
          self.contents.font.color = Color.new(255, 255, 0)
        end
        self.contents.draw_text(0, index*24, 128, 24, text[i][2].to_s, 2)}
  end

end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle

  alias main_lvlup_later main
  def main
    @lvlup_data = {}
    @moving_windows, @pending_windows = [], []
    (1...$data_actors.size).each {|i|
        actor = $game_actors[i]
        @lvlup_data[actor] = [actor.level, actor.maxhp, actor.maxsp, actor.str,
            actor.dex, actor.agi, actor.int, actor.pdef, actor.mdef, actor.exp, actor.skills.clone]}
    main_lvlup_later
    (@moving_windows + @pending_windows).each {|win| win.dispose if win != nil}
  end

  alias start_phase5_lvlup_later start_phase5
  def start_phase5
    start_phase5_lvlup_later
    @skill_texts = []
    $game_party.actors.each {|actor|
        actor.remove_states_battle
        if @lvlup_data[actor][0, 9] != [actor.level, actor.maxhp, actor.maxsp,
            actor.str, actor.dex, actor.agi, actor.int, actor.pdef, actor.mdef]
          @pending_windows.push(Window_LevelUp.new(actor, @lvlup_data[actor]))
          @skill_texts.push('')
          new_skills = actor.skills - @lvlup_data[actor][10]
          if new_skills.size > 0
            new_skills.each {|id|
                @skill_texts.push("#{actor.name} learned #{$data_skills[id].name}!")}
          end
        elsif @lvlup_data[actor][7] != actor.exp && !NO_EXP_DISPLAY
          @moving_windows.push(Window_LevelUp.new(actor, @lvlup_data[actor]))
        end}
  end

  alias update_phase5_lvlup_later update_phase5
  def update_phase5
    update_phase5_lvlup_later
    if @phase5_wait_count <= 0 && !Input.trigger?(Input::C)
      @moving_windows.each {|win|
          win.y -= [((win.y - win.limit) / 2.0).ceil, 64].min if win.y > win.limit}
    end
  end

  alias battle_end_lvlup_later battle_end
  def battle_end(result)
    if @result_window == nil
      battle_end_lvlup_later(result)
      return
    end
    @result_window.visible = false
    if @skill_texts.size > 0
      text = @skill_texts.shift
      if text == ''
        $game_system.se_play(LVLUP_SE)
        @moving_windows.push(@pending_windows.shift)
        @help_window.visible = false
      else
        $game_system.se_play(LEARN_SE)
        @help_window.set_text(text, 1)
      end
    else
      battle_end_lvlup_later(result)
    end
  end

end
and it will break when i put this above the Different Difficulties Script
1600226095381.png
1600226212954.png
see!
it has to do something with these two scripts. (minus the fixing script for different difficulties)
if anyone knows how to fix it, be my guest.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
253
Reaction score
91
First Language
English
Primarily Uses
RMXP
Error is pointing at @skill_texts not being initialized. This happens in the method start_phase5. So chances are you have a script lower in your list that does not alias it; rather it rewrites it.

Also, why are you pulling scripts out of Tons of Add-ons and making them their own entry in the script list?
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
@KK20
well... the same error keeps happening no matter i move it
but there is something weird about this code
1600248325761.png
but i don't the what other script is making an error like this,
why don't you test it out and see for your self.

Also, why are you pulling scripts out of Tons of Add-ons and making them their own entry in the script list?
i just picked out some scripts that i thought its suitable to my game.


P.S.
and also, i look at the Chaos Forum [XP] Script Database
and i see the Easy LvlUp Notifier has its own post made by Blizzard.
so... whoops :aswt:
i thought it was in Tons of Add-ons before i check...



EDIT:
i think i fix the problem by moving the Easy LVL Up Notifier to here underneath that other script
1600250349651.png
and its all fine.
1600250481160.png
ha... ha... im such a dummy...

P.S.S.
here is what i really ment about a problem.
heres my config on Different Difficulties
Ruby:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Different Difficulties by Blizzard
# Version: 1.3b
# Date: 24.3.2007
# Date v1.1b: 27.3.2008
# Date v1.2b: 18.4.2008
# Date v1.3b: 22.4.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Instructions:
#
#   You can always check the current difficulty of the game by using
#  
#     $game_system.difficulty_name == 'NAME'
#  
#   in your conditional branch. The NAMEs are the same as you specify in the
#   configuration below.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if TONS_OF_ADDONS::DIFFICULTY

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Congfiguration
#
# Use the following template to create difficulties in your game
# ['NAME', EXP_RATE, GOLD_RATE, ACTOR_DAMAGE_RATE, ENEMY_DAMAGE_RATE]
# Note that all the "rates" are in %. Values over 100 will increase, values
# under 100 will decrease the given attribute. Of course you can add/remove
# any difficulties you want, be sure to separate them with commas.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

DIFFICULTIES = [['Peaceful', 250, 250, 160, 50],
                ['Easy', 150, 150, 130, 75],
                ['Normal', 100, 100, 100, 100],
                ['Hard', 80, 80, 80, 140],
                ['Hardcore', 50, 50, 65, 160]]

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Congfiguration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
and here is the fix on battle tests
1600251031726.png
its set to [Normal]
and i moved different difficulties and the patch to here
1600251478351.png

look on [
Normal]
1600251578117.png <Before
1600251619220.png
1600251664085.png <After
looks ok, right?

well, lets look onto [
Hardcore]
1600251747263.png
in [
Hardcore] you take even more damage from enemies,
deal even less damage TO enemies,
and you get HALF of the EXP and Gold that you normally get.

1600251781896.png <Before


1600251857523.png
the gold was halved but not the EXP???

and look at this
1600251940299.png <After
it looks like the EXP was NOT halved in-battle,
but recieved half of it now AFTER battle???
 
Last edited:

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
253
Reaction score
91
First Language
English
Primarily Uses
RMXP
Different Difficulties should be above Easy LVL UP. You should refer to this:

Assuming you kept Different Difficulties inside Tons of Add-ons, you'd see Easy LVL UP is lower in the list.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
@KK20
wait, should it be placed like this?
---------------------------------
Easy LVL Up Notifier
Different Difficulties
D.D. Battle Test Fix
----------------------------------
or like this?
---------------------------------
Different Difficulties
D.D. Battle Test Fix
Easy LVL Up Notifier
----------------------------------

(and also, how do i give the actors PDEF and MDEF points?
you know, where i give them an item to increase their STR or INT.
how do i do that with PDEF and MDEF?)
here is the edited Game_Actor script edited by Photon Weapon
Ruby:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

#==============================================================================
# GAME_ACTOR EDITTED BY PHOTON WEAPON
#
# Attack, Physical Defense, and Magic Defense level up with other stats.
#
# This edit of the Game_Actor class does just that. Normally characters
# have 0 Atk, P-Def, and M-Def unless they have something equipped. But this
# script makes it so that characters will always have some points left in those
# stats even with no equipment. Useful for monk-type characters, or battle
# systems that don't involve weapons and/or armor.
#
# First we create a variable called char_[statname] (or whatever
# you want to call it), and have it start with 0. Then we'll have the
# game detect the 'actor_id' of the character. For example, Aluxes/Arshes
#is normally Actor001 in the Database; so his @actor_id is 1, and the script
# will then give him this amount of the statistic.
#
# After determine what their ID is, the char_[statname] variable becomes an
# equation involving the character's level (@level * so-and-so), ending with
# '+ [number]'. The reason we need '+ [number]' there is so that they'll have some amount of this stat
# to fall on if they have no weapon equipped. Otherwise, the statistic
# will be very, very low until the character reaches higher levels.
#
# Example, without '+ [number]'; Level = 1.
# @level * 5 = 5.
# Example, with '+ [number]'; Level = 1.
# @level * 5 + 50 = 55. See?
#
# Eh, you'll see how it works. Just scroll down over to 'def base_atk',
# 'def base_pdef', and 'def base_mdef'.
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :name                     # name
  attr_reader   :character_name           # character file name
  attr_reader   :character_hue            # character hue
  attr_reader   :class_id                 # class ID
  attr_reader   :weapon_id                # weapon ID
  attr_reader   :armor1_id                # shield ID
  attr_reader   :armor2_id                # helmet ID
  attr_reader   :armor3_id                # body armor ID
  attr_reader   :armor4_id                # accessory ID
  attr_reader   :level                    # level
  attr_reader   :exp                      # EXP
  attr_reader   :skills                   # skills
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def initialize(actor_id)
    super()
    setup(actor_id)
  end
  #--------------------------------------------------------------------------
  # * Setup
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def setup(actor_id)
    actor = $data_actors[actor_id]
    @actor_id = actor_id
    @name = actor.name
    @character_name = actor.character_name
    @character_hue = actor.character_hue
    @battler_name = actor.battler_name
    @battler_hue = actor.battler_hue
    @class_id = actor.class_id
    @weapon_id = actor.weapon_id
    @armor1_id = actor.armor1_id
    @armor2_id = actor.armor2_id
    @armor3_id = actor.armor3_id
    @armor4_id = actor.armor4_id
    @level = actor.initial_level
    @exp_list = Array.new(101)
    make_exp_list
    @exp = @exp_list[@level]
    @skills = []
    @hp = maxhp
    @sp = maxsp
    @states = []
    @states_turn = {}
    @maxhp_plus = 0
    @maxsp_plus = 0
    @str_plus = 0
    @dex_plus = 0
    @agi_plus = 0
    @int_plus = 0
    # Learn skill
    for i in 1..@level
      for j in $data_classes[@class_id].learnings
        if j.level == i
          learn_skill(j.skill_id)
        end
      end
    end
    # Update auto state
    update_auto_state(nil, $data_armors[@armor1_id])
    update_auto_state(nil, $data_armors[@armor2_id])
    update_auto_state(nil, $data_armors[@armor3_id])
    update_auto_state(nil, $data_armors[@armor4_id])
  end
  #--------------------------------------------------------------------------
  # * Get Actor ID
  #--------------------------------------------------------------------------
  def id
    return @actor_id
  end
  #--------------------------------------------------------------------------
  # * Get Index
  #--------------------------------------------------------------------------
  def index
    return $game_party.actors.index(self)
  end
  #--------------------------------------------------------------------------
  # * Calculate EXP
  #--------------------------------------------------------------------------
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 100.0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list[i] = @exp_list[i-1] + Integer(n)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get Element Revision Value
  #     element_id : element ID
  #--------------------------------------------------------------------------
  def element_rate(element_id)
    # Get values corresponding to element effectiveness
    table = [0,200,150,100,50,0,-100]
    result = table[$data_classes[@class_id].element_ranks[element_id]]
    # If this element is protected by armor, then it's reduced by half
    for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
      armor = $data_armors[i]
      if armor != nil and armor.guard_element_set.include?(element_id)
        result /= 2
      end
    end
    # If this element is protected by states, then it's reduced by half
    for i in @states
      if $data_states[i].guard_element_set.include?(element_id)
        result /= 2
      end
    end
    # End Method
    return result
  end
  #--------------------------------------------------------------------------
  # * Get State Effectiveness
  #--------------------------------------------------------------------------
  def state_ranks
    return $data_classes[@class_id].state_ranks
  end
  #--------------------------------------------------------------------------
  # * Determine State Guard
  #     state_id : state ID
  #--------------------------------------------------------------------------
  def state_guard?(state_id)
    for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]
      armor = $data_armors[i]
      if armor != nil
        if armor.guard_state_set.include?(state_id)
          return true
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack Element
  #--------------------------------------------------------------------------
  def element_set
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.element_set : []
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack State Change (+)
  #--------------------------------------------------------------------------
  def plus_state_set
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.plus_state_set : []
  end
  #--------------------------------------------------------------------------
  # * Get Normal Attack State Change (-)
  #--------------------------------------------------------------------------
  def minus_state_set
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.minus_state_set : []
  end
  #--------------------------------------------------------------------------
  # * Get Maximum HP
  #--------------------------------------------------------------------------
  def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, 9999].min
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum HP
  #--------------------------------------------------------------------------
  def base_maxhp
    return $data_actors[@actor_id].parameters[0, @level]
  end
  #--------------------------------------------------------------------------
  # * Get Maximum SP
  #--------------------------------------------------------------------------
  def maxsp
    n = [[base_maxsp + @maxsp_plus, 0].max, 999].min
    for i in @states
      n *= $data_states[i].maxsp_rate / 100.0
    end
    n = [[Integer(n), 0].max, 999].min
    return n
  end
  #--------------------------------------------------------------------------
  # * Get Basic Maximum SP
  #--------------------------------------------------------------------------
  def base_maxsp
    return $data_actors[@actor_id].parameters[1, @level]
  end
  #--------------------------------------------------------------------------
  # * Get Basic Strength
  #--------------------------------------------------------------------------
  def base_str
    n = $data_actors[@actor_id].parameters[2, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.str_plus : 0
    n += armor1 != nil ? armor1.str_plus : 0
    n += armor2 != nil ? armor2.str_plus : 0
    n += armor3 != nil ? armor3.str_plus : 0
    n += armor4 != nil ? armor4.str_plus : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Dexterity
  #--------------------------------------------------------------------------
  def base_dex
    n = $data_actors[@actor_id].parameters[3, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.dex_plus : 0
    n += armor1 != nil ? armor1.dex_plus : 0
    n += armor2 != nil ? armor2.dex_plus : 0
    n += armor3 != nil ? armor3.dex_plus : 0
    n += armor4 != nil ? armor4.dex_plus : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Agility
  #--------------------------------------------------------------------------
  def base_agi
    n = $data_actors[@actor_id].parameters[4, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.agi_plus : 0
    n += armor1 != nil ? armor1.agi_plus : 0
    n += armor2 != nil ? armor2.agi_plus : 0
    n += armor3 != nil ? armor3.agi_plus : 0
    n += armor4 != nil ? armor4.agi_plus : 0
    return [[n, 1].max, 999].min
  end
  #--------------------------------------------------------------------------
  # * Get Basic Intelligence
  #--------------------------------------------------------------------------
  def base_int
    n = $data_actors[@actor_id].parameters[5, @level]
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    n += weapon != nil ? weapon.int_plus : 0
    n += armor1 != nil ? armor1.int_plus : 0
    n += armor2 != nil ? armor2.int_plus : 0
    n += armor3 != nil ? armor3.int_plus : 0
    n += armor4 != nil ? armor4.int_plus : 0
    return [[n, 1].max, 999].min
  end
   #--------------------------------------------------------------------------
  # * Get Basic Attack Power
  #
  # PHOTONWEAPON EDIT - Give characters an actual 'base' attack power.
  #
  # Parenthesis is around the original code for returning attack power
  # so things will look right. Without the parenthesis, either the game will
  # crash or you'll receive the wrong statistic when you equip or unequip.
  #--------------------------------------------------------------------------
  def base_atk
    weapon = $data_weapons[@weapon_id]
    char_atk = 0
    if @actor_id == 1 # Determines ID# of hero in Database; Actor001, or Aluxes/Arshes.
      char_atk = (@level * 5) + 40 # Actor001's Atk. is 40 plus its level x 5.
    elsif @actor_id == 2 # Actor002, or Basil.
      char_atk = (@level * 5) + 35
    elsif @actor_id == 3 # Actor003, or Cyrus.
      char_atk = (@level * 6) + 40
    elsif @actor_id == 4 # Actor004, or Dorothy.
      char_atk = (@level * 5 / 2) + 35
    elsif @actor_id == 5 # Actor005, or Estelle.
      char_atk = (@level * 5 / 2) + 35
    elsif @actor_id == 6 # Actor006, or Felix.
      char_atk = (@level * 5 / 2) + 40
    elsif @actor_id == 7 # Actor007, or Gloria.
      char_atk = (@level * 4) + 30
    elsif @actor_id == 8 # Actor008, or Hilda.
      char_atk = (@level * 4) + 25
    elsif @actor_id == 9 # Actor009, or Litten.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 10 # Actor010, or Snowy.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 11 # Actor011, or Togedemaru.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 12 # Actor012, or Rowlet.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 13 # Actor013, or Popplio.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 14 # Actor014, or Rockruff.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 15 # Actor015, or Mimikyu.
      char_atk = (@level * 4) + 34
    elsif @actor_id == 16 # Actor016, or Zorua.
      char_atk = (@level * 4) + 34
    end # ends 'if @actor_id'
    return (weapon != nil ? weapon.atk : 0) + char_atk # EDITTED, inserted '+ char_atk'                               
  end
  #--------------------------------------------------------------------------
  # * Get Basic Physical Defense
  #
  # PHOTONWEAPON EDIT - Give characters an actual 'base' phys. defense.
  #--------------------------------------------------------------------------
  def base_pdef
    char_pdef = 0 # ADDED
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    pdef1 = weapon != nil ? weapon.pdef : 0
    pdef2 = armor1 != nil ? armor1.pdef : 0
    pdef3 = armor2 != nil ? armor2.pdef : 0
    pdef4 = armor3 != nil ? armor3.pdef : 0
    pdef5 = armor4 != nil ? armor4.pdef : 0
    if @actor_id == 1 # Determines ID# of hero in Database; Actor001, or Aluxes.
      char_pdef = (@level * 5) + 30 # Actor001's Def. is 35 plus its level x 5.
    elsif @actor_id == 2 # Actor002, or Basil.
      char_pdef = (@level * 5) + 35
    elsif @actor_id == 3 # Actor003, or Cyrus.
      char_pdef = (@level * 5) + 40
    elsif @actor_id == 4 # Actor004, or Dorothy.
      char_pdef = (@level * 5 / 2) + 35
    elsif @actor_id == 5 # Actor005, or Estelle.
      char_pdef = (@level * 5 / 2) + 30
    elsif @actor_id == 6 # Actor006, or Felix.
      char_pdef = (@level * 5) + 30
    elsif @actor_id == 7 # Actor007, or Gloria.
      char_pdef = (@level * 4) + 25
    elsif @actor_id == 8 # Actor008, or Hilda.
      char_pdef = (@level * 5 / 2) + 25
    elsif @actor_id == 9 # Actor009, or Litten.
      char_pdef = (@level * 5) + 25
    elsif @actor_id == 10 # Actor010, or Snowy.
      char_pdef = (@level * 4) + 24
    elsif @actor_id == 11 # Actor011, or Togedemaru.
      char_pdef = (@level * 6) + 56
    elsif @actor_id == 12 # Actor012, or Rowlet.
      char_pdef = (@level * 4) + 14
    elsif @actor_id == 13 # Actor013, or Popplio.
      char_pdef = (@level * 6 / 1.6) + 29
    elsif @actor_id == 14 # Actor014, or Rockruff.
      char_pdef = (@level * 5 / 1.1) + 31
    elsif @actor_id == 15 # Actor015, or Mimikyu.
      char_pdef = (@level * 4) + 34
    elsif @actor_id == 16 # Actor016, or Zorua.
      char_pdef = (@level * 5) + 25
    end #ends 'if @actor_id'
    return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + char_pdef # EDIT: '+ char_pdef'
  end
  #--------------------------------------------------------------------------
  # * Get Basic Magic Defense
  #
  # PHOTONWEAPON EDIT - Give characters an actual 'base' mag. defense.
  #--------------------------------------------------------------------------
  def base_mdef
    char_mdef = 0 # ADDED
    weapon = $data_weapons[@weapon_id]
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    mdef1 = weapon != nil ? weapon.mdef : 0
    mdef2 = armor1 != nil ? armor1.mdef : 0
    mdef3 = armor2 != nil ? armor2.mdef : 0
    mdef4 = armor3 != nil ? armor3.mdef : 0
    mdef5 = armor4 != nil ? armor4.mdef : 0
    if @actor_id == 1 # Determines ID# of hero in Database; Actor001, or Aluxes.
      char_mdef = (@level * 5) + 30 # Actor001's MDef. is 35 plus its level x 5.
    elsif @actor_id == 2 # Actor002, or Basil.
      char_mdef = (@level * 5) + 30
    elsif @actor_id == 3 # Actor003, or Cyrus.
      char_mdef = (@level * 5) + 25
    elsif @actor_id == 4 # Actor004, or Dorothy.
      char_mdef = (@level * 5 / 2) + 35
    elsif @actor_id == 5 # Actor005, or Estelle.
      char_mdef = (@level * 5) + 40
    elsif @actor_id == 6 # Actor006, or Felix.
      char_mdef = (@level * 5 / 2) + 30
    elsif @actor_id == 7 # Actor007, or Gloria.
      char_mdef = (@level * 6) + 40
    elsif @actor_id == 8 # Actor008, or Hilda.
      char_mdef = (@level * 6) + 45
    elsif @actor_id == 9 # Actor009, or Litten.
      char_mdef = (@level * 5) + 25
    elsif @actor_id == 10 # Actor010, or Snowy.
      char_mdef = (@level * 5) + 45
    elsif @actor_id == 11 # Actor011, or Togedemaru.
      char_mdef = (@level * 6) + 36
    elsif @actor_id == 12 # Actor012, or Rowlet.
      char_mdef = (@level * 4) + 14
    elsif @actor_id == 13 # Actor013, or Popplio.
      char_mdef = (@level * 5 / 1.3) + 50
    elsif @actor_id == 14 # Actor014, or Rockruff.
      char_mdef = (@level * 5 / 1.1) + 31
    elsif @actor_id == 15 # Actor015, or Mimikyu.
      char_mdef = (@level * 6 / 1.12) + 50
    elsif @actor_id == 16 # Actor016, or Zorua.
      char_mdef = (@level * 5) + 25
    end #ends 'if @actor_id'
    return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 + char_mdef # EDIT: '+ char_mdef'
  end
  #--------------------------------------------------------------------------
  # * Get Basic Evasion Correction
  #--------------------------------------------------------------------------
  def base_eva
    armor1 = $data_armors[@armor1_id]
    armor2 = $data_armors[@armor2_id]
    armor3 = $data_armors[@armor3_id]
    armor4 = $data_armors[@armor4_id]
    eva1 = armor1 != nil ? armor1.eva : 0
    eva2 = armor2 != nil ? armor2.eva : 0
    eva3 = armor3 != nil ? armor3.eva : 0
    eva4 = armor4 != nil ? armor4.eva : 0
    return eva1 + eva2 + eva3 + eva4
  end
  #--------------------------------------------------------------------------
  # * Get Offensive Animation ID for Normal Attacks
  #--------------------------------------------------------------------------
  def animation1_id
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.animation1_id : 0
  end
  #--------------------------------------------------------------------------
  # * Get Target Animation ID for Normal Attacks
  #--------------------------------------------------------------------------
  def animation2_id
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.animation2_id : 0
  end
  #--------------------------------------------------------------------------
  # * Get Class Name
  #--------------------------------------------------------------------------
  def class_name
    return $data_classes[@class_id].name
  end
  #--------------------------------------------------------------------------
  # * Get EXP String
  #--------------------------------------------------------------------------
  def exp_s
    return @exp_list[@level+1] > 0 ? @exp.to_s : "-------"
  end
  #--------------------------------------------------------------------------
  # * Get Next Level EXP String
  #--------------------------------------------------------------------------
  def next_exp_s
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "-------"
  end
  #--------------------------------------------------------------------------
  # * Get Until Next Level EXP String
  #--------------------------------------------------------------------------
  def next_rest_exp_s
    return @exp_list[@level+1] > 0 ?
      (@exp_list[@level+1] - @exp).to_s : "-------"
  end
  #--------------------------------------------------------------------------
  # * Update Auto State
  #     old_armor : unequipped armor
  #     new_armor : equipped armor
  #--------------------------------------------------------------------------
  def update_auto_state(old_armor, new_armor)
    # Forcefully remove unequipped armor's auto state
    if old_armor != nil and old_armor.auto_state_id != 0
      remove_state(old_armor.auto_state_id, true)
    end
    # Forcefully add unequipped armor's auto state
    if new_armor != nil and new_armor.auto_state_id != 0
      add_state(new_armor.auto_state_id, true)
    end
  end
  #--------------------------------------------------------------------------
  # * Determine Fixed Equipment
  #     equip_type : type of equipment
  #--------------------------------------------------------------------------
  def equip_fix?(equip_type)
    case equip_type
    when 0  # Weapon
      return $data_actors[@actor_id].weapon_fix
    when 1  # Shield
      return $data_actors[@actor_id].armor1_fix
    when 2  # Head
      return $data_actors[@actor_id].armor2_fix
    when 3  # Body
      return $data_actors[@actor_id].armor3_fix
    when 4  # Accessory
      return $data_actors[@actor_id].armor4_fix
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Change Equipment
  #     equip_type : type of equipment
  #     id    : weapon or armor ID (If 0, remove equipment)
  #--------------------------------------------------------------------------
  def equip(equip_type, id)
    case equip_type
    when 0  # Weapon
      if id == 0 or $game_party.weapon_number(id) > 0
        $game_party.gain_weapon(@weapon_id, 1)
        @weapon_id = id
        $game_party.lose_weapon(id, 1)
      end
    when 1  # Shield
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor1_id], $data_armors[id])
        $game_party.gain_armor(@armor1_id, 1)
        @armor1_id = id
        $game_party.lose_armor(id, 1)
      end
    when 2  # Head
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor2_id], $data_armors[id])
        $game_party.gain_armor(@armor2_id, 1)
        @armor2_id = id
        $game_party.lose_armor(id, 1)
      end
    when 3  # Body
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor3_id], $data_armors[id])
        $game_party.gain_armor(@armor3_id, 1)
        @armor3_id = id
        $game_party.lose_armor(id, 1)
      end
    when 4  # Accessory
      if id == 0 or $game_party.armor_number(id) > 0
        update_auto_state($data_armors[@armor4_id], $data_armors[id])
        $game_party.gain_armor(@armor4_id, 1)
        @armor4_id = id
        $game_party.lose_armor(id, 1)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Determine if Equippable
  #     item : item
  #--------------------------------------------------------------------------
  def equippable?(item)
    # If weapon
    if item.is_a?(RPG::Weapon)
      # If included among equippable weapons in current class
      if $data_classes[@class_id].weapon_set.include?(item.id)
        return true
      end
    end
    # If armor
    if item.is_a?(RPG::Armor)
      # If included among equippable armor in current class
      if $data_classes[@class_id].armor_set.include?(item.id)
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Change EXP
  #     exp : new EXP
  #--------------------------------------------------------------------------
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # Level down
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # Correction if exceeding current max HP and max SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  #--------------------------------------------------------------------------
  # * Change Level
  #     level : new level
  #--------------------------------------------------------------------------
  def level=(level)
    # Check up and down limits
    level = [[level, $data_actors[@actor_id].final_level].min, 1].max
    # Change EXP
    self.exp = @exp_list[level]
  end
  #--------------------------------------------------------------------------
  # * Learn Skill
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  def learn_skill(skill_id)
    if skill_id > 0 and not skill_learn?(skill_id)
      @skills.push(skill_id)
      @skills.sort!
    end
  end
  #--------------------------------------------------------------------------
  # * Forget Skill
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  def forget_skill(skill_id)
    @skills.delete(skill_id)
  end
  #--------------------------------------------------------------------------
  # * Determine if Finished Learning Skill
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  def skill_learn?(skill_id)
    return @skills.include?(skill_id)
  end
  #--------------------------------------------------------------------------
  # * Determine if Skill can be Used
  #     skill_id : skill ID
  #--------------------------------------------------------------------------
  def skill_can_use?(skill_id)
    if not skill_learn?(skill_id)
      return false
    end
    return super
  end
  #--------------------------------------------------------------------------
  # * Change Name
  #     name : new name
  #--------------------------------------------------------------------------
  def name=(name)
    @name = name
  end
  #--------------------------------------------------------------------------
  # * Change Class ID
  #     class_id : new class ID
  #--------------------------------------------------------------------------
  def class_id=(class_id)
    if $data_classes[class_id] != nil
      @class_id = class_id
      # Remove items that are no longer equippable
      unless equippable?($data_weapons[@weapon_id])
        equip(0, 0)
      end
      unless equippable?($data_armors[@armor1_id])
        equip(1, 0)
      end
      unless equippable?($data_armors[@armor2_id])
        equip(2, 0)
      end
      unless equippable?($data_armors[@armor3_id])
        equip(3, 0)
      end
      unless equippable?($data_armors[@armor4_id])
        equip(4, 0)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Change Graphics
  #     character_name : new character file name
  #     character_hue  : new character hue
  #     battler_name   : new battler file name
  #     battler_hue    : new battler hue
  #--------------------------------------------------------------------------
  def set_graphic(character_name, character_hue, battler_name, battler_hue)
    @character_name = character_name
    @character_hue = character_hue
    @battler_name = battler_name
    @battler_hue = battler_hue
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen X-Coordinate
  #--------------------------------------------------------------------------
  def screen_x
    # Return after calculating x-coordinate by order of members in party
    if self.index != nil
      return self.index * 160 + 80
    else
      return 0
    end
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen Y-Coordinate
  #--------------------------------------------------------------------------
  def screen_y
    return 464
  end
  #--------------------------------------------------------------------------
  # * Get Battle Screen Z-Coordinate
  #--------------------------------------------------------------------------
  def screen_z
    # Return after calculating z-coordinate by order of members in party
    if self.index != nil
      return 4 - self.index
    else
      return 0
    end
  end
end
i gave my actors their base ATK, PDEF, and MDEF
how do i increase their PDEF and MDEF from an item?
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
70
First Language
English
Primarily Uses
RMXP
You'd need a different script or an addon to make that happen for it doesn't offer you a direct way to alter PDEF or MDEF via consumable items like potions or elixirs. Plus that script is weird, as in made by a newbie that doesn't know how to setup a module in Ruby. :D
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
163
Reaction score
6
First Language
English
Primarily Uses
RMXP
@kyonides
You'd need a different script or an addon to make that happen for it doesn't offer you a direct way to alter PDEF or MDEF via consumable items like potions or elixirs.
i edited a bit in Game_Battler 3
Ruby:
        # Branch by parameter
        case item.parameter_type
        when 1  # Max HP
          @maxhp_plus += item.parameter_points
        when 2  # Max SP
          @maxsp_plus += item.parameter_points
        when 3  # Strength
          @str_plus += item.parameter_points
        when 4  # Dexterity
          @dex_plus += item.parameter_points
        when 5  # Agility
          @agi_plus += item.parameter_points
        when 6  # Intelligence
          @int_plus += item.parameter_points
        when 7  # Physical Defense
          @pdef_plus += item.parameter_points
        when 8  # Magical Defense
          @mdef_plus += item.parameter_points
        end
there has to be some sort of script call that will let you do this.
1600309475708.png
and its has something to do with the Common Events,
and NOT from the Param Inc itself.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Ami
--- Currency ---

Hero: This city cannot accept Gold to buy the items.
Merchant: You can exchange Gold into TC,depending the rate of TC this time.
Hero: Really? Then,i want to exchange 999999999G.
Merchant: Let's see……Wait a second,are you Cheating again?
Hero: Hell No!!! I earn it with myself!!!
There's always a time when you're super excited to create something but you already have no energy left. :I
I think of all the effects in my game, the light passing through fog has got to be my favorite....

...Also I spent all day trying to figure out how I had suddenly messed it up and made it start dropping frames like crazy. So I had all day to look at it... mocking me... with it's previous 60fps reduced to 30fps... At least it's fixed now.
Dalph wrote on slimmmeiske2's profile.
Slimmm, we should team one day and make "Reid in Wonderland" or "Aluxes in boots".
Ami
--- F.Mage Cooking ---

F.Mage: Hey,guys. i made dinner for you!
M.Fighter & Hero: (Shock) Dinner???
(F.Mage Put The Failed And Burnt Dishes Surrounded With Creepy Aura)
Hero: What the...???
F.Mage: It's Curry Rice,Fried Egg And Cakes. I hope you guys like my Dishes.
M.Fighter: Are you kidding me?

Forum statistics

Threads
103,479
Messages
999,634
Members
135,024
Latest member
noerdlicherem
Top