• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
[v12+] Difficulty Modes

Resource [v12+] Difficulty Modes 1.1.1

-FL-

Pokémon Island Creator
Member
Joined
Aug 28, 2022
Posts
377
-FL- submitted a new resource:

[v12+] Difficulty Modes - Allows an easy way to make difficulty modes like the ones on Key System in B2W2.

This script is for Pokémon Essentials. It allows an easy way to make difficulty modes like the ones on Key System in B2W2.

A difficulty mode may change:
  1. Wild Pokémon levels
  2. Trainer's Pokémon levels
  3. Trainer's skill level
  4. Trainer's money given
  5. Trainer definition (define a different trainer entry in trainers.txt)
  6. Exp received
Tested on Essentials v19.1 and v20.1. More versions (v12) on link. If this script isn't working on latest Essentials version, please...

Read more about this resource...
 
Has anyone tried turning this into an options in the options menu?
 
Has anyone tried turning this into an options in the options menu?
You need an option to change a variable (not directly related to this script). Put the below code in the script or above main:

Way A - Simpler, but won't work a option screen in start menu before save was created.

Ruby:
Expand Collapse Copy
MenuHandlers.add(:options_menu, :difficulty_mode, {
  "name"        => _INTL("Difficulty"),
  "order"       => 50,
  "type"        => EnumOption,
  "parameters"  => [_INTL("Lunatic."), _INTL("Vanilla")],
  "description" => _INTL("Change the difficulty of the game. Try to not change it too often."),
  "get_proc"    => proc { $game_variables ? $game_variables[90] : 0 },
  "set_proc"    => proc { |value, _scene| $game_variables[90] = value if $game_variables}
})

Way B - Works at option screen in start menu, but you need to call script line '$PokemonSystem.refresh_var' in Oak's letture.

Ruby:
Expand Collapse Copy
MenuHandlers.add(:options_menu, :difficulty_mode, {
  "name"        => _INTL("Difficulty"),
  "order"       => 50,
  "type"        => EnumOption,
  "parameters"  => [_INTL("Lunatic."), _INTL("Vanilla")],
  "description" => _INTL("Change the difficulty of the game. Try to not change it too often."),
  "get_proc"    => proc { $game_variables ? $game_variables[90] : $PokemonSystem.difficultyMode },
  "set_proc"    => proc { |value, _scene| 
    $PokemonSystem.difficultyMode = value
    $PokemonSystem.refresh_var
  }
})

class PokemonSystem
  attr_accessor :difficultyMode

  alias :_old_fl_option_var_initialize :initialize
  def initialize
    _old_fl_option_var_initialize
    @difficultyMode = 0
  end

  def refresh_var
    return if !$game_variables
    $game_variables[90] = @difficultyMode
  end
end
 
Heyo, just installed this earlier and it doesn't seem to be working for me. I'll share my code and teams, but it refuses to run any other than the "hard" one (which is the default difficulty)
#-------------------------------
[LEADER_Koga,Koga,1]
LoseText = That was a clear display of your swiftness, trainer... I am defeated.
Pokemon = WOOPER,10
Form = 1
Moves = MUDSHOT,TOXIC
AbilityIndex = 1
IVs = 15,15,15,15,15,15
EVs = 32,0,0,0,0,0
Pokemon = KOFFING,12
Moves = CLEARSMOG,STOCKPILE
AbilityIndex = 0
Item = ORANBERRY
IVs = 15,15,15,15,15,15
EVs = 0,0,0,0,0,32

#-------------------------------
[LEADER_Koga,Koga,101]
LoseText = MED: That was a clear display of your swiftness, trainer... I am defeated.
Pokemon = WOOPER,10
Form = 1
Moves = MUDSHOT,TOXIC
AbilityIndex = 1
IVs = 10,10,10,10,10,10
Pokemon = KOFFING,12
Moves = CLEARSMOG,STOCKPILE
AbilityIndex = 0
Item = ORANBERRY
IVs = 10,10,10,10,10,10
#-------------------------------
[LEADER_Koga,Koga,201]
LoseText = EASY: That was a clear display of your swiftness, trainer... I am defeated.
Pokemon = WOOPER,10
Form = 1
Moves = MUDSHOT,TOXIC
AbilityIndex = 1
Pokemon = KOFFING,12
Moves = CLEARSMOG,STOCKPILE
AbilityIndex = 0



# The code stuff from your plugin
VARIABLE=84

def self.current_mode
return nil if DifficultyModes::VARIABLE<=0
difficulty_hash={}

hard_mode = Difficulty.new
hard_mode.id_jump = 0
hard_mode.skill_proc = proc{|skill_level,trainer|
next 100
}
difficulty_hash[1] = hard_mode

medium_mode = Difficulty.new
medium_mode.id_jump = 100
medium_mode.skill_proc = proc{|skill_level,trainer|
next 64
}
difficulty_hash[2] = medium_mode

easy_mode = Difficulty.new
easy_mode.id_jump = 200
easy_mode.skill_proc = proc{|skill_level,trainer|
next 48
}
difficulty_hash[3] = easy_mode

return difficulty_hash[pbGet(DifficultyModes::VARIABLE)]
end


Any ideas? My plugin list is

Deluxe Battle Kit
Difficulty Modes
Gen 9 Animation Project
Gen 9 Pack Scripts
Level Caps EX
Modular Pokemon Selection
v21.1 Hotfixes


Appreciate any insight on the matter :)
 
Back
Top