POG_ProhibitedEncounters: Disable / Enable encounters and modify the frequency with which they occur


​
License: Free for personal or commercial use.


Context: The player enters the battle after moving a number of steps on the game map. Although quite functional, this is a static and uninteresting model of forcing the player to fight.


Description: This script allows you to add a little unpredictability to determine when the player will or will not enter a battle. At the same time, it gives the player the possibility to act strategically to enter or avoid the fight. it also allows the developer to temporarily turn off combat and reactivate it whenever he wishes.


Script configuration: you will need to determine the number of database changes that will indicate whether battle encounters are enabled or disabled.
Spoiler: image
proibido1.jpg
​
To activate or deactivate meetings, use the plugin command: ON / OFF encounters.


Steps to determine the encounters.

An encounter is the moment when the player is taken into battle against a creature on another screen (battle screen). The encounter takes place after the player moves around the map a predetermined number of steps. This number of steps is determined in the map settings:
Spoiler: image
proibido2.jpg

In the example above, the encounter will take place from the moment the player moves 10 times on the map.​
​
Modifying the moments of encounter

This script allows the encounter to have a chance to happen after the player takes the number of steps determined in the map settings. This means that after traveling 10 times (for example) the event will not necessarily happen, instead it may or may not occur according to a percentage value.

For example: There is an 80% chance that the player will engage in combat after moving 10 steps. After the player moves 10 times, a function generates a random value (as if it were a roll of a dice with 100 faces) and compares it with the player's chance to enter combat. If the randomly generated value is less than or equal to the player's chance of entering combat, the encounter takes place. However, if the randomly generated value is greater than the player's chance to enter combat, the encounter does not take place. When the encounter does not take place, the number of steps for a new encounters reset.


Chance of a character entering combat

Each character in the database has a chance to engage in combat or not. By default, this chance is 100%, that is, he will always go into combat according to the normal settings of the RPG MAKER MZ.

The developer can change the chance of a character entering combat with the tag:

<rateEncounter:percent>​

  • percent is the percentage value (from 0 to 100) that expresses the character's chance to enter combat. Example:

Spoiler: image
proibido3.jpg


Chance of player entering combat

The percentage value that determines the player's chance to enter combat or not is equivalent to the simple average of the chances of the characters that are part of the group. This means that all the characters that make up the group influence the chance of the encounter happening or not.
Spoiler: image
proibido4b.jpg

proibido4c.jpg



proibido4d.jpg


Modifying a character's chance to meet

(1) It is possible to modify a character's chance of encounter. To do this, use the Increase / Decrease Rate plugin commands.
Spoiler: image
proibido5.jpg
(2) Another way to modify a character's chance of meeting is through a status. In this case, it is necessary to set the status to call a common event which in turn calls the plugin command:
Spoiler: image
proibido6.jpg

(3) It is still possible to have an item consumed to increase or decrease a character's chance of encounter.

Spoiler: image
proibido7.jpg


Other plugin commands

% actor into battle :
assigns a character's chance of finding a database variable.


% party into battle: assigns the chance of encounter the group of characters to a variable in the database.



Extra Content:

One of the things that has always bothered me about RPG MAKER is that the player can avoid going into combat simply by standing in the same place. Since combats are only activated after the player moves a certain number of times, standing still is a strategy that never made much sense in my opinion.

To prevent this from happening, the POG_ProhibitedEncounters script has a function that makes the encounter can be activated after a certain time. This means that even if the player remains still, after a certain period of time he will still be at risk of going into battle.


Plugin configuration:

In the plugin settings, set the time (in seconds) that "equals" a player's movement. Thus, even if the player remains stationary every time that this period of time has passed, the RPG MAKER will reduce by 1 the necessary number of steps for the player to have an encounter.
Spoiler: image
proibido8.jpg


The plugin command: change time allows you to change the encounter time:

Spoiler: image
proibido9.jpg




Finally, it is possible to activate or deactivate the meeting time using the plugin command:

Spoiler: image
proibido10.jpg


​
​
When the encounter does not take place, the number of steps for a new encounters reset.
Do the first 10 steps, 80% of triggering, if not, you're allowed to make other 10 steps freely.

If you'll accept a suggestion, you should add another parameter.
To make that each step after the "10th" increase the percentage by 1% instead of resetting (let's call it "grow percentage" opposed to "resetting percentage").
That way the 10th step I have 80%, the 11th 81% and so on until the encounter trigger.
With large steps rate your math could mean I have a chance to meet no one for very large periods, multiples of the default "steps" entry. Think something like 20/50%. Sound fine, but there's the real chance I'll meet no one for 200 steps.
Do the first 10 steps, 80% of triggering, if not, you're allowed to make other 10 steps freely.

If you'll accept a suggestion, you should add another parameter.
To make that each step after the "10th" increase the percentage by 1% instead of resetting (let's call it "grow percentage" opposed to "resetting percentage").
That way the 10th step I have 80%, the 11th 81% and so on until the encounter trigger.
With large steps rate your math could mean I have a chance to meet no one for very large periods, multiples of the default "steps" entry. Think something like 20/50%. Sound fine, but there's the real chance I'll meet no one for 200 steps.

Your idea is very good! With this idea, the probability of an encounter happening increases progressively! I tested something like this at the beginning of this project, but it didn't make much difference because I used a low number of steps (10 steps). I will think about how to implement this idea. She is very good! Thanks for the feedback.
Thank you indeed for such usefull plugin, the time based rate is very smart!

Original thread: https://forums.rpgmakerweb.com/threads/pog_prohibitedencounters-disable-enable-encounters-and-modify-the-frequency-with-which-they-occur.128666/