Overview:
This plugin allows developers to bypass the default troops system by assigning enemies to different pools to create a dynamic troop. This is meant to be utilized with enemies that are positioned on the map, not random encounters by steps.
How it Works:
Enemies in the database are assigned a note tag in the notes field, which places them in one or more pools. The user will specify which pool(s) the enemy is a part of, and also that monster's minimum quantity and maximum quantity. Upon generation, the enemies will be picked randomly between their minimum and maximum quantities.
Step 1: Place a note tag in the notes of the enemy you would like to assign to a pool.
<MonsterPool: poolname, min qty, max qty>
Ex:
<MonsterPool: cave, 1, 3>
Note: The name
is case-sensitive.
Step 2: Use
Plugin Commands to initialize the battle.
- Create an event, or open an existing event.
- Navigate to the last page, at the bottom choose "Plugin Command".
- Choose PXEnemyPools
- Select "Start Dynamic Battle"
Step 3: Set up the dynamic battle. All strings are
case-sensitive.
- Pool ID = The name of the pool you would like to initialize.
- Can Escape = Can the player run away? Will be output to a label and variable.
- Can Lose = Can the player lose the battle (no "Game Over")? Will be output to a label and variable.
- Win Label = The name of the label you'd like to call if you win. If left blank, the event will just continue processing as normal.
- Lose Label = The name of the label you'd like to call if you lose.
- Escape Label = The name of the label you'd like to call if you run away.
- Outcome Variable = Stores the result in this variable (this method should be easier than labels).
Step 4: Interact with the event
- Self-Explanatory. Upon interacting with the event, you will fight the dynamic troop created from the enemies placed in the pool.
Rarity:
Enemies with a
lower index value have higher priority to the pool. For example,
0001: Goblin (checked first)
0002: Orc (checked second)
This means that enemies last in the pool are automatically the rarest, unless the encounter is somehow guaranteed. When creating your pools, it is thus important to create enemies in the database, based on how rare you want those enemies to be.
Reinforcements:
Additionally, a "reinforcements" function has been added which allows enemies to be added to the pool in battle. Basically, this allows your boss to summon minions, or maybe some sort of monster which calls for help when in danger to call allies to the field. There's not really much else to say here, it's pretty self-explanatory.
FAQ
Q. Can I still use the troops system?
A. Yes. The functionality for the manual troop creation is unchanged. This actually lets you focus the troops system on bosses and story events, like it should have been in the first place.
Q. Can I add the same enemy to different pools?
A. Absolutely. Just add another tag to the notes in the same manner.
Q. Does this work with random encounters?
A1. Here's an example event to have random encounters use my system.
- Step 1: Create a parallel event on your map.
- Step 2: Add the below event code (bottom of page).
Q. Can I spawn enemies individually instead of pools?
A. If you name each pool the monster name, every monster encounter will be unique.
Q. Can you add xyz to the plugin?
A. Sure if it's within my capabilities and I like the idea. Run it by me.
Q. Are you willing to port this to MV?
A. I currently have no plans to back port to MV.
Event code for random encounters on map utilizing my pooling (If you don't want event encounters). Note that you can nest a lot of this code in a common event call.
◆Comment:This random encounter system is designed to:
:Comment:1. Increment a hidden encounter meter until an encounter.
:Comment:2. Randomize encounters whilst adding thresholds.
:Comment:3. Penalize player for fleeing from encounters consecutively.
:Comment:4. Utilize the dynamic pools system for truly organic encounters.
◆Control Variables:#0016 Encounter Rate = 0
◆Comment:Set the additional encounter rate for this map. Note:
:Comment:- This is added to the steps when incremented.
:Comment:- Works similarly to a multiplier.
:Comment:- Set to 0 to just use steps only (default).
◆Control Variables:#0012 Steps Buffer = Steps
◆Comment:Set the steps buffer variable to the total steps.
◆Wait:120 frames
◆Comment:Check once per 120 frames to increment steps.
◆Control Variables:#0011 Steps = Steps
◆Comment:Sets the steps variable to the total number of steps.
◆If:Steps > Steps Buffer
◆Comment:Check if steps is greater than the buffer.
◆Control Variables:#0011 Steps -= Steps Buffer
◆Comment:Subtract the steps buffer from the total number of steps.
◆Control Variables:#0013 Encounter Meter Increment = Steps
◆Comment:Set the result to increment encounter meter increment
◆Control Variables:#0013 Encounter Meter Increment += Encounter Rate
◆Comment:Add additional encounter rate to the increment.
◆If:Encounter Meter Increment > 0
◆Comment:Check if the increment has increased.
◆Control Variables:#0014 Encounter Meter += Encounter Meter Increment
◆Comment:Increase the encounter meter by the increment.
◆Control Variables:#0013 Encounter Meter Increment = 0
◆Comment:Set the increment back to 0.
◆If:Encounter Threshold = 0
◆Comment:Check if we've set the random encounter threshold.
◆Control Variables:#0015 Encounter Threshold = Random 10..100
◆Comment:Set a random value for the encounter threshold.
:Comment:Minimum Value = minimum number of steps needed for an encounter.
:Comment:Maximum value = maximum number of steps needed for an encounter.
◆
:End
◆If:Encounter Meter ≥ Encounter Threshold
◆Comment:Check if the encounter meter exceeds the threshold.
◆Plugin Command:PXEnemyPools, Start Dynamic Battle
:Plugin Command:Pool ID(s) = Goblin
:Plugin Command:Pool Selection Type = Selected
:Plugin Command:Rarity Override = Stats
:Plugin Command:Troop Max Override = 0
:Plugin Command:Can Escape = true
:Plugin Command:Can Lose = false
:Plugin Command:Outcome Variable = 17
:Plugin Command:Reinforcement Chance = 0
:Plugin Command:Reinforcement Message = %monstername% appears!
:Plugin Command:Reinforcement Quantity = 1
:Plugin Command:Reinforcement Trigger = Once Per Turn
◆Comment:Encounter!
◆Control Variables:#0015 Encounter Threshold = 0
◆Comment:Reset the encounter threshold.
◆If:Battle Outcome = 3
◆Comment:Check if the player ran from the last battle and
:Comment:increment the number of times the player has run away
:Comment:consecutively (increases base encounter meter)
◆Control Variables:#0018 Consecutive Run += 1
◆Comment:The player ran. Increment number of times player has
:Comment:run away consecutively.
◆Control Variables:#0014 Encounter Meter = 0
◆Control Variables:#0014 Encounter Meter += Consecutive Run
◆Comment:The player ran. Return meter to 0 and increment
:Comment:by number of times player has run away consecutively.
◆
:Else
◆Control Variables:#0018 Consecutive Run = 0
◆Comment:The player didn't run. Set the run increment to 0.
◆Control Variables:#0014 Encounter Meter = 0
◆Comment:The player didn't run. Set the Encounter Meter back to 0.
◆
:End
◆
:End
◆
:End
◆
:End
本贴来自国际rpgmaker官方论坛作者:Xaine处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/prince-xaine-dynamic-enemy-pooling.178545/