Difference between revisions of "Difficulty Slider (YEP)"

From Yanfly.moe Wiki
Jump to navigation Jump to search
(Created page with "{{MvPlugin |preview=<youtube>https://www.youtube.com/watch?v=6K3W6BAMw0o</youtube> |link1=<html><iframe src="https://itch.io/embed/399502" height="167" width="552" frameborder...")
 
Line 1: Line 1:
 
{{MvPlugin
 
{{MvPlugin
|preview=<youtube>https://www.youtube.com/watch?v=6K3W6BAMw0o</youtube>
+
|preview = <youtube>https://www.youtube.com/watch?v=6K3W6BAMw0o</youtube>
|link1=<html><iframe src="https://itch.io/embed/399502" height="167" width="552" frameborder="0"></iframe></html>
+
|link1 = <html><iframe src="https://itch.io/embed/399502" height="167" width="552" frameborder="0"></iframe></html>
|link2=[http://yanfly.moe/plugins/en/YEP_X_DifficultySlider.js Mirror]
+
|link2 = [http://yanfly.moe/plugins/en/YEP_X_DifficultySlider.js Mirror]
  
 
}}
 
}}
Line 12: Line 12:
 
{{Yanfly Engine Plugins}}
 
{{Yanfly Engine Plugins}}
  
== Help File ==
+
== Introduction ==
  
 
  <nowiki>
 
  <nowiki>
============================================================================
 
Introduction
 
============================================================================
 
 
 
This plugin requires YEP_EnemyLevels.
 
This plugin requires YEP_EnemyLevels.
 
Make sure this plugin is located under YEP_EnemyLevels in the plugin list.
 
Make sure this plugin is located under YEP_EnemyLevels in the plugin list.
Line 36: Line 32:
 
will revert back to 100%. You can enable and disable this feature at will
 
will revert back to 100%. You can enable and disable this feature at will
 
through plugin commands.
 
through plugin commands.
 +
</nowiki>
  
============================================================================
+
== Notetags ==
Notetags
 
============================================================================
 
  
 +
<nowiki>
 
There is a notetag you can use for the Difficulty Slider plugin.
 
There is a notetag you can use for the Difficulty Slider plugin.
  
Line 48: Line 44:
 
   - This will make the enemy's level unaffected by the difficulty slider,
 
   - This will make the enemy's level unaffected by the difficulty slider,
 
   meaning the enemy will always be at 100% its current calculated level.
 
   meaning the enemy will always be at 100% its current calculated level.
 +
</nowiki>
  
============================================================================
+
== Plugin Commands ==
Plugin Commands
 
============================================================================
 
  
 +
<nowiki>
 
For those who wish to show/hide the Difficulty Slider from the options menu
 
For those who wish to show/hide the Difficulty Slider from the options menu
 
midway through the game, you can control it using these plugin commands:
 
midway through the game, you can control it using these plugin commands:
Line 65: Line 61:
 
   - This will hide the Difficulty Slider and also disable the slider's
 
   - This will hide the Difficulty Slider and also disable the slider's
 
   effects on enemy levels in the game.
 
   effects on enemy levels in the game.
 +
</nowiki>
  
============================================================================
+
== Additional Info ==
Additional Info
 
============================================================================
 
  
 +
<nowiki>
 
For those who wish to use the Difficulty Slider in script calls, you can
 
For those who wish to use the Difficulty Slider in script calls, you can
 
find out the value the player has set using:
 
find out the value the player has set using:
Line 85: Line 81:
  
 
Have fun!
 
Have fun!
 +
</nowiki>
  
============================================================================
+
== Options Core Settings - Adding the New Options ==
Options Core Settings - Adding the New Options
 
============================================================================
 
  
 +
<nowiki>
 
If you are using YEP_OptionsCore.js, you can add a new Option using this
 
If you are using YEP_OptionsCore.js, you can add a new Option using this
 
plugin. Here's the following code/parameter settings you can use with it.
 
plugin. Here's the following code/parameter settings you can use with it.
Line 174: Line 170:
 
Load Config Code:
 
Load Config Code:
 
// Empty. Provided by this plugin.
 
// Empty. Provided by this plugin.
 +
</nowiki>
  
============================================================================
+
== Changelog ==
Changelog
 
============================================================================
 
  
 +
<nowiki>
 
Version 1.04:
 
Version 1.04:
 
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
 
- Bypass the isDevToolsOpen() error when bad code is inserted into a script

Revision as of 01:28, 22 June 2019

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.



Download

System

This is a plugin created for RPG Maker MV.

For help on how to install plugins, click here.

For help on how to update plugins, click here.

Got errors with your RPG Maker MV plugin? Click here.


Masterarbeit Writer

Required Plugins

The following plugins are required in order to use this plugin.

Place the following plugins above this plugin located in the Plugin Manager.

Yanfly Engine Plugins

This plugin is a part of the Yanfly Engine Plugins library.


Introduction

This plugin requires YEP_EnemyLevels.
Make sure this plugin is located under YEP_EnemyLevels in the plugin list.

Sometimes, players would like to be able to increase or decrease the
difficulty of your game at their own accord. The Difficulty Slider becomes a
feature accessible from the game's option menu with this plugin installed.
There, the player is able to alter the level of the enemies that appear in
battle within a certain range (set by you, the developer).

The Difficulty Slider will only alter the level of the enemies and nothing
else. Therefore, a 200% difficulty will mean only a 200% increase in level
but not necessarily a 200% increase in ATK, for example. The enemies' ATK
value will be based off of its ATK at 200% the original level.

If the Difficulty Slider is disabled in the game, then the level multiplier
will revert back to 100%. You can enable and disable this feature at will
through plugin commands.

Notetags

There is a notetag you can use for the Difficulty Slider plugin.

Enemy Notetag:

  <Unaffected by Difficulty Slider>
  - This will make the enemy's level unaffected by the difficulty slider,
  meaning the enemy will always be at 100% its current calculated level.

Plugin Commands

For those who wish to show/hide the Difficulty Slider from the options menu
midway through the game, you can control it using these plugin commands:

Plugin Commands:

  ShowDifficultySlider
  - This will show the Difficulty Slider and enable it making it apply to
  all enemies in the game that do not have an unaffected notetag.

  HideDifficultySlider
  - This will hide the Difficulty Slider and also disable the slider's
  effects on enemy levels in the game.

Additional Info

For those who wish to use the Difficulty Slider in script calls, you can
find out the value the player has set using:

  ConfigManager.difficultySlider

This value will return a whole number. A difficulty setting of 100% will
yield 100 and a difficulty setting of 200% will yield 200. Therefore, if you
wish to make a check that appears only on higher difficulties, you can use
the following:

  if (ConfigManager.difficultySlider >= 200) {
    // Do stuff
  }

Have fun!

Options Core Settings - Adding the New Options

If you are using YEP_OptionsCore.js, you can add a new Option using this
plugin. Here's the following code/parameter settings you can use with it.

---------
Settings:
---------

Name:
\i[87]Enemy Difficulty

Help Description:
Determines the level strength of enemies.

Symbol:
difficultySlider

Show/Hide:
if (Imported.YEP_X_DifficultySlider) {
  show = $gameSystem.showDifficultySlider();
} else {
  show = false;
}

Enable:
enabled = true;

Ext:
ext = 0;

----------
Functions:
----------

Make Option Code:
this.addCommand(name, symbol, enabled, ext);

Draw Option Code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var value = this.getConfigValue(symbol);
var rate = value / Yanfly.Param.DSliderMaxDif;
var gaugeColor1 = this.textColor(28);
var gaugeColor2 = this.textColor(29);
this.drawOptionsGauge(index, rate, gaugeColor1, gaugeColor2);
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'center');

Process OK Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += Yanfly.Param.DSliderChange;
if (value > Yanfly.Param.DSliderMaxDif) value = Yanfly.Param.DSliderMinDif;
value = value.clamp(Yanfly.Param.DSliderMinDif, Yanfly.Param.DSliderMaxDif);
this.changeValue(symbol, value);

Cursor Right Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += Yanfly.Param.DSliderChange;
value = value.clamp(Yanfly.Param.DSliderMinDif, Yanfly.Param.DSliderMaxDif);
this.changeValue(symbol, value);

Cursor Left Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= Yanfly.Param.DSliderChange;
value = value.clamp(Yanfly.Param.DSliderMinDif,
Yanfly.Param.DSliderMaxDif);
this.changeValue(symbol, value);

Default Config Code:
// Empty. Provided by this plugin.

Save Config Code:
// Empty. Provided by this plugin.

Load Config Code:
// Empty. Provided by this plugin.

Changelog

Version 1.04:
- Bypass the isDevToolsOpen() error when bad code is inserted into a script
call or custom Lunatic Mode code segment due to updating to MV 1.6.1.

Version 1.03:
- Compatibility update for YEP_OptionsCore.js.

Version 1.02:
- Updated for RPG Maker MV version 1.5.0.

Version 1.01:
- Bug fixed: Error with pressing right on the difficulty slider causing
the game to crash unexpectedly.

Version 1.00:
- Finished Plugin!