How to: Create Randomized Troops
...or...
How to not need to make almost 30 Troops in the 'Troops' header for one friggin' dungeon just to create the illusion of variety!
For this project, we're not going to need any special knowledge about scripting. This can all be done using the Battle Event panel. You should know that Variables and Conditional Branches exist.
Depending on your enemy needs, you may need to use any software to resize an enemy to better fit the random battlers.
So, with that in mind, let's go!
Step 1:
Creating a pre-enemy.
Go to your 'Enemies' tab and create an enemy. Name it something that you can't mistake for a real enemy. I used "Enemies have" as the name to better work with the grammar the default scripts use, but you can use whatever suits you. After that, give it 1 HP and 0 MP. You'll want to give it a smaller graphic too.
SpoilerThis is more or less what you'll be looking at.
Step 2:
Make a Troop.
Head to your "Troops" tab, and place any needed number of the Pre-Enemies you created in there. Then, adjust the
battler graphics to be reasonable. If you didn't use a graphic you'll just have a tiny white block to move.
Step 3:
Setting the Timing.
In the Battle Event Panel, we'll set the Condition to
Turn No. 0 + 0 and it will span once per
Battle. This means
the effect happens immediately, before the player gets any notable input.
Step 4:
Creating a Variable.
Go down to the Battle Event Panel.
Hit Control Variable, and pick one that isn't being used for anything else.
Count the number of different Enemy battlers you want to be included in this random battle and have the Variable set to Random 1 ~ [Your number here].
For example, if your dungeon has 4 possible enemies (Slime, Bat, Orc, and Imp), you would set the Variable to Random 1 ~ 4.
SpoilerMy dungeon has 7 possible random enemies, so 1 ~ 7 it is.
Step 5:
Conditional Branching.
Go below the Control Variable command.
Hit Conditional Branch and set it to Variable: Whatever your random number was.
Have it
Equal to 1 (or whichever number enemy you are working on).
SpoilerThis is what you'll be looking at.
Step 6:
Using the Enemy Transform Command.
Within the Conditional Branch command and it's Else piece, use the Enemy Transform Command.
Set the popup to Enemy:
1. [Pre-Enemy] and Transform to:
[Enemy you wish to use].
For the second, third, etc. enemy you'll set the Enemy: to 2. [Pre-Enemy], 3. [Pre-Enemy], etc.
SpoilerThis transforms the second monster into a Killer Plant.
Step 7:
Healing.
After all of that, use the Change Enemy HP and Change Enemy MP commands to restore the entire troop's health and magic points. You can also use the Enemy Recover All command, if you don't want enemies to come in with pre-existing conditions. (Some enemies begin asleep, for example).
Step 8:
Blank Out the Pre-Enemy.
Go back to the Enemies tab and remove the graphic from your pre-enemy. It would look extremely silly if a bandit transformed
into a slime, for example.[/spoiler][/spoiler]
本贴来自国际rpgmaker官方论坛作者:empresskiova处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/creating-randomized-troops.99888/