Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
That looks fine to me as a script command.  There are a couple of questions that occur to me, though.

How is the player to make an informed choice about which difficulty level to select?  Have you already given that information to the player so that they know what they are letting themselves in for?

Have you amended the parameters in this script?  Usually difficulty levels just increase the enemies HP and ATK.  This script is different, in that it adjusts every single parameter.  This makes the enemy much, much harder (or easier).  The default settings from easy to hardest are:  50%  100%  150%   200%.  An enemy at 200% of all the stats is virtually impossible to beat unless you make the stats so low that there is zero challenge at Normal.  It makes balancing across all difficulty modes virtually impossible.  The percentages I use are   75%   100%   125%   150%
 

DancinZombiee

Villager
Member
Joined
Sep 8, 2014
Messages
29
Reaction score
0
First Language
English
Primarily Uses
That looks fine to me as a script command.  There are a couple of questions that occur to me, though.

How is the player to make an informed choice about which difficulty level to select?  Have you already given that information to the player so that they know what they are letting themselves in for?

Have you amended the parameters in this script?  Usually difficulty levels just increase the enemies HP and ATK.  This script is different, in that it adjusts every single parameter.  This makes the enemy much, much harder (or easier).  The default settings from easy to hardest are:  50%  100%  150%   200%.  An enemy at 200% of all the stats is virtually impossible to beat unless you make the stats so low that there is zero challenge at Normal.  It makes balancing across all difficulty modes virtually impossible.  The percentages I use are   75%   100%   125%   150%
i got it to work! but i'll let you know if i need help again
 
Last edited by a moderator:
Joined
Jan 23, 2014
Messages
171
Reaction score
24
First Language
English
Primarily Uses
RMMZ
Does anyone know how to make this compatible with Yanfly's Enemy Levels. 

This script overwrites the gain in exp/gold from Enemy Levels. How would I make them support each other.

-OR-

Have the base from Enemy Levels be considered and then have the multiplier from Difficulty Selection in affect?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
What happens if in this script you have 1 for all levels, rather than the percentages.  That means that this script is applying whatever is in the database.  Does Yanfly's script then kick in?

You might be better off starting a separate topic if no one replies here.  Most people are likely to assume that the scripter will answer any queries and so won't bother looking to see what the post is, but as Todd has said, he's not supporting this script any more.
 
Joined
Jan 23, 2014
Messages
171
Reaction score
24
First Language
English
Primarily Uses
RMMZ
This is true. I did make a new topic. Hopefully, I will get answers there. 

Also I think what the issue is that both Enemy Levels and Difficulty Selection grabs from the base experience in the database. (the ones we can edit).

Enemy Levels then does the formula found in the script to make the monsters "higher level" and stronger.

Difficulty Selection takes the base from the database and then multiplies by the difficulty.

I  was hoping someone would know how to make difficulty selection take from yanfly's "base". If that makes any sense.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
Yes, I can understand what you'd like to do.  Unfortunately I haven't a clue how you would do it.

Good luck with the other thread.
 
Joined
Sep 19, 2014
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Hi, I would like to know how to have it so that as soon as you start a new game, blah blah opening cutscene blah blah, for the selection menu to pop up as soon as you enter the actual game, and to have the option grayed out in the menu after they select it the first time. Either I'm not seeing these customization lines in the script, or they aren't in there. Please, if they are included, tell me how to do this! Thanks!  :)
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
Simply set up an event. You could, for example, give some text explaining what the options are. Then you do a script call

SceneManager.call(Scene_Difficulty)

If you don't want the player to be able to change it once selected, find the line in the configuration section of the script (line number depends which version you're using, try around line 64) which reads

Menu = true

And change it to false.
 
Last edited by a moderator:

Rainy Pride Games [RPG]

Principiant Scripter
Member
Joined
Jan 14, 2015
Messages
16
Reaction score
1
First Language
Spanish
Primarily Uses
I can check with a command what difficult was selected/is on?
 
Last edited by a moderator:

txtk

Veteran
Veteran
Joined
Jul 10, 2014
Messages
115
Reaction score
35
First Language
Vietnamese
Primarily Uses
Is there anyway to re-align this correctly. I tried for hours and failed miserably, lol.

Here you go. 


Hidden Content


#===============================================================================## DT's Difficulty# Author: DoctorTodd# Date (06/24/2012)# Version: (1.0.0) (VXA)# Level: (Medium)# Email: Todd@beacongames.com##===============================================================================## NOTES: 1)This script will only work with ace.# 2)A difficulty must be selected before the first battle or the game WILL# CRASH.##===============================================================================## Description: Lets the player select the games difficulty.## Credits: Me (DoctorTodd), D&P3 for saving bug fix.##===============================================================================## Instructions# Paste above main.##===============================================================================## Free for any use as long as I'm credited.##===============================================================================## Editing begins 38 and ends on 71.##===============================================================================module TODDDIFFICULTY #Easy Text. EASYT = "Easy" #Normal Text. NORMALT = "Normal" #Heroic Text. HEROICT = "Heroic" #Hard Text. HARDT = "Hard" #Easy enemy parameters multiplier. EASYM = 0.5 #Heroic enemy parameters multiplier (Normal is skipped since it's what put #you into the database). HEROICM = 1.5 #Hard enemy parameters multiplier. HARDM = 2 #Easy enemy experience multiplier. EASYEXPM = 0.5 #Heroic enemy experience multiplier (Normal is skipped since it's what put #you into the database). HEROICEXPM = 1.5 #Hard enemy experience multiplier. HARDEXPM = 2 #Easy enemy gold multiplier. EASYGOLDM = 0.5 #Heroic enemy gold multiplier (Normal is skipped since it's what put #you into the database). HEROICGOLDM = 1.5 #Hard enemy gold multiplier. HARDGOLDM = 2 #Easy enemy drop multiplier. EASYDROPM = 0.5 #Heroic enemy drop multiplier (Normal is skipped since it's what put #you into the database). HEROICDROPM = 1.5 #Hard enemy drop multiplier. HARDDROPM = 2 #The text above where the selection is made. TEXT = "Please select a difficulty:" #Menu command? MENU = true #Sound effect to play when difficulty is selected. SE = "Darkness8" #Switch to allow cancelling the difficulty selection. #MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME. SWITCH = 5 end#==============================================================================# ** Game_Enemy#------------------------------------------------------------------------------# This class handles enemies. It used within the Game_Troop class# ($game_troop).#============================================================================== class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * Get Base Value of Parameter #-------------------------------------------------------------------------- alias todd_difficulty_gmen_param_base param_base def param_base(param_id, *args) n1 = todd_difficulty_gmen_param_base(param_id, *args) n2 = case $game_system.todd_difficulty when 0 then TODDDIFFICULTY::EASYM when 1 then 1 when 2 then TODDDIFFICULTY::HEROICM when 3 then TODDDIFFICULTY::HARDM end return n1 * n2end #-------------------------------------------------------------------------- # * Get Experience #-------------------------------------------------------------------------- def exp case $game_system.todd_difficulty when 0 enemy.exp * TODDDIFFICULTY::EASYEXPM when 1 enemy.exp when 2 enemy.exp * TODDDIFFICULTY::HEROICEXPM when 3 enemy.exp * TODDDIFFICULTY::HARDEXPM endend #-------------------------------------------------------------------------- # * Get Gold #-------------------------------------------------------------------------- def gold case $game_system.todd_difficulty when 0 enemy.gold * TODDDIFFICULTY::EASYGOLDM when 1 enemy.gold when 2 enemy.gold * TODDDIFFICULTY::HEROICGOLDM when 3 enemy.gold * TODDDIFFICULTY::HARDGOLDM end end #-------------------------------------------------------------------------- # * Create Array of Dropped Items #-------------------------------------------------------------------------- def make_drop_items case $game_system.todd_difficulty when 0 @DropMulti = TODDDIFFICULTY::EASYDROPM when 1 @DropMulti = 1 when 2 @DropMulti = TODDDIFFICULTY::HEROICDROPM when 3 @DropMulti = TODDDIFFICULTY::HARDDROPM end enemy.drop_items.inject([]) do |r, di| if di.kind > 0 && rand * di.denominator < drop_item_rate * @DropMulti r.push(item_object(di.kind, di.data_id)) else r end end endend #==============================================================================# ** Game_System#------------------------------------------------------------------------------# This class handles system data. It saves the disable state of saving and# menus. Instances of this class are referenced by $game_system.#============================================================================== class Game_System #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :todd_difficulty # save forbidden #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias todd_difficulty_gamesystem_init initialize def initialize @todd_difficulty = 0 todd_difficulty_gamesystem_init endend #==============================================================================# ** Window_DifficultySelection#============================================================================== class Window_DifficultySelection < Window_HorzCommand #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width Graphics.width/2 + 20 end #-------------------------------------------------------------------------- # * Get Digit Count #-------------------------------------------------------------------------- def col_max return 4 end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_command(TODDDIFFICULTY::EASYT, :easy) add_command(TODDDIFFICULTY::NORMALT, :normal) add_command(TODDDIFFICULTY::HEROICT, :heroic) add_command(TODDDIFFICULTY::HARDT, :hard) endend#==============================================================================# ** Window_DifficultyName#============================================================================== class Window_DifficultyName < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return Graphics.width/2 + 20 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT) endend#==============================================================================# ** Scene_Difficulty#============================================================================== class Scene_Difficulty < Scene_MenuBase #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_command_window create_name_window end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_DifficultySelection.new @command_window.set_handler:)easy, method:)command_easy)) @command_window.set_handler:)normal, method:)command_normal)) @command_window.set_handler:)heroic, method:)command_heroic)) @command_window.set_handler:)hard, method:)command_hard)) @command_window.set_handler:)cancel, method:)return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true @command_window.x = Graphics.width/2 - 170 @command_window.y = Graphics.height/2 - 50 end #-------------------------------------------------------------------------- # * Create Difficulty Window #-------------------------------------------------------------------------- def create_name_window @name_window = Window_DifficultyName.new @name_window.x = Graphics.width/2 - 170 @name_window.y = Graphics.height/2 - 97 end #-------------------------------------------------------------------------- # * [easy] Command #-------------------------------------------------------------------------- def command_easy $game_system.todd_difficulty = 0 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [normal] Command #-------------------------------------------------------------------------- def command_normal $game_system.todd_difficulty = 1 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [heroic] Command #-------------------------------------------------------------------------- def command_heroic $game_system.todd_difficulty = 2 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end #-------------------------------------------------------------------------- # * [hard] Command #-------------------------------------------------------------------------- def command_hard $game_system.todd_difficulty = 3 Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100) return_scene end end if TODDDIFFICULTY::MENU == true#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs the menu screen processing.#============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- alias todd_dif_menu_add_menu_command create_command_window def create_command_window todd_dif_menu_add_menu_command @command_window.set_handler:)dif, method:)command_dif)) endend #-------------------------------------------------------------------------- # * [Difficulty] Command #-------------------------------------------------------------------------- def command_dif SceneManager.call(Scene_Difficulty) endend if TODDDIFFICULTY::MENU == true#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------# This command window appears on the menu screen.#============================================================================== class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Add Main Commands to List #-------------------------------------------------------------------------- alias todd_dif_menu_command_add_to_menu add_main_commands def add_main_commands todd_dif_menu_command_add_to_menu add_command("Difficulty", :dif, main_commands_enabled) end endend 
 
Last edited by a moderator:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,544
Reaction score
858
First Language
English
Primarily Uses
RMVXA
I could not find in this thread a solution to a minor issue I had with the script.
I was setting my difficulty to .75 for easy and 1.25 for heroic and 1.5 for hard.
This made experience and gold show up in decimals.
I found a webpage showing what to do to make it round up.

Insert above class Game_Enemy < Game_Battler
this code
Code:
class Float
  def to_nearest_i
    (self+0.5).to_i
  end
end

Then in the experience and gold sections I modified the easy, heroic and hard parts to be like this
Code:
when 0 then (enemy.exp * TODDDIFFICULTY::EASYEXPM).to_nearest_i

Now all numbers are rounded up.

Hope this is of use to people.
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
552
Reaction score
23
First Language
english
Primarily Uses
RMVXA
i need some help with this script. when i select a difficulty in the start of the game, it works just fine. when i try to change the difficulty in the menu it stays at the first set difficulty, how do i fix this?
 

ovate

tale
Veteran
Joined
Dec 16, 2016
Messages
998
Reaction score
1,615
First Language
English
Primarily Uses
N/A
Fixed script format, credit Todd.
Code:
#===============================================================================
#
# DT's Difficulty
# Author: DoctorTodd
# Date (06/24/2012)
# Version: (1.0.0) (VXA)
# Level: (Medium)
# Email: Todd@beacongames.com
#
#===============================================================================
#
# NOTES: 1)This script will only work with ace.
#        2)A difficulty must be selected before the first battle or the game WILL
#        CRASH.
#
#===============================================================================
#
# Description: Lets the player select the games difficulty.
#
# Credits: Me (DoctorTodd), D&P3 for saving bug fix.
#
#===============================================================================
#
# Instructions
# Paste above main.
#
#===============================================================================
#
# Free for any use as long as I'm credited.
#
#===============================================================================
#
# Editing begins 38 and ends on 71.
#
#===============================================================================
module TODDDIFFICULTY
 
  #Easy Text.
  EASYT = "Easy"
 
  #Normal Text.
  NORMALT = "Normal"
 
  #Heroic Text.
  HEROICT = "Heroic"
 
  #Hard Text.
  HARDT = "Hard"
 
  #Easy enemy parameters multiplier.
  EASYM = 0.5
 
  #Heroic enemy parameters multiplier (Normal is skipped since it's what put
  #you into the database).
  HEROICM = 1.5
 
  #Hard enemy parameters multiplier.
  HARDM = 2
 
  #The text above where the selection is made.
  TEXT = "Please select a difficulty:"
 
  #Menu command?
  MENU = true
 
  #Sound effect to play when difficulty is selected.
  SE = "Darkness8"
 
  #Switch to allow cancelling the difficulty selection.
  #MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME.
  SWITCH = 5
 
end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#  This class handles enemies. It used within the Game_Troop class
# ($game_troop).
#==============================================================================
 
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Base Value of Parameter
  #--------------------------------------------------------------------------
  alias todd_difficulty_gmen_param_base param_base
  def param_base(param_id, *args)
  n1 = todd_difficulty_gmen_param_base(param_id, *args)
  n2 = case $game_system.todd_difficulty
  when 0 then TODDDIFFICULTY::EASYM
  when 1 then 1
  when 2 then TODDDIFFICULTY::HEROICM
  when 3 then TODDDIFFICULTY::HARDM
  end
  return n1 * n2
 end
end
 
 
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================
 
class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :todd_difficulty            # save forbidden
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias todd_difficulty_gamesystem_init initialize
  def initialize
    @todd_difficulty = 0
    todd_difficulty_gamesystem_init
  end
end
 
#==============================================================================
# ** Window_DifficultySelection
#==============================================================================
 
class Window_DifficultySelection < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width/2 + 20
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 4
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(TODDDIFFICULTY::EASYT,     :easy)
    add_command(TODDDIFFICULTY::NORMALT,   :normal)
    add_command(TODDDIFFICULTY::HEROICT,    :heroic)
    add_command(TODDDIFFICULTY::HARDT, :hard)
  end
end
#==============================================================================
# ** Window_DifficultyName
#==============================================================================
 
class Window_DifficultyName < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, fitting_height(1))
    refresh
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width/2 + 20
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT)
  end
end
#==============================================================================
# ** Scene_Difficulty
#==============================================================================
 
class Scene_Difficulty < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    create_command_window
    create_name_window
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_DifficultySelection.new
    @command_window.set_handler(:easy,      method(:command_easy))
    @command_window.set_handler(:normal,     method(:command_normal))
    @command_window.set_handler(:heroic,     method(:command_heroic))
    @command_window.set_handler(:hard,    method(:command_hard))
    @command_window.set_handler(:cancel,    method(:return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true
    @command_window.x = Graphics.width/2 - 170
    @command_window.y = Graphics.height/2 - 50
  end
  #--------------------------------------------------------------------------
  # * Create Difficulty Window
  #--------------------------------------------------------------------------
  def create_name_window
    @name_window = Window_DifficultyName.new
    @name_window.x = Graphics.width/2 - 170
    @name_window.y = Graphics.height/2 - 97
  end
  #--------------------------------------------------------------------------
  # * [easy] Command
  #--------------------------------------------------------------------------
  def command_easy
    $game_system.todd_difficulty = 0
    Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
   end
  #--------------------------------------------------------------------------
  # * [normal] Command
  #--------------------------------------------------------------------------
  def command_normal
    $game_system.todd_difficulty = 1
    Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
   end
  #--------------------------------------------------------------------------
  # * [heroic] Command
  #--------------------------------------------------------------------------
  def command_heroic
    $game_system.todd_difficulty = 2
      Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
   end
  #--------------------------------------------------------------------------
  # * [hard] Command
  #--------------------------------------------------------------------------
  def command_hard
    $game_system.todd_difficulty = 3
        Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
    return_scene
   end
 end
 if TODDDIFFICULTY::MENU == true
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================
 
class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  alias todd_dif_menu_add_menu_command create_command_window
  def create_command_window
    todd_dif_menu_add_menu_command
    @command_window.set_handler(:dif,      method(:command_dif))
  end
end
  #--------------------------------------------------------------------------
  # * [Difficulty] Command
  #--------------------------------------------------------------------------
  def command_dif
  SceneManager.call(Scene_Difficulty)
  end
end
 
if TODDDIFFICULTY::MENU == true
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#  This command window appears on the menu screen.
#==============================================================================
 
class Window_MenuCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Add Main Commands to List
  #--------------------------------------------------------------------------
  alias todd_dif_menu_command_add_to_menu add_main_commands
  def add_main_commands
     todd_dif_menu_command_add_to_menu
    add_command("Difficulty",   :dif,   main_commands_enabled)
  end
 end
end
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
552
Reaction score
23
First Language
english
Primarily Uses
RMVXA
so, i am having an issue with the script, when i go into a game and select the difficulty, it works, but when i save the game and close out of it, the difficulty changes to normal from what i had it on, (unless i already have it on normal). How do i fix this?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,639
Reaction score
8,645
First Language
Indonesian
Primarily Uses
RMVXA
You don't. From tale's script fix, it works fine. How can you tell if it resets?
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
552
Reaction score
23
First Language
english
Primarily Uses
RMVXA
You don't. From tale's script fix, it works fine. How can you tell if it resets?
i look at the battle damage done to my enemies. if i am on easy, they die in one hit, when i load it up after closing the game down, they take more than one hit to kill.
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
552
Reaction score
23
First Language
english
Primarily Uses
RMVXA
So i found out the problem, but i also found the solution.
if you guys are coming across some problems with the difficulty changing when the game is closed completly use this:
#===============================================================================
#
# DT's Difficulty
# Author: DoctorTodd
# Date (06/24/2012)
# Version: (1.0.0) (VXA)
# Level: (Medium)
# Email: Todd@beacongames.com
#
#===============================================================================
#
# NOTES: 1)This script will only work with ace.
# 2)A difficulty must be selected before the first battle or the game WILL
# CRASH.
#
#===============================================================================
#
# Description: Lets the player select the games difficulty.
#
# Credits: Me (DoctorTodd), D&P3 for saving bug fix.
#
#===============================================================================
#
# Instructions
# Paste above main.
#
#===============================================================================
#
# Free for any use as long as I'm credited.
#
#===============================================================================
#
# Editing begins 38 and ends on 71.
#
#===============================================================================
module TODDDIFFICULTY

#Easy Text.
EASYT = "Easy"

#Normal Text.
NORMALT = "Normal"

#Hard Text.
HARDT = "Hard"

#Heroic Text.
HEROICT = "Heroic"

#Easy enemy parameters multiplier.
EASYM = 0.5

#Hard enemy parameters multiplier.
HARDM = 2

#Heroic enemy parameters multiplier.
HEROICM = 3

#The text above where the selection is made.
TEXT = "Select a difficulty"

#Menu command?
MENU = true

#Sound effect to play when difficulty is selected.
SE = "Darkness8"

#Switch to allow cancelling the difficulty selection.
#MUST NOT BE ON WHEN SELECTING FOR THE FIRST TIME.
SWITCH = 5

end
#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
# This class handles enemies. It used within the Game_Troop class
# ($game_troop).
#==============================================================================

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# * Get Base Value of Parameter
#--------------------------------------------------------------------------
alias todd_difficulty_gmen_param_base param_base
def param_base(param_id, *args)
n1 = todd_difficulty_gmen_param_base(param_id, *args)
n2 = case $game_system.todd_difficulty
when 0
enemy.params[param_id] * TODDDIFFICULTY::EASYM
when 1
enemy.params[param_id]
when 2
enemy.params[param_id] * TODDDIFFICULTY::HARDM
when 3
enemy.params[param_id] * TODDDIFFICULTY::HEROICM
else
enemy.params[param_id]
end
end
end


#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
# This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================

class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :todd_difficulty # save forbidden
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias todd_difficulty_gamesystem_init initialize
def initialize
@todd_difficulty = 0
todd_difficulty_gamesystem_init
end
end

#==============================================================================
# ** Window_DifficultySelection
#==============================================================================

class Window_DifficultySelection < Window_HorzCommand
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width/2 + 20
end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
def col_max
return 4
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_command(TODDDIFFICULTY::EASYT, :easy)
add_command(TODDDIFFICULTY::NORMALT, :normal)
add_command(TODDDIFFICULTY::HARDT, :hard)
add_command(TODDDIFFICULTY::HEROICT, :heroic)
end
end
#==============================================================================
# ** Window_DifficultyName
#==============================================================================

class Window_DifficultyName < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width, fitting_height(1))
refresh
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return Graphics.width/2 + 20
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT)
end
end
#==============================================================================
# ** Scene_Difficulty
#==============================================================================

class Scene_Difficulty < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_command_window
create_name_window
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_DifficultySelection.new
@command_window.set_handler:)easy, method:)command_easy))
@command_window.set_handler:)normal, method:)command_normal))
@command_window.set_handler:)hard, method:)command_hard))
@command_window.set_handler:)heroic, method:)command_heroic))
@command_window.set_handler:)cancel, method:)return_scene))if $game_switches[TODDDIFFICULTY::SWITCH] == true
@command_window.x = Graphics.width/2 - 170
@command_window.y = Graphics.height/2 - 50
end
#--------------------------------------------------------------------------
# * Create Difficulty Window
#--------------------------------------------------------------------------
def create_name_window
@name_window = Window_DifficultyName.new
@name_window.x = Graphics.width/2 - 170
@name_window.y = Graphics.height/2 - 97
end
#--------------------------------------------------------------------------
# * [easy] Command
#--------------------------------------------------------------------------
def command_easy
$game_system.todd_difficulty = 0
Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
return_scene
end
#--------------------------------------------------------------------------
# * [normal] Command
#--------------------------------------------------------------------------
def command_normal
$game_system.todd_difficulty = 1
Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
return_scene
end
#--------------------------------------------------------------------------
# * [heroic] Command
#--------------------------------------------------------------------------
def command_heroic
$game_system.todd_difficulty = 2
Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
return_scene
end
#--------------------------------------------------------------------------
# * [hard] Command
#--------------------------------------------------------------------------
def command_hard
$game_system.todd_difficulty = 3
Audio.se_play("Audio/SE/" + TODDDIFFICULTY::SE, 100, 100)
return_scene
end
end
if TODDDIFFICULTY::MENU == true
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
alias todd_dif_menu_add_menu_command create_command_window
def create_command_window
todd_dif_menu_add_menu_command
@command_window.set_handler:)dif, method:)command_dif))
end
end
#--------------------------------------------------------------------------
# * [Difficulty] Command
#--------------------------------------------------------------------------
def command_dif
SceneManager.call(Scene_Difficulty)
end
end

if TODDDIFFICULTY::MENU == true
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
# This command window appears on the menu screen.
#==============================================================================

class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# * Add Main Commands to List
#--------------------------------------------------------------------------
alias todd_dif_menu_command_add_to_menu add_main_commands
def add_main_commands
todd_dif_menu_command_add_to_menu
add_command("Difficulty", :dif, main_commands_enabled)
end
end
end
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,639
Reaction score
8,645
First Language
Indonesian
Primarily Uses
RMVXA
Did you just repost tale's script fix?
Or there's a modification on it?
 

Latest Threads

Latest Posts

Latest Profile Posts

d757 going live today
Me: *Decides to make a custom battle system for my game using events.*
One week later: *Decides to implement about 200% more tactics than originally planned.*
Another week later: *Decides to add in allies to battle and let you switch between them without using any of the default battle system or menu options at all because I'm a masochist.*
We got BASE COLOR, bois!! And sadness...
Hap2FPS.gifHap5FPS.gif
Happy

Sad2FPS.gifSad5FPS.gif
Sad
A game review, Eloquent Countenance by RachelDrawsThis.

Forum statistics

Threads
118,718
Messages
1,118,165
Members
155,861
Latest member
marytan123
Top