Dice Rolls and RNG Seeds VisuStella MZ

From Yanfly.moe Wiki
Jump to navigation Jump to search

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 MZ.

InstallPluginsMz.png

UpdatePlugins.png

Troubleshooting.jpg

Click here for help on how to install plugins and an explanation on the Tier Hierarchy System.

Click here to learn how to update plugins.

Click here for how to troubleshoot plugins if you get an error.


Masterarbeit Writer


DiceRolls D20.gif

DiceRolls Advantage.gif

DiceRolls DiceCount.gif

DiceRolls Ranks.gif

DiceRolls Modifier.gif


VisuStella MZ

This plugin is a part of the VisuStella MZ Plugin Library.

Click here if you want to help support VisuStella on Patreon.

Introduction

VisuMZ.144.jpg

Games that use random elements in their game can benefit by using visualized Dice Rolls in order to give players an understanding of what kind of logic is happening behind the randomization. Various things like switches, items, and skills can also affect the roll values to give the player more control over the nature of RNG. However, to give the game developer more control, Random Number Seeds are also provided through this plugin. These seeds allow for games to function in a more controlled pattern and prevent things like save scumming for better results. Though the numbers themselves are still random, they will exhibit predetermined and predictable outcomes through the usage of Plugin Commands.

Features include all (but not limited to) the following:

  • Visualized Dice Rolls can be called through Plugin Commands, using 4-sided dice, 6-sided dice, 8-sided, 10-sided, 12-sided, and 20-sided dice.
  • Dice Rolls can be modified through dice effects, either automatic or bonus effets using player input.
  • Dice effects include changing the number of Dice Rolled, the sides each dice has, and/or modifiers that affect the final roll.
  • Random Number Seeds allow for predetermined randomized outcomes when rolling for random numbers.
  • Custom Random Number Seeds can be numbers or text, allowing you to make truly unique cases for various random number batches.
  • Dice Rolls can also be controlled through Random Number Seeds.
  • Reset the custom seed state and begin the seed anew.
  • Notetags can allow skills and items to also utilize Random Number Seeds to give RNG-generated results.
  • "Daily" effect can affect and provide specialized Random Number Seeds for just that day.
  • "Unique" effect will affect and provide specialized Random Number Seed for that save game and any other branching saves made after.
  • Control these seeded random numbers through Plugin Commands or JavaScript script calls.

Requirements

This plugin is made for RPG Maker MZ. This will not work in other iterations of RPG Maker.


Tier 4

This plugin is a Tier 4 plugin. Place it under other plugins of lower tier value on your Plugin Manager list (ie: 0, 1, 2, 3, 4, 5).

This is to ensure that your plugins will have the best compatibility with the rest of the VisuStella MZ Plugin library.



Dice Rolls Visualized

DiceRolls D20.gif

This section explains how visualized Dice Rolls work. These visualized Dice Rolls give a player a visual understanding of how the randomized numbers play out before them.

---

Dice Count, Advantage, Disadvantage

DiceRolls Advantage.gif

DiceRolls DiceCount.gif

Depending on the type of Dice Roll you're making, dice count can mean different things. For the Plugin Command "Dice: Roll Value", the dice count refers to just the total number of Dice Rolled, and from there, the highest, lowest, average, or total amount calculated from the dice will be recorded.

However, when using the Plugin Command "Dice: Target Value", the mechanics known as "Advantage" and "Disadvantage" are used.

When in an "Advantage" state, the player throws multiple dice (anything above 1 dice). From there, the highest value is selected if going for "above/equal" target value. The lowest value is selected if the Plugin Command has the player aiming for below/equal target value.

In a "Disadvantage" state, just like with the "Advantage" state, the player throws multiple dice. However, the opposite happens. When going for above/equal target value, instead of selecting the highest value, the lowest dice value is selected instead. When going for "below/equal" target value, the highest value is selected rather than the lowest.

---

Dice Sides

DiceRolls Ranks.gif

The number of sides a dice has will be either 4, 6, 8, 10, 12, or 20 for the purpose of this plugin. While we can create more options, these are the most popular polyhedral dice that you will see, stemming from a variety of board games and tabletop RPG's. These dice will also be known as D4, D6, D8, D10, D12, and D20 each referring to the number of sides they have.

The number of sides a dice has will determine its rank also. For the purpose of this plugin, there are six ranks to match the six types of dice we have available.

 Rank 1 - D4
 Rank 2 - D6
 Rank 3 - D8
 Rank 4 - D10
 Rank 5 - D12
 Rank 6 - D20

Ranks are used in Dice Roll automatic effects and bonus effects. By raising a dice's rank, a D6 can transform into a D8 for example. Lowering a dice's rank can transform said D6 into a D4. For this plugin, ranks cannot go below Rank 1 (D4) and cannot go above Rank 6 (D20).

---

Dice Modifiers

DiceRolls Modifier.gif

When rolls are decided, modifiers are then applied to the Dice Roll number. For example, if a player has "Modifier +3" and rolls a 10, the number adds the +3 modifier and becomes a 13. The 13 is then used to record the numeric value of the roll and/or determine if the roll is successful or not. The modified roll number can also exceed the number of sides on the dice.

Negative modifiers can also exist and send the roll value going the other way. For example, if a player has "Modifier -2" and rolls a 10, the number applies the -2 modifier and becomes 8 instead. The 8 is then used to record the numeric value of the roll and/or determine if the roll is successful or not. The modified roll number can also go below 1 and reach 0 or negative numbers, too.

Modifiers can also have a random element. This random element is calculated when the modifier is being applied and will utilize the Dice Roll's Random Number Seed if specified. As such, the display range for the modifier will show the modifier minimum with the potential maximum modifier.

---

Natural Rolls

DiceRolls Natural20.png

Regarding dice modifiers, there is a slight rule tweak if you are using the Plugin Command "Dice: Target Value" to roll dice. If the command option of "Allow Natural Rolls?" parameter is enabled and set to "true", then there are two special numbers that, when rolled, will ignore modifiers and will count as either an automatic success or an automatic failure. These numbers are 1 and whatever number is the maximum number of sides on the dice.

For example, on a D20, a Natural 1 will result in instant failure while a Natural 20 will result in instant success regardless of the modifiers or whatever target value needs to be reached. If a target value needed to be reached happens to be 25, and the player rolls a Natural 20, it will still count as a success provided that the player is going for an "above/equal" target value.

The opposite is true when going for a "below/equal" target value. Rolling a Natural 1 will count as an automatic success while rolling the max value of the dice will count as an automatic failure regardless of the target value.

Natural rolls will still be recorded normally to variables and switches. There's no indicators suggesting that they are "critical successes" or "critical failures". Instead, just as "success" and "failure". If you wish to portray the "critical" nature of the roll, best use the variable to determine if anything 1 and below, or anything equal or higher than max to be considered "criticals" of either extreme.

---

Automatic Effects

DiceRolls AutoEffects.png

Automatic Effects are dice effects that are automatically applied at the start of a Dice Roll, from before the Dice Roll appears on screen. These effects can modify dice counts, alter advantage and disadvantage, raise or lower dice ranks, and adjust Dice Roll modifiers. The effects range from general effects that always occur or based off certain JavaScript conditions to other effects like if a certain actor has a skill available to use.

If, for whatever reason, an Automatic Effect's conditions were to suddenly be enabled during the middle of the Dice Roll, it would not suddenly become active and grant the dice effects to the roll. Likewise, if an Automatic Effect's conditions were to suddenly be unmet during the middle of a Dice Roll, the dice effects would not be revoked either. The Automatic Effects to be used will always be determined at the start, before the Dice Roll even appears on screen.

---

Bonus Effects

DiceRolls BonusEffects.png

Unlike Automatic Effects, Bonus Effects are applied by the player manually. They can alter dice counts, advantage, disadvantage, ranks, and modifiers just like Automatic Effects can, but the player has the option of doing so. Some effects have a limited number of times they can be used while others. Other effects will not only require an actor to know a specific skill, but also to be able to pay for them.

These Bonus Effects, once selected and activated, will grant their dice effects for the rest of the Dice Roll. Even if the conditions would be unmet later, the dice effects will remain until the Dice Roll finishes. However, the Bonus Effects that are available to be selected from the start will be the only ones available for selection at all during the Dice Roll. This means that even if a show condition (like switches or JS: Show) is met halfway through, it will not appear in the list unless it was there from the start. The same goes for variable, item, and skill conditions. This is to match the same enabling/visibility settings that Automatic Effects have.

---

Random Number Seeds

VisuMZ.144.jpg

This section explains how Random Number Seeds work.

---

Random Number Seeds

DiceRollsRngSeeds Command3.png

Seeds will initialize a random number generator. Retrieving random numbers from this same seed will give the same sequence of random numbers when restarted or continued. If a different seed is used, then different number sequences will occur. It's useful for replication experiments or simulations while preventing things like save scumming for different randomized results.

Let's take a look at how this works. If we use the Plugin Command to generate a random number between 0 and 100 using the seed "RpgTsukuru", then the numbers will appear in this order:

 11   82   25   2   16   44   69   41   87   97   43   99   2   21   15

And so on. This will occur whenever you start a new game or reset the "RpgTsukuru" seed in that exact order when looking for numbers between 0 and 100. This is because the algorithm used to solve for the Random Number Seed will always yield those results adding a level of predictability.

  • NOTE* Keep in mind that when you are using the script call, the value you

will get will be a float (a decimal number between 0 and 1 like 0.123456789) and not a clean and clear integar like with the Plugin Commands. This is to replicate the "Math.random()" JavaScript function so all you have to do is simply replace "Math.random()" with "$rngSeed('RpgTsukuru')" to get the kind of randomized results you would with Math.random() except through a seed.

Now, the reason why we would have multiple seed keys is so that you can have repeatable results for things that are totally different from one another. For instance, "SafeCombination" will have a different door locked than "HideAndSeek" for different simulations. This allows you to do them in any order and have the safe combinations and hide and seek locations be the same per the simulation you are doing things in.

---

Daily Marker

For those who want certain puzzles to vary from day to day, but will always have the same starting pattern upon a reset, then apply the Daily Marker to the Random Number Seed either in the Plugin Command or script call. This will make it yield different results than from the non-version, so do NOT expect it to give the same number results.

The daily marker will change at 12:00am on the dot based on the player's PC's current time zone and time/date settings.

---

Save-Unique Marker

This plugin will drop a unique marker for each playthrough and that marker is the "Save-Unique" marker. It can be applied to a Random Number Seed to make it different from the pure seed and/or daily marker-applied seed. This way, the "RpgTsukuru" seed won't yield the same numbers as it did for a past playthrough.

Keep in mind that since this is per save/playthrough, that means any branching saves will retain the same marker and provide the same results through seeded random numbers.

  • NOTE* If this plugin is installed after multiple saves have been made, then

each of those saves will have their own "Save-Unique" marker regardless of their origins, shared or not. This is NOT a bug and it cannot be changed.

---

Potential Uses for Random Number Seeds

Here are some potential uses for Random Number Seeds:

  • Randomized puzzles: Puzzles can have different randomized starting points, and by seeding them, it prevents the player from abusing the reset function to get a favorable starting point.
  • Randomized cutscenes: Sometimes, you want certain event cutscenes to trigger randomly. This allows for that to happen without the player save scumming to get the desired cutscene. Instead, the player will have to make do with whatever cutscene they found.
  • Randomized gambling: Does your game have a casino? Do you want to make sure your player has to live with the conequences of the risks taken? By using a Random Number Seed, reloading a save is no longer possible to let them escape their fate from chance.
  • Randomized choices: If you're using the VisuStella MZ Message Core and using the <Shuffle> text code for choices, you can use this plugin's text codes to add in Random Number Seeds to allow for randomized choices, too. By using the Random Number Seed, reloading a save won't let the player get new choices with the shuffled choices.

---

Extra Features

There are some extra features found if other VisuStella MZ plugins are found present in the Plugin Manager list.

---

Battle Core VisuStella MZ

Those using VisuStella MZ's Battle Core can launch visualized Dice Roll Plugin Commands from this plugin during the middle of Action Sequences as long as there is not a conflicting effect during it.

Conflict effects include Active Chain Skills, Input Combo Skills, or Evolution Matrix Skills. Dice-related Plugin Commands will not run at all while these skill mechanics are active.

---

Items and Equips Core VisuStella MZ

During Dice Rolls, you can have certain Automatic Effects or Bonus Effects require the presence or usage of items, weapons, and/or armors. If those items have a <Color: x> notetag inside them, the VisuStella MZ Items & Equips Core will allow the color effect to go through. However, if the color notetag is <Color: #rrggbb>, extra help will be required from the VisuStella MZ Message Core for it to work.

---


Notetags

RPG Maker MZ's editor is unable to allow for custom traits/properties that a game dev may wish to associate with a database object, event, map, etc. Notetags are used to work around such limitations by allowing the game dev to tag certain traits/properties using specific Notetags declared by the related plugin.

Here is a list of Notetag(s) that you may use.


The following are notetags that have been added through this plugin. These notetags will not work with your game if this plugin is OFF or not present.

---

Action-Related Notetags

VisuMZ.144.jpg

---

<RNG Seed: x>
<Daily Seed: x>
<Unique Seed: x>
<Daily Unique Seed: x>

- Used for: Skill, Item Notetags
- Causes the skill or item to utilize Random Number Seeds to yield
  predictable outcomes for damage, hit rate, critical rate, etc.
- Replace 'x' with the "seed" you would like to use.
  - Replace 'x' with "auto" to automatically name the seed based on the
    skill/item's name.
  - Seed will be furthered modified by the plugin based on the user, the
    target, and the action used as to prevent RNG manipulation.
- "RNG Seed" variant is a generalized seed.
- "Daily Seed" variant will have results vary based on the day.
- "Unique Seed" variant will have results vary based on save marker.
- "Daily Unique Seed" variant will have results vary based on the day and
    and save marker.
- Only applies to the happenings of inside Game_Action.prototype.apply and
  Action Sequence - MECH: Action Effect.
  - For all other things, utilize the Plugin Commands for this plugin to
    grab RNG-generated values within variables and use that or use the
    script calls to access RNG-generated results.
- If this notetag is not used, default to the settings found in the Plugin
  Parameters for the default action Random Number Generator seed.

  Example:

    <Unique Seed: RpgTsukuru>

---

<No RNG Seed>

- Used for: Skill, Item Notetags
- Used to suppress the Plugin Parameter's default action Random Number
  Generator seed and to prevent this skill/item from using RNG seeds.

---


Text Codes

ShowTextWindowMZ.png

Text Codes are used in the Show Text event command. They are used to display things that text normally can't produce on its own, such as colors, get the name of a specific actor, change icons, and more.

RPG Maker MZ already comes with text codes of its own:

\V[n] Will be replaced with the value of the nth variable.
\N[n] Will be replaced with the name of the nth actor.
\P[n] Will be replaced by the name of the nth (arranged order) party member.
\G Will be replaced by the currency unit.
\C[n] Draw the subsequent text in the nth color. Text color conforms to the contents of the [Window.png] system image.
\I[n] Draws the nth icon.
\FS[n] Changes the text font size to 'n'.
\{ Increases the text by 1 step.
\} Decreases the text by 1 step.
\\ Replaced with the backslash character.
\$ Open the gold window.
\. Wait for 1/4 second.
\| Wait for 1 second.
\! Wait for button input.
\> Display remaining text on same line all at once.
\< Cancel the effect that displays text all at once.
\^ Do not wait for input after displaying the next.


The following are text codes that you may use with this plugin.

Type-Related Text Codes

VisuMZ.144.jpg

---

Text Code Effect (Show Choice Text Only)
<RNG Seed: x> Allows <Shuffle> text code to use seed 'x'.

Requires VisuMZ_1_MessageCore!

<Daily Seed: x> Allows <Shuffle> text code to use daily seed 'x'.

Requires VisuMZ_1_MessageCore!

<Unique Seed: x> Allows <Shuffle> text code to use save unique seed 'x'.

Requires VisuMZ_1_MessageCore!

<Daily Unique Seed: x> Allows <Shuffle> text code to use daily and save unique seed 'x'.

Requires VisuMZ_1_MessageCore!

Example:

  Show Choices:

    Choice A <Shuffle: 3>
    Choice B <Unique Seed: RpgTsukuru>
    Choice C
    Choice D
    Choice E
    Choice F

---


Plugin Commands

PluginCommandsMZ.png

Plugin Commands are event commands that are used to call upon functions added by a plugin that aren't inherently a part of RPG Maker MZ.

Here is a list of Plugin Command(s) that you may use:

---


The following are Plugin Commands that come with this plugin. They can be accessed through the Plugin Command event command.

---

Dice Plugin Commands

DiceRolls D20.gif

---

DiceRollsRngSeeds Command1.png

Dice: Roll Value
- Rolls a dice for any value and stores the result to a variable.

  Dice Sides:
  - How many sides does this dice have?

    Total Dice Rolls:
    - How many Dice Rolls do you want out of this?
    - You may use code.
    - Dice Rolls have a cap.

  Variable ID:
  - Insert the ID of the Variable to save the Dice Roll results to.
  - Use 0 to not use.
  - Results are after modifiers.

    Result Type:
    - What type of result do you want recorded to the variable?

  Title Text:
  - What is the title of this Dice Roll?
  - Text codes allowed.
  - Leave empty to not use.

  Appearance & Seed:
  - What are the dice appearance & seed settings used for this Dice Roll?

  Auto Dice Effects:
  - Adjust the modifier settings that automatically apply to the Dice Roll.

  Bonus Dice Effects:
  - Adjust the modifier settings are optionally applied to the Dice Roll
   selected by the player.

---

DiceRollsRngSeeds Command2.png

Dice: Target Value
- Rolls a dice for a target value and stores the result to a variable.

  Dice Sides:
  - How many sides does this dice have?

  Switch ID:
  - Insert the ID of the Switch to save the Dice Roll results to.
  - Use 0 to not use.

    Allow Natural Rolls?:
    - Allow natural rolls which bypass modifiers?
    - Natural 1 or Max = auto-fail or auto-success

    Result Type:
    - What type of result do you want recorded to the switch?

    Target Roll Value:
    - What should the target value be equal to?
    - You may use code.

    Variable ID:
    - Insert the ID of the Variable to save the Dice Roll value to.
    - Use 0 to not use.
    - Results are after modifiers.

  Title Text:
  - What is the title of this Dice Roll?
  - Text codes allowed. Leave empty to not use.

  Appearance & Seed:
  - What are the dice appearance & seed settings used for this Dice Roll?

  Auto Dice Effects:
  - Adjust the modifier settings that automatically apply to the Dice Roll.

  Bonus Dice Effects:
  - Adjust the modifier settings are optionally applied to the Dice Roll
   selected by the player.

---

DiceRollsRngSeeds Command2a.png

Dice Appearance & Seed Settings

  Appearance Overrides:

    D4 Image Filename(s):
    D6 Image Filename(s):
    D8 Image Filename(s):
    D10 Image Filename(s):
    D12 Image Filename(s):
    D20 Image Filename(s):
    - Use custom images for this dice?
    - Priority over colors.
    - Overrides default parameters.
    - Location: img/pictures/

    Dice Colors(s):
    - Use #rrggbb for custom colors or regular numbers for text colors from
      the Window Skin.
    - Overrides default parameters.

  Seed:
  - What is the Random Number Seed used for this Dice Roll?
  - Use numbers or text.
  - Use "none" to not use a seed.

    Daily Marker:
    - Apply daily marker to Random Number results?

    Save-Unique Marker:
    - Apply save-unique marker to Random Number results?

---

DiceRollsRngSeeds Command2b.png

Auto Dice Effects

  General Auto-Effects:
  - These auto-effects will be automatically activated as long its
    conditions are met at the start of the dice-roll.

  Variable Requirements:
  - These auto-effects require a variable(s) to be at least a certain value
    to automatically activate.

  Item Requirements:
  - These auto-effects require an item(s) to have a certain quantity to
    automatically activate.

  Weapon Requirements:
  - These auto-effects require a weapon(s) to be in party possession or is
    equipped to automatically activate.

  Armor Requirements:
  - These auto-effects require an armor(s) to be in party possession or is
    equipped to automatically activate.

  Skill Requirements:
  - These auto-effects require a skill(s) to be available within the party
    to automatically activate.

---

DiceRollsRngSeeds Command2d.png

Auto-Effects
- This section is a consolidation of the various Auto Dice Effects.

  Auto Effect Name:
  - What is the name of this effect?
  - Text codes allowed.

    Auto Effect Icon:
    - The icon used for this effect.

  Reference Data:

    Required Variable ID:
    - This variable is to be checked from.
    - Changes don't affect effect mid-roll.

      Required Value:
      - Variable requires at least this much in value.
      - You may use code.
      - Changes don't affect effect mid-roll.

    Required Item ID:
    - This is the item whose quantity is checked.
    - Changes don't affect effect mid-roll.

      Required Value:
      - Quantity requires at least this much in value.
      - You may use code.
      - Changes don't affect effect mid-roll.

    Required Weapon ID:
    - This is the weapon whose presence is checked.
    - Changes don't affect effect mid-roll.

      Include Equipped?:
      - Allow equipped weapons to be included in the count.

    Required Armor ID:
    - This is the armor whose presence is checked.
    - Changes don't affect effect mid-roll.

      Include Equipped?:
      - Allow equipped armors to be included in the count.

    Required Skill ID:
    - This is the skill whose presence is checked.
    - Changes don't affect effect mid-roll.

      Skill Learned Only?:
      - Require the skill to be learned only or allow temporary skills?

      Skill User(s):
      - Select which actor(s) to check for the required skill.
        - Party Leader
        - Any Party Member
        - Every Party Member
        - Any Battle Member
        - Every Battle Member
        - Any Specific Actor(s)
        - Every Specific Actor(s)

      Specific Actor ID(s):
      - Determine which "Specific Actor(s)" to pick from.
      - Specific actor(s) must be in the party, main or reserve.

      Show User Name?:
      - Shows the skill user's name next to the skill name?

      Require User Alive?:
      - Requires the skill user to be alive?
      - Or can they be dead or alive?

  Dice Effects:

    Count/Advantage:
    - Change dice count (roll value) or advantage/disadvantage
      (target value).
    - You may use code.

    Rank/Type:
    - Raises/lowers dice rank: D4, D6, D8, D10, D12, D20.
    - You may use code.
    - Higher rank = more sides.

    Modifier (Static):
    - Alters the finalized rolled dice value.
    - You may use code.

    Modifier (Random):
    - Adds a random element to the dice value.
    - You may use code.

  Additional Text:

    Pre-Effect Text:
    - What text is added before the dice effects text?
    - Text codes allowed.

    Post-Effect Text:
    - What text is added after the dice effects text?
    - Text codes allowed.

  Effect Conditions:

    Switch ID:
    - This Switch is required to be ON to meet conditions.
    - Use 0 to not use.
    - Does not reveal mid-Dice Roll.

    JS: Condition:
    - JavaScript code used to determine the conditions for this dice effect
      to be automatically activated.
    - Does not reveal mid-Dice Roll.

---

DiceRollsRngSeeds Command2c.png

Bonus Dice Effects

  General Bonus Effects:
  - Add general bonus dice effects here that the player can select to use
    the effect.

  Variable Cost Effects:
  - Variable Bonus Effects require deducting from variable(s) as a cost to
    use the effect.

  Item Cost Effects:
  - Item Bonus Effects require consuming the target item(s) as a cost to use
    the effect.

  Weapon Cost Effects:
  - Weapon Bonus Effects require consuming the target weapon(s) as a cost to
    use the effect.

  Armor Cost Effects:
  - Armor Bonus Effects require consuming target the armor(s) as a cost to
    use the effect.

  Skill Cost Effects:
  - Skill Bonus Effects require paying skill costs to activate and use the
    effect.

---

DiceRollsRngSeeds Command2d.png

Bonus Effects
- This section is a consolidation of the various Bonus Dice Effects.

  Bonus Effect Name:
  - What is the name of this effect?
  - Text codes allowed.

    Bonus Effect Icon:
    - The icon used for this effect.

    Animation ID:
    - Play this animation when the effect activates.
    - Animation will play on the player character.

  Effect Costs:

    Variable Cost ID:
    - This variable is to be deducted from.
    - Changes do not reveal effect mid-Dice Roll.

      Cost Value:
      - Deduct this much from the target variable.
      - You may use code.

      Show Variable Cost?:
      - Show variable cost?

    Item Cost ID:
    - This item is to be deducted from.
    - Changes do not reveal effect mid-Dice Roll.

      Cost Value:
      - Deduct this much from the target item.
      - You may use code.

      Show Item Cost?:
      - Show item cost?

    Weapon Cost ID:
    - This weapon is to be deducted from.
    - Changes do not reveal effect mid-Dice Roll.

      Cost Value:
      - Deduct this much from the target weapon.
      - You may use code.

      Show Weapon Cost?:
      - Show weapon cost?

    Armor Cost ID:
    - This armor is to be deducted from.
    - Changes do not reveal effect mid-Dice Roll.

      Cost Value:
      - Deduct this much from the target armor.
      - You may use code.

      Show Armor Cost?:
      - Show armor cost?

    Skill Cost ID:
    - This skill's cost is to be paid by an actor.
    - Changes do not reveal effect mid-Dice Roll.

      Skill Learned Only?:
      - Require the skill to be learned only or allow temporary skills?

      Skill User(s):
      - Select which actor(s) to check for the required skill.
        - Party Leader
        - Any Party Member
        - Every Party Member
        - Any Battle Member
        - Every Battle Member
        - Any Specific Actor(s)
        - Every Specific Actor(s)

      Specific Actor ID(s):
      - Determine which "Specific Actor(s)" to pick from.
      - Specific actor(s) must be in the party, main or reserve.

      Show User Name?:
      - Shows the skill user's name next to the skill name?

      Require User Alive?:
      - Requires the skill user to be alive? Or can they be dead or alive?

      Show Skill Cost?:
      - Show skill cost?

    Maximum Uses:
    - How many times can this effect be used?
    - You may use code.
    - Over 1000000 for unlimited.

      Show Uses Left?:
      - Show how many uses are left?

  Dice Effects:

    Count/Advantage:
    - Change dice count (roll value) or advantage/disadvantage
      (target value).
    - You may use code.

    Rank/Type:
    - Raises/lowers dice rank: D4, D6, D8, D10, D12, D20.
    - You may use code.
    - Higher rank = more sides.

    Modifier (Static):
    - Alters the finalized rolled dice value.
    - You may use code.

    Modifier (Random):
    - Adds a random element to the dice value.
    - You may use code.

  Additional Text:

    Pre-Cost Text:
    - What text is added before the dice cost text?
    - Text codes allowed.

    Post-Cost Text:
    - What text is added after the dice cost text?
    - Text codes allowed.

    Pre-Effect Text:
    - What text is added before the dice effects text?
    - Text codes allowed.

    Post-Effect Text:
    - What text is added after the dice effects text?
    - Text codes allowed.

  Effect Conditions:

    Show Switch ID:
    - This Switch is required to be ON to show effect.
    - Use 0 to not use.
    - Does not reveal mid-Dice Roll.

    Enable Switch ID:
    - This Switch is required to be ON to enable effect.
    - Use 0 to not use.

    JS: Show:
    - JavaScript code used to determine show conditions for this dice
      effect to become available for use.
    - Does not reveal mid-Dice Roll.

    JS: Enable:
    - JavaScript code used to determine enable conditions for this dice
      effect to become usable.

    JS: On Select:
    - JavaScript code used to determine what happens when this dice effect
      is selected and activated.

---

RNG Plugin Commands

VisuMZ.144.jpg

---

DiceRollsRngSeeds Command3.png

RNG: Random Number Between X and Y
- Uses a seed to determine a random number between X and Y.

  Variable ID:
  - Insert the ID of the Variable to save this value to.

  Minimum:
  - Minimum value the random number can be.
  - You may use JavaScript code.

  Maximum:
  - Maximum value the random number can be.
  - You may use JavaScript code.

  Seed:
  - What is the Random Number Seed?
  - Use numbers or text.

  Daily Marker:
  - Apply daily marker to Random Number results?

  Save-Unique Marker:
  - Apply save-unique marker to Random Number results?

---

DiceRollsRngSeeds Command4.png

RNG: Reset Random Seed
- Resets the random state for the target Random Number Seed.

  Seed:
  - What is the Random Number Seed?
  - Use numbers or text.

  Daily Marker:
  - Apply daily marker to Random Number Seed?

  Save-Unique Marker:
  - Apply save-unique marker to Random Number Seed?

---

Script Calls

The following are Script Calls that can be used with this plugin. These are made for JavaScript proficient users. We are not responsible if you use them incorrectly or for unintended usage.

---

Dice Roll-Related Script Calls

DiceRolls Modifier.gif

---

$addDiceCount(value)

- Adds 'value' to the current Dice Count.
- Use with "Dice: Roll Value". Adds 'value' to current dice count.
- Best used with the "JS: On Select" parameter found within the bonus
  effects you can add to a Dice Roll Plugin Command.

---

$addDiceAdvantage(value)
$addDiceDisadvantage(value)

- Adds 'value' to the current Dice Advantage/Disadvantage.
- Use with "Dice: Target Value". Adds 'value' to dice advantage or
  disadvantage. Advantages and disadvantages offset each other.
- Best used with the "JS: On Select" parameter found within the bonus
  effects you can add to a Dice Roll Plugin Command.

---

$addDiceRank(value)

- Adds 'value' to the current Dice Rank.
- Ranks range from 1 to 6.
  - Rank 1 - D4
  - Rank 2 - D6
  - Rank 3 - D8
  - Rank 4 - D10
  - Rank 5 - D12
  - Rank 6 - D20
- Best used with the "JS: On Select" parameter found within the bonus
  effects you can add to a Dice Roll Plugin Command.

---

$addDiceModifier(value)
$addDiceModRand(value)

- Adds 'value' to the current Dice Modifier or the potential Dice Modifier
  Random Range.
- Best used with the "JS: On Select" parameter found within the bonus
  effects you can add to a Dice Roll Plugin Command.

---

Random Seed-Related Script Calls

VisuMZ.144.jpg

---

$rngSeed(seed)
$dailyRngSeed(seed)
$uniqueRngSeed(seed)
$dailyUniqueRngSeed(seed)

- Returns a float (a decimal number between 0 and 1) randomized from 'seed'.
- Replace 'seed' with a number or string representing the seed you wish to
  use to retrieve random numbers from.
- This will bump up the seed state to the next random number.
- Use the 'daily' variant for a customized seed based on the current date.
- Use the 'unique' variant for a customized seed based on the current save
  that will differ from other saves.

- Examples:

  - $rngSeed(12345)
  - $rngSeed("Don Miguel")

  - $dailyRngSeed(67890)
  - $dailyRngSeed("Yoji Ojima")

  - $uniqueRngSeed(246810)
  - $uniqueRngSeed("VisuStella")

---

$resetRngSeed(seed)
$resetDailyRngSeed(seed)
$resetUniqueRngSeed(seed)
$resetDailyUniqueRngSeed(seed)

- Resets the seed state for random number generator 'seed' set.
- Replace 'seed' with a number or string representing the seed you wish to
  reset the seed state for.
- Use the 'daily' variant to reset the customized seed based on the current
  date.
- Use the 'unique' variant to reset the customized seed based on the current
  save that differs from other saves.

- Examples:

  - $resetRngSeed(12345)
  - $resetRngSeed("Don Miguel")

  - $resetDailyRngSeed(67890)
  - $resetDailyRngSeed("Yoji Ojima")

  - $resetUniqueRngSeed(246810)
  - $resetUniqueRngSeed("VisuStella")

---

Plugin Parameters

Dice Roll Settings

DiceRolls DiceCount.gif

DiceRollsRngSeeds Param1.png

Adjust the Dice Roll settings to fit your game. These range from mechanics to how the many-sided dice appear in-game and how the rolling animation will play out.

If you do not use images for the various sided-dice, do not worry. This plugin will use pre-rendered graphics to generate them for usage.

---

Mechanics:

 Max Dice Count:
 - What is the maximum number of dice that can be thrown at a time?

---

DiceRollsRngSeeds Param1a.png

Dice Appearances:

 D4 Appearance:
 D6 Appearance:
 D8 Appearance:
 D10 Appearance:
 D12 Appearance:
 D20 Appearance:
 - Adjust the Dice Appearance settings for the dice here.
   Image Filename(s):
   - Use custom images for this dice?
   - Priority over colors.
   - Location: img/pictures/
   Dice Colors(s):
   - Use #rrggbb for custom colors or regular numbers for text colors from
     the Window Skin.
   Number Settings:
     Font Size:
     - Font size used for dice number.
     Number Outline:
     - What width to use for number outline?
     - Use 0 to not use an outline.
     Offset X:
     - Offsets the number x position.
     - Negative: left. Positive: right.
     Offset Y:
     - Offsets the number y position.
     - Negative: up. Positive: down.
   Position Settings:
     Offset X:
     - Offsets the sprite x position.
     - Negative: left. Positive: right.
     Offset Y:
     - Offsets the sprite y position.
     - Negative: up. Positive: down.

---

Color Ratios

 Border Ratio:
 - Used for generated colors.
 - Darkness ratio for border color.
 Color 1 Ratio:
 - Used for generated colors.
 - Darkness ratio for darker color.
 Color 2 Ratio:
 - Used for generated colors.
 - Darkness ratio for middle color.
 Color 3 Ratio:
 - Used for generated colors.
 - Darkness ratio for main color.

---

Arrange Offset:

 Offset X:
 - Offsets the dice arrangement x position.
 - Negative: left. Positive: right.
 Offset Y:
 - Offsets the dice arrangement y position.
 - Negative: up. Positive: down.

---

Fade Settings:

 Fade In Duration:
 - How many frames it takes to fade in dice?
 - 60 frames = 1 second.
 Fade Out Duration:
 - How many frames it takes to fade out dice?
 - 60 frames = 1 second.
 Finalize Delay:
 - How many frames to wait before fading out?
 - 60 frames = 1 second.

---

Rolling Effect:

 Dice Roll Duration:
 - How many frames it takes to roll a dice?
 - 60 frames = 1 second.
 Between Roll Delay:
 - How many frames between multiple dice rolls?
 - 60 frames = 1 second.
 Dice Roll Height:
 - How high should the dice jump up for its roll in pixels?
 Dice Rotate Speed:
 - How many degrees does the dice rotate per frame while rolling?

---

Movement Settings:

 Move Duration:
 - How many frames it takes to move dice?
 - 60 frames = 1 second.
 Scaling Duration:
 - How many frames it takes to change dice scale?
 - 60 frames = 1 second.
 Number Climb Tick:
 - How many frames are there between number ticks?
 - 60 frames = 1 second.
 Max Number Duration:
 - Max number of frames to process number ticks?
 - 60 frames = 1 second.
 Number Color Shift:
 - Allow dice number colors to change due to modifiers?
 Pre-Modifier Delay:
 - Delay frames before applying modifiers?
 -60 frames = 1 second.

---


Random Seed Settings

VisuMZ.144.jpg

DiceRollsRngSeeds Param2.png

Random Number Seeds are generated using the linear congruential generator (LCG) algorithm to yield a sequence of pseudo-randomized numbers calculated with a nearly predictable but non-repeating piecewise linear equation.

More information regarding the algorithm can be found here: https://en.wikipedia.org/wiki/Linear_congruential_generator

---

Linear Congruential Generator

 Modulus:
 - The linear congruential generator modulus.
 - Do not change unless you know what you're doing.
 Multiplier:
 - The linear congruential generator multiplier.
 - Do not change unless you know what you're doing.
 Increment:
 - The linear congruential generator increment.
 - Do not change unless you know what you're doing.

---

Action Defaults

 Default RNG Seed?
 - Default seed used for actions.
 - Use 'auto' to automatically create the seed based off the item or
   skill's database name.
 - Leave empty or 'none' to not use.

---


Sound Settings

DiceRolls Ranks.gif

DiceRollsRngSeeds Param3.png

These settings let you adjust the sound effects used for this plugin.

---

Sound Types

 Dice Throw Sound:
 Increment Tick Sound:
 Bonus Use Sound:
 Roll Success Sound:
 Roll Failure Sound:
 Critical Failure Sound:
 Critical Success Sound:
   Filename:
   - Filename of the sound effect played.
   Volume:
   - Volume of the sound effect played.
   Pitch:
   - Pitch of the sound effect played.
   Pan:
   - Pan of the sound effect played.

---


Vocabulary Settings

DiceRolls Modifier.gif

DiceRollsRngSeeds Param4.png

These settings let you adjust the text displayed for this plugin.

---

Command Window:

 Roll Command:
 - Text used for the Roll Dice command.
 - Text codes allowed.
 Effects Command:
 - Text used for the View Effects command.
 - Text codes allowed.
 Bonus Command:
 - Text used for the Add Bonus command.
 -Text codes allowed.

---

Text Colors:

 Dice Count Up:
 Dice Count Down:
 Dice Rank Up:
 Dice Rank Down:
 Roll Modifier Up:
 Roll Modifier Down:
 - Text color used for this effect type.
 - Insert number for text colors from the Window Skin.

---

Data Window Labels:

 Dice Count:
 Advantage:
 Disadvantage:
 Dice Rank:
 Modifiers:
 - Text used to display this data label.
 - Text codes allowed.

---

Data Window Ranks:

 Rank 1: D4:
 Rank 2: D6:
 Rank 3: D8:
 Rank 4: D10:
 Rank 5: D12:
 Rank 6: D20:
 - Text used to display this dice rank.
 - Text codes allowed.

---

Dice Effects:

 Dice Display Format:
 - How the overall dice effect is displayed.
 - %1 - Effect
 Pre/Post-Effect:
 - How pre/post effect is displayed.
 - %1 - Prev; %2 - Post
 Order Format:
 - Order format used for dice effects.
 - %1 - Count; %2 - Rank; %3 - Modifier
 Positive Plus Sign?:
 - Show + sign for positive numbers?
 Dice Count Format:
 - Text format used for Dice Count effect.
 - %1 - Effect Number
 Advantage Format:
 - Text format used for Advantage effect.
 - %1 - Effect Number
 Disadvantage Format:
 - Text format used for Disdvantage effect.
 - %1 - Effect Number
 Dice Rank Format:
 - Text format used for Dice Rank effect.
 - %1 - Effect Number
 Roll Modifier Format:
 - Text format used for Roll Modifier effect.
 - %1 - Effect Number

---

Effect Costs:

 Cost Display Format:
 - How the overall cost is displayed.
 - %1 - Cost Text
 Pre/Post-Cost:
 - How pre/post cost text is displayed.
 - %1 - Prev; %2 - Post
 Used Up:
 - How a cost is displayed when its uses are spent.
 - Text codes allowed.
 Use Times Format:
 - How use times are formated.
 - %1 - Current; %2 - Max Uses; %3 - Remaining
   Show Max Use of 1?:
   - Show the use cost when there's only 1 max use?
   Unlimited Uses:
   - Text used to indicate unlimited usage.
   - Text codes allowed.
 Variable Cost Format:
 - How variable cost is displayed.
 - %1 - Cost; %2 - Quantity
 Item Cost Format:
 - How item cost is displayed.
 - %1 - Cost; %2 - Quantity
 Weapon Cost Format:
 - How weapon cost is displayed.
 - %1 - Cost; %2 - Quantity
 Variable Cost Format:
 - How variable cost is displayed.
 - %1 - Cost; %2 - Quantity
 Skill User's Name:
 - How the skill user's name is displayed.
 - %1 - Name
   User to Cost Format:
   - How the skill user's name is displayed to cost.
   - %1 - Name; %2 - Skill Cost

---

Subtitle Window:

 Roll for Total:
 - Subtitle text for a roll total.
 Roll for Highest:
 - Subtitle text to roll for highest.
 Roll for Average:
 - Subtitle text to roll for average.
 Roll for Lowest:
 - Subtitle text to roll for lowest.
 Roll: > Target:
 - Subtitle text to roll for above target.
 - %1 - Target Roll
 Roll: >= Target:
 - Subtitle text to roll for above/equal target.
 - %1 - Target Roll
 Roll: <= Target:
 - Subtitle text to roll for below/equal target.
 - %1 - Target Roll
 Roll: < Target:
 - Subtitle text to roll for below target.
 - %1 - Target Roll
 Critical Success:
 - Subtitle text for a Critical Success on a Natural Roll.
 Critical Failure:
 - Subtitle text for a Critical Failure on a Natural Roll.

---


Window Settings

DiceRolls Advantage.gif

DiceRollsRngSeeds Param5.png

These settings let you adjust the windows displayed for this plugin.

---

Sprite Container:

 JS: X, Y, W, H:
 - Code used to determine the dimensions for this window.

---

Title Window:

 Background Type:
 - Select background type for this window.
 JS: X, Y, W, H:
 - Code used to determine the dimensions for this window.

---

Subtitle Window:

 Background Type:
 - Select background type for this window.
 JS: X, Y, W, H:
 - Code used to determine the dimensions for this window.

---

Data Windows:

 Dice Count: BG Type:
 - Select background type for this window.
   JS: X, Y, W, H:
   - Code used to determine the dimensions for this window.
 Dice Rank: BG Type:
 - Select background type for this window.
   JS: X, Y, W, H:
   - Code used to determine the dimensions for this window.
 Modifier: BG Type:
 - Select background type for this window.
   JS: X, Y, W, H:
   - Code used to determine the dimensions for this window.

---

Command Window:

 Background Type:
 - Select background type for this window.
 Show "View Effects"?:
 - Show "View Effects" command?
 Show "Add Bonus"?:
 - Show "Add Bonus" command?
 Text Align:
 - Text alignment for this window?
 JS: X, Y, W, H:
 - Code used to determine the dimensions for this window.

---

List Windows:

 Effect List: BG Type:
 - Select background type for this window.
 Bonus List: BG Type:
 - Select background type for this window.
 Window Columns:
 - How many columns are used for these windows?
 Column Spacing:
 - How much spacing is there between columns?
 JS: X, Y, W, H:
 - Code used to determine the dimensions for this window.

---



Terms of Use

1. These plugins may be used in free or commercial games provided that they have been acquired through legitimate means at VisuStella.com and/or any other official approved VisuStella sources. Exceptions and special circumstances that may prohibit usage will be listed on VisuStella.com.

2. All of the listed coders found in the Credits section of this plugin must be given credit in your games or credited as a collective under the name: "VisuStella".

3. You may edit the source code to suit your needs, so long as you do not claim the source code belongs to you. VisuStella also does not take responsibility for the plugin if any changes have been made to the plugin's code, nor does VisuStella take responsibility for user-provided custom code used for custom control effects including advanced JavaScript notetags and/or plugin parameters that allow custom JavaScript code.

4. You may NOT redistribute these plugins nor take code from this plugin to use as your own. These plugins and their code are only to be downloaded from VisuStella.com and other official/approved VisuStella sources. A list of official/approved sources can also be found on VisuStella.com.

5. VisuStella is not responsible for problems found in your game due to unintended usage, incompatibility problems with plugins outside of the VisuStella MZ library, plugin versions that aren't up to date, nor responsible for the proper working of compatibility patches made by any third parties. VisuStella is not responsible for errors caused by any user-provided custom code used for custom control effects including advanced JavaScript notetags and/or plugin parameters that allow JavaScript code.

6. If a compatibility patch needs to be made through a third party that is unaffiliated with VisuStella that involves using code from the VisuStella MZ library, contact must be made with a member from VisuStella and have it approved. The patch would be placed on VisuStella.com as a free download to the public. Such patches cannot be sold for monetary gain, including commissions, crowdfunding, and/or donations.

7. If this VisuStella MZ plugin is a paid product, all project team members must purchase their own individual copies of the paid product if they are to use it. Usage includes working on related game mechanics, managing related code, and/or using related Plugin Commands and features. Redistribution of the plugin and/or its code to other members of the team is NOT allowed unless they own the plugin itself as that conflicts with Article 4.

8. Any extensions and/or addendums made to this plugin's Terms of Use can be found on VisuStella.com and must be followed.

Terms of Use: Japanese


『VisuStella MZ』利用規約

1. これらのプラグインは、VisuStella.comおよび/または公式に承認されたVisuStellaのソースから合法的な手段で入手したものである限り、フリーゲームや商用ゲームに使用することができます。例外的に使用が禁止される場合については、VisuStella.comの記載をご確認ください。

2. 本プラグインの「クレジット」部分に記載されているすべてのコーダーの名前は、ゲーム内にクレジット表記を行うか、もしくは「VisuStella」という名前の下にまとめて表記する必要があります。

3. ソースコードを自分のものだと主張しない限りは、必要に応じて編集することが可能です。ただしプラグインのコードに変更が加えられた場合、VisuStellaはそのプラグインに対して一切の責任を負いません。高度なJavaScriptのノートタグやJavaScriptコードを許可するプラグインのパラメータを含む、カスタムコントロールエフェクトに使用される、ユーザー提供のカスタムコードについても、VisuStellaは一切の責任を負いません。

4. これらのプラグインやプラグイン内のコードを、「自分のもの」として再配布したり使用したりすることはできません。これらのプラグインとそのコードは、VisuStella.comおよび、その他の公式/承認済みVisuStellaソースからのみダウンロードすることができます。公式/承認済みのソースのリストは、VisuStella.comでご確認いただけます。

5. VisuStellaは、意図しない使用方法による問題、VisuStella MZライブラリ以外のプラグインとの非互換性の問題、プラグインのバージョンが最新でないことによる問題、第三者による互換性パッチが適切に動作していないことなどが原因でゲーム内で発生した問題については、一切の責任を負いません。VisuStellaは、高度なJavaScriptのノートタグやJavaScriptコードを許可するプラグインのパラメータを含む、カスタムコントロールエフェクトに使用される、ユーザー提供のカスタムコードに起因するエラーについても、一切の責任を負いません。

6. VisuStella MZライブラリのコードを使用した互換性パッチをVisuStellaとは関係のない第三者を通じて作成する必要がある場合は、まずVisuStellaのメンバーと連絡を取り、承認を得る必要があります。パッチはVisuStella.comに公開され、誰でも無料でダウンロードすることができるようになります。このようなパッチを、制作発注やクラウドファンディングの対象にしたり、寄付などの金銭的な利益を得るために販売することはできません。

7. このVisuStella MZプラグインが商用製品である場合、プロジェクトチームのすべてのメンバーは、それを使用するため、それぞれ製品を購入しなければなりません。使用方法には、関連するゲームメカニクスの作業、関連するコードの管理、および/または関連するプラグインコマンドや機能の使用、が含まれます。プラグインそのものやそのコードをチームの他のメンバーに再配布することは第4項に抵触するため、そのメンバーがプラグインそのものを所有していない限りは許可されません。

8. このプラグインの利用規約の追加項目や補足については、VisuStella.comに掲載されていますので、それを参照し従ってください。

Credits

If you are using this plugin, credit the following people in your game:

Team VisuStella

Creazilla Open-Source

  • Many of the canvas drawings are made by various artists under Creazilla.
  • These are under the Creazilla Open-Source License.
  • They are free for personal and commercial use. No attribution required.


Changelog

Version 1.00 Official Release Date: January 26, 2024

  • Finished Plugin!


See Also


End of Helpfile