Encounter Effects 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


EncounterEffects Chase.gif

EncounterEffects FoV.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

Both random encounters and on-screen encounters are pretty limited in what they're able to do in RPG Maker MZ. This plugin expands their functionality with some unique effects added through this plugin.

Both types of encounters can benefit from having more control over the occurrence of Preemptive and Surprise Attacks. These can be enforced through Plugin Commands and set up in a queue.

On-screen encounters can utilize alert functions that will cause events to chase the player (or flee from them) once the player steps within their visible detection range.

On-screen encounters can also utilize new functions added for use with the Conditional Branch to determine which direction the player has approached the on-screen encounter event from.

Random encounters can utilize repel and lure effects to nullify any random encounters for a certain amount of steps or to increase their rate of occurrence.

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

  • Take control of battle advantage. Enforce preemptive attacks, surprise attacks, neither, or chance it.
  • Battle advantages can be set up in a queue for more interesting gameplay.
  • Events can be given alert functionality to chase the player if the player steps within their vision range.
  • Use Terrain Tags and Regions to set up tiles that will block detection range through line of sight usage.
  • Events can trigger themselves upon touching followers instead of just players.
  • Events can lock themselves in the direction they're facing when interacted with to make it easier to apply side attack and back attack effects.
  • Random encounters can be bypassed through repel effects.
  • Increase the rate of random encounters with lure effects.

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.


Major Changes

This plugin adds some new hard-coded features to RPG Maker MZ's functions. The following is a list of them.

---

Battle Advantage

EncounterEffects Preemptive.png

EncounterEffects Surprise.png

Upon starting a battle with forced advantages, any calculations made by other means will be overwritten in favor of the declared forced advantage.

---

Game_Player.encounterProgressValue

This function has been overwritten to allow for more flexibility over the multipliers and effects applied through various effects and to allow for the repel and lure effects to work as best as they can.

---

Game_Event.updateSelfMovement

This function's original code will be ignored when the event is set to chase or flee from the player after being alerted. After the alert and return periods are over, self movement will resume as normal.

---

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.

---

Battle Advantage-Related Tags

EncounterEffects Preemptive.png

---

<Preemptive>

- Used for: Troop Name Tag
- Any troop with this tag in its name will have the battle start off with
  the preemptive advantage (in favor of the player party).

---

EncounterEffects Surprise.png

<Surprise>

- Used for: Troop Name Tag
- Any troop with this tag in its name will have the battle start off with
  the surprise advantage (in favor of the enemy party).

---

<No Advantage>

- Used for: Troop Name Tag
- Any troop with this tag in its name will have the battle start off with
  no advantage at all.

---

<Chance>

- Used for: Troop Name Tag
- Any troop with this tag in its name will have the battle start off with
  a chance for preemptive, surprise, or no advantages (calculated normally).

---

Event Encounter-Related Notetags

EncounterEffects EncounterLock.png

---

<Follower Trigger>

- Used for: Event Notetags and Event Page Comment Tags
- This event can trigger by touching a follower instead of only the player.

---

<Encounter Direction Lock>

- Used for: Event Notetags and Event Page Comment Tags
- Normally when an event triggers without Direction Fix, it will face the
  player character. This tag prevents the event from facing the player, but
  still allows the event to freely turn directions.
- This is best used in conjunction with the Conditional Branch scripts.

---

Alert-Related Notetags

EncounterEffects Chase.gif

---

<Alert>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- This will use the default settings unless changed by other tags.

---

EncounterEffects FoV.gif

<Alert Range: x>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Changes the event's alert detection range to 'x' tiles.
- Replace 'x' with a number value representing the number of tiles to use
  for its detection range.

---

<Alert Dash>
<Alert Walk>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- If alerted, the event will dash/walk instead of whatever is set as a
  default setting within the Plugin Parameters.

---

<Alert Time: x>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- This determines the amount of time in frames for the event to chase the
  player continuously while the player is outside of the detection range.
- Replace 'x' with a number value representing the number of frames for the
  event to keep chasing the player with.
- If the player steps back into the alert detection range, the timer will be
  reset.

---

<Alert FoV Angle: x>

- Used for: Event Notetags and Event Page Comment Tags
- Changes the Field of View angle to 'x' for the event.
- Replace 'x' with a number value representing the degrees of for the field
  of view angle used by the event to detect players.
- The angle will always be centered to the event's line of sight.

---

<Alert Show FoV>
<Alert Hide FoV>

- Used for: Event Notetags and Event Page Comment Tags
- Shows/hides the field of view for the event.
- If an event's field of view is hidden, it can still chase players when
  entering the event's range.

---

EncounterEffects Chase.gif

<Alert Response: chase>
<Alert Response: rush>
<Alert Response: flee>
<Alert Response: random>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- This determines how an alerted event will react.
- Chase: Use path finding to find a route to the player
- Rush: Rush directly at the player
- Flee: Run away from the player
- Random: Move in random directions

---

<Response Balloon: name>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Determines the balloon displayed when initially alerted and responding.
- Replace 'name' with any of the following:
  - None
  - Exclamation
  - Question
  - Music Note
  - Heart
  - Angle
  - Sweat
  - Frustration
  - Silence
  - Light Bulb
  - Zzz
  - User-defined 1
  - User-defined 2
  - User-defined 3
  - User-defined 4
  - User-defined 5

---

<Alert React Delay: x>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- When initially alerted, there is a small window of waiting before starting
  the chase.
- Replace 'x' with a number representing the number of frames for the
  initial reaction delay.

---

<Alert Common Event: x>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Runs a Common Event when initially alerted.
- Replace 'x' with a number representing the ID of the Common Event to run.
- Use 0 to run no Common Events.

---

<Alert Sound Name: name>
<Alert Sound Volume: x>
<Alert Sound Pitch: y>
<Alert Sound Pan: z>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Play this sound effect when the event is initially alerted.
- Replace 'name' with the filename of the sound effect found in /audio/se/
  to play. Do NOT include the file extension.
- Replace 'x' with a number representing the volume of the sound effect.
- Replace 'y' with a number representing the pitch of the sound effect.
- Replace 'z' with a number representing the pan of the sound effect.

---

<Return Position>
<Stay Position>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Decide if the event will return back to its initial position after an
  alert chase is over.
- Or if it will stay where it currently is.

---

<Return Time: x>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- This is the amount of time spent (in frames) after an alert chase is over
  but returning back to the event's original position.
- Replace 'x' with a number representing the number of frames for the
  duration between idling and returning.

---

<Idle Balloon: name>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Determines the balloon displayed when beginning the idle phase after an
  alert chase is over but before returning back to the original position.
- Replace 'name' with any of the following:
  - None
  - Exclamation
  - Question
  - Music Note
  - Heart
  - Angle
  - Sweat
  - Frustration
  - Silence
  - Light Bulb
  - Zzz
  - User-defined 1
  - User-defined 2
  - User-defined 3
  - User-defined 4
  - User-defined 5

---

<Returning Balloon: name>

- Used for: Event Notetags and Event Page Comment Tags
- Enables alert detection towards the player on the event.
- Determines the balloon displayed when the event starts returning back to
  the event's original position.
- Replace 'name' with any of the following:
  - None
  - Exclamation
  - Question
  - Music Note
  - Heart
  - Angle
  - Sweat
  - Frustration
  - Silence
  - Light Bulb
  - Zzz
  - User-defined 1
  - User-defined 2
  - User-defined 3
  - User-defined 4
  - User-defined 5

---

Alert Vision Blocking-Related Notetags

---

<Block Vision Tag: x>
<Block Vision Tags: x, x, x>

- Used for: Tileset and Map Notetags
- When using a specific tileset or on a specific map, tiles marked with the
  terrain tag 'x' will obscure the line of sight from the event to the
  player character.
- Replace 'x' with a number value representing the terrain tag used.
- This does NOT change the Field of View Alert Detection Range graphic.

---

<Block Vision Region: x>
<Block Vision Regions: x, x, x>

- Used for: Tileset and Map Notetags
- When using a specific tileset or on a specific map, tiles marked with the
  region ID 'x' will obscure the line of sight from the event to the
  player character.
- Replace 'x' with a number value representing the region ID used.
- This does NOT change the Field of View Alert Detection Range graphic.

---


Conditional Branch Usage

For those wanting to use Conditional Branch event commands with this plugin the following functions into the "Script" input fields of the respective event commands.

Conditional Branch Script Functions

EncounterEffects EncounterLock.png

These are newly added JavaScript functions that return a true/false value. The functions are best used with the Conditional Branch script input field.

---

this.checkEventFacingPlayerFront()

- Returns true if the event is facing the player's front.

---

this.checkEventFacingPlayerBack()

- Returns true if the event is facing the player's back.
- Best used with a Surprise attack.

---

this.checkEventFacingPlayerSide()

- Returns true if the event is facing the player's side.

---

this.checkPlayerFacingEventFront()

- Returns true if the player is facing the event's front.

---

this.checkPlayerFacingEventBack()

- Returns true if the player is facing the event's back.
- Best used with a Preemptive attack.

---

this.checkPlayerFacingEventSide()

- Returns true if the player is facing the event's side.

---

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.

---

Advantage Plugin Commands

---

EncounterEffects Preemptive.png

EncounterEffects Command1.png

Advantage: Add to Queue
- Add (at the end) to the existing advantage queue the following encounter
 advantages for the upcoming battles.

  Queue:
  - Add to the queue the following advantage options for the
    upcoming battles.
    - Preemptive (Player gains turn advantage)
    - Surprise (Enemies gain turn advantage)
    - No Advantage (Neither party has advantage)
    - Chance (Random encounter advantage chance)

---

EncounterEffects Surprise.png

EncounterEffects Command2.png

Advantage: Set Queue
- Declare the exact advantage queue for the upcoming battles.

  Queue:
  - Add to the queue the following advantage options for the
    upcoming battles.
    - Preemptive (Player gains turn advantage)
    - Surprise (Enemies gain turn advantage)
    - No Advantage (Neither party has advantage)
    - Chance (Random encounter advantage chance)

---

EncounterEffects Command3.png

Advantage: Reset Queue
- Resets the advantage queue for battles.

---

Alert Plugin Commands

EncounterEffects Command4.png

---

Alert: Stealth Mode
- Changes the stealth mode setting for the player.

  Stealth Mode:
  - If Stealth Mode is on, bypass unnoticed alerts.
  - Already alerted events will stay alert.

---

Plugin Parameters

Advantage Settings

EncounterEffects Preemptive.png

EncounterEffects Params1.png

Advantage common event settings related to enemy encounters.

---

Settings

 Preemptive Event:
 - Run this Common Event upon a preemptive advantage.
 - Use 0 to run no Common Events.
 Surprise Event:
 - Run this Common Event upon a surprise advantage.
 - Use 0 to run no Common Events.
 No Advantage Event:
 - Run this Common Event when no advantage is given.
 - Use 0 to run no Common Events.

---

Alert Settings

EncounterEffects Chase.gif

EncounterEffects Params2.png

These are settings for alerting events. Used mainly for events chasing the player.

How alert detection works is when the player steps with an event (who has an alert notetag or comment tag), the event will enter alert mode. At the very start, a response balloon will play along with an initialy delay. If there is a common event set, the common event will play immediately.

After the initial delay is over, the event will begin its chasing phase. Although it's called the chasing phase, it can react differently by using path finding to find a way to the player, rushing directly in a straight line at the player, running away from the player, or moving about randomly.

If the player stays out of the event's alert detection range for a specific amount of time, the event will enter its idle phase. An idle balloon will play and the event will wait a short duration.

After this short duration is over, the event will return back to its original position (if desired). Upon starting its return to its original position, it will play the returning balloon.

During the idle and return phases, if the player steps in range of the event's alert range, it will begin the chase all over again.

---

EncounterEffects FoV.gif

Alert

 Detection Range:
 - Default tile range for event to detect the player in.
 Alert Dash:
 - Alerted events use dashing speed.
 Alert Time:
 - Number of frames the alerted event will attempt to chase the player.

---

Field of View

 Angle Range:
 - The angle range used to determine the event's field of view.
 Show Range:
 - Show the field of view of events?
 Color 1:
 Color 2:
 - Colors with a bit of alpha settings.
 - Format rgba(0-255, 0-255, 0-255, 0-1)

---

Response

 Response Type:
 - What kind of default response behavior do you want?
   - Chase: Use path finding to find a route to the player
   - Rush: Rush directly at the player
   - Flee: Run away from the player
   - Random: Move in random directions
 Response Balloon:
 - What kind of balloon should the event play when detecting the player?
 Common Event:
 - Run this Common Event when the player is detected.
 - Use 0 for no Common Event.
 Reaction Delay:
 - Number of frames for the event to stand still before beginning
   the chase.

---

Sound

 Filename:
 - Filename of the sound effect played when alerted.
 Volume:
 - Volume of the sound effect played.
 Pitch:
 - Pitch of the sound effect played.
 Pan:
 - Pan of the sound effect played.

---

Return

 Return Home:
 - After finishing a chase, return back to the home position?
 Idle Wait:
 - Number of frames to wait before returning home.
 Idle Balloon:
 - Play this balloon when an event is about to return.
 Returning Balloon:
 - Play this balloon when an event begins returning.

---

Encounter Multipliers

EncounterEffects Params3.png

Encounter multiplier settings regarding enemy encounters.

---

Bush Multiplier

 Parameter:
 - Multiplier for how fast encounters occur by when the player is walking
   through bushes.
 Boat Multiplier:
 - Multiplier for how fast encounters occur by when the player is
   traveling via boat.
 Ship Multiplier:
 - Multiplier for how fast encounters occur by when the player is
   traveling via ship.

---

Repel/Lure Settings

EncounterEffects Params4.png

Repel/Lure settings regarding enemy encounters.

---

Settings

 Repel Variable:
 - Select a variable where if the value is above 0, it will
   repel encounters.
 - Each step reduces variable value by 1.
 Wear Off Common Event:
 - Run this Common Event when Repel reaches 0.
 - Use 0 to run no Common Events.

---

Settings

 Lure Variable:
 - Select a variable where if the value is above 0, it will
   lure encounters.
 - Each step reduces variable value by 1.
 Wear Off Common Event:
 - Run this Common Event when Lure reaches 0.
 - Use 0 to run no Common Events.
 Lure Multiplier:
 - Multiplier for how fast encounters occur by when the lure
   effect is active.
 Lure Increase:
 - Flat increase for how fast encounters occur by when the lure
   effect is active.

---


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

Changelog

Version 1.10: January 20, 2023

  • Feature Update!
    • When events with <Alert> and <Follower Trigger> are chasing the player, events will no longer factor in the position of followers while determing a path and go around them. Instead, they will charge at the player as if the followers aren't there. Update made by Arisu.


Version 1.09: September 15, 2022

  • Compatibility Update!
    • This plugin now works better with the Events and Movement Core's stop event movement plugin parameters and commands. Update made by Arisu.


Version 1.08: February 17, 2022

  • Compatibility Update
    • Added compatibility functionality for future plugins.


Version 1.07: January 6, 2021

  • Optimization Update!
    • Plugin should run more optimized.


Version 1.06: August 20, 2021

  • Compatibility Update!
    • Better compatibility with Event and Movement Core's spawn functions. Update made by Arisu.


Version 1.05: January 15, 2021

  • Documentation Update!
    • Help file updated for features that were left out by accident.
      • Notetag/Comment Tag: <Alert FoV Angle: x>
      • Notetag/Comment Tag: <Alert Hide FoV>
      • Notetag/Comment Tag: <Alert Show FoV>


Version 1.04: December 11, 2020

  • Bug Fixes!
    • Without the Events and Movement Core, events returning home after a failed alert chase will no longer crash the game. Fix by Yanfly and Shiro.


Version 1.03: December 4, 2020

  • Optimization Update!
    • Plugin should run more optimized.


Version 1.02: November 29, 2020

  • Feature Update!
    • Initialization of the encounter effects no only occur if the event's current page settings have been altered. Change made by Arisu and Shaz.


Version 1.01: November 22, 2020

  • Bug Fixes!
    • Certain notetags will no longer cause crashes. Fix made by Yanfly.
    • Erased events will have their alert sprite removed, too. Fix made by Yanfly.


Version 1.00: December 11, 2020

  • Finished Plugin!


See Also


End of File