Difficulty Selection

Vermilion

Warper
Member
Joined
Jan 28, 2013
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Hey great script! I'm new to all this so I was wondering if you could help...

The dialog box "Please select a difficulty" is slightly too small on mine looks like "Please select a difficult" cutting of most of the y. noob question.. which part of the script affects this and how much does it need to change?

Also is there any way to include this in a game intro so it autoruns instead of having to start the game and change it in the menu?

Thanks!!
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
It shouldn't but I'll look into soon. I'm busy right now. To call it without the menu use this SceneManager.call(Scene_Difficulty). Also use this version as the other one has issues.

Code:
#===============================================================================## DT's Difficulty# Author: DoctorTodd# Date (06/24/2012)# Version: (1.1.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 = 5end#==============================================================================# ** 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 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    msgbox_p($game_system.todd_difficulty)    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)  endendif 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
 

Eurgh

Lord of the Reapers
Veteran
Joined
Oct 6, 2012
Messages
172
Reaction score
34
Primarily Uses
Every time i select a difficulty, it comes up with the corrosponding number in a window twice. Like when i first select difficulty, it comes up with "0" twice in comfirmation boxes, then goes to which difficulty to select. Then whichever i chose, when i go to select a new difficulty, it comes up with it's number, such as normal being "1" which comes up in a confirmation box twice before letting me select a new difficulty. It doesn't really affect anything other than it makes it look ugly and badly made. Which i'm not saying it is, but for someone playing the game without knowing, they may think that the game is broken. So if you could find a way to fix that, it would be appreciated.
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Here you go, the window was to help with development.

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 = 5end#==============================================================================# ** 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 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)  endendif 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
 
 

Eurgh

Lord of the Reapers
Veteran
Joined
Oct 6, 2012
Messages
172
Reaction score
34
Primarily Uses
Could you just tell me which lines to change, since straight copying and pasting isn't putting it into format for me?
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Delete line 148.
 

Eurgh

Lord of the Reapers
Veteran
Joined
Oct 6, 2012
Messages
172
Reaction score
34
Primarily Uses
Thank you very much. Phenominal script too, may i say. It really has made things easier for me.
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,384
Reaction score
10,824
First Language
English
Primarily Uses
RMVXA
This is a great script.  Thank you.

Can I just check a couple of things. 

From the way the comments are phrased, I assume that the script in the post dated 17th February is the most up to date one, not the one at the beginning of the thread.  Is that correct?

It looks as if the player can change their choice at any time and as often as they wish.  Is that correct?

If that is correct, and I decide that I would like the player to choose just once at the beginning, I've seen what's in an earlier post about being able to remove it from the menu.  What I don't understand (because I am a total novice on anything to do with scripts) is how I then present the choice to the player.  Do I have to put in an event asking them to pick a level?  If so, how do I link that event to the script?  I'm not sure if I've formulated the question correctly, so I hope you'll understand what I'm trying to get at.

Thanks.
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
1) I believe they are both up to date.

2) Yes

3) Change line 64 from MENU = true to MENU = false

4) Call it using SceneManager.call(Scene_Difficulty) in an event script call

 
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,200
Reaction score
1,256
First Language
English
Primarily Uses
RMXP
Hi Todd,

I suggest that you restructure the customization section so that you group by difficulty rather than by type.

It makes understanding the settings for each difficulty easier.

I have gone ahead and done some modifications show what I mean. (Take anything from it you like, or ignore it if you prefer)

module TODDDIFFICULTY  # Difficulty multiplier affects enemy parameters (Normal is skipped since it's what put  # you into the database).   # EASY DIFFICULTY    EASY_TEXT = "Easy"  EASY_MULTIPLIER = 0.5  # NORMAL DIFFICULTY    NORMAL_TEXT = "Normal"   # HARD DIFFICULTY    HARD_TEXT = "Hard"  HARD_MULTIPLIER = 2   # HEROIC DIFFICULTY    HEROIC_TEXT = "Heroic"  HEROIC_MULTIPLIER = 1.5   # Selection description  TEXT = "Please select a difficulty:"   #Menu command?  ADD_TO_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 = 5end

*hugs*
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Thanks Zeriab, I updated the script in the main post.
 

Destinaxe

Veteran
Veteran
Joined
Mar 7, 2013
Messages
69
Reaction score
0
First Language
English
Primarily Uses
Excellent script, i wouldn't even know where to start if i attempted to make even a simple script

Hey great script! I'm new to all this so I was wondering if you could help...

The dialog box "Please select a difficulty" is slightly too small on mine looks like "Please select a difficult" cutting of most of the y. noob question.. which part of the script affects this and how much does it need to change?

Also is there any way to include this in a game intro so it autoruns instead of having to start the game and change it in the menu?

Thanks!!
This has happened to me as well, attached is a screenshot

Here is the screenshot

Image001.bmp

Oh and on top off that 3 boxes appear after clicking new game which then all just say '0' and nothing else
 

Attachments

Last edited by a moderator:

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Changing line 172 from

    draw_text(15, -27, 400, 80, TODDDIFFICULTY::TEXT)

to

    draw_text(0, -27, 400, 80, TODDDIFFICULTY::TEXT)

should fix that. 

To get rid of the other problem delete a line in the 140s that looks like this.

Code:
 msgbox_p($game_system.todd_difficulty)
 
Last edited by a moderator:

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,384
Reaction score
10,824
First Language
English
Primarily Uses
RMVXA
@ Todd  Thanks for the info, that's answered my questions clearly.
 

ninjalex

Veteran
Veteran
Joined
Aug 15, 2012
Messages
252
Reaction score
55
First Language
English
Primarily Uses
Awesome script. It's simple and clean.

No Kingdom hearts reference intended. 
 

Shion Kreth

White Knight
Veteran
Joined
Jan 28, 2013
Messages
281
Reaction score
47
First Language
English
Primarily Uses
two questions:

Can we adjust experience gains with different difficulties?

Can we make use only 3 of the 4 difficulty options?

Good script, btw, I figured it would be a feature that was crazy difficult to accomplish.
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
Thanks, it can't do that without modifications but I can do them now. 
 

Shion Kreth

White Knight
Veteran
Joined
Jan 28, 2013
Messages
281
Reaction score
47
First Language
English
Primarily Uses
*sings Todd's praises*
 

Tsunar

Villager
Member
Joined
Jun 21, 2013
Messages
15
Reaction score
3
First Language
English
Primarily Uses
Hello Todd San is it possible to make it so higher difficulties give more gold/ exp as well as higher drop rates? =O
 

Todd

Game Developer
Member
Joined
Mar 14, 2012
Messages
269
Reaction score
43
First Language
English
Primarily Uses
N/A
It is. I've been busy lately but I'll try to make time for it. 
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Been parallax mapping nigh all night. :D
2nd character based on the same random inputs
the coffee shop i go to for open mic every friday only has 2 more open mics left and then they're done :'( i'm gonna die!
Everytime someone says Intel "kabylake" I hear either baby lake or ladycake.
Either I just had one of those dreams where you think you're awake, or I have time traveled. I woke up at 6:58am this morning, heard my father leaving for work, laid back down, now its 1:16am.

Forum statistics

Threads
93,383
Messages
911,872
Members
122,885
Latest member
Hayato7729
Top