This script allows you to create troop “placeholders”. These are special types of enemies that will be replaced with an actual enemy when they are
encountered, allowing you to create random troops while managing them using the troop editor.
Each troop contains a set of “placeholder rules”. These rules are used to determine how the placeholders can be populated. The rules come with a number
of options, and more options can be added to it if necessary.
By creating a set of placeholder rules, along with the use of placeholders, you can effectively produce random encounters.
Place this script below Materials and above Main
A placeholder enemy consists of a sprite, which is used as a visual reference in the troop editor, and a placeholder name.
Placeholder rules determine whether an enemy can be placed in a placeholder spot or not based on the placeholder name. You can use placeholder tags to restrict certain enemies from certain spots.
For example, if you have three placeholders whose names are
And you have a rule that says an enemy can only be placed in “Large” placeholders, then it cannot be placed in any other placeholder spot.
To create a placeholder enemy, notetag it with
The name can be anything you want. You should avoid using very long names
You should also include a graphic for your placeholder enemy.
Setup Troop Placeholders
In the troop editor, you can visually place the placeholders.
You can choose to mix enemies with placeholders if you want certain enemies
to always appear. Only placeholder enemies will be replaced.
Setup Placeholder Rules
In the troop event editor, create a comment of the form
<placeholder rule: id> weight: 50; tags: small, medium </placeholder rule>
id is the ID of the enemy this rule applies to. You can set the ID to 0 if you want a chance to replace the placeholder with no enemy.
Notice that the rule options come in pairs of the form
option: value option: value1, value2 option1: value1; option2: value2
And are separated by semi-colons.
See the reference section for information on each option
This is the list of options available and what they mean.
Probability that this enemy will be selected. This weight is compared
against weights of all other rules
Which placeholders this enemy can be placed in. The enemy can only be placed in placeholders whose name matches one of these tags. You can have multiple tags for a single rule.