Neutral Faction


Version 2.0
Last update: May 22, 2021

Showcase of the neutral faction

Example of 4 units in the same class. From left to right: player, enemy, ally and neutral

This plugin allows you to create a new faction of units, which will be hostile to all other factions (player, ally and enemy). This faction will also have its own phase that starts after the ally faction ends its turn. The faction will be controlled by the AI.

Creating a neutral unit

To create a neutral unit, first you need to create a normal unit and assign it the custom parameter {neutralFaction: true}. You can use this parameter for any type of unit, although it is recommended to only do it for ally or enemy units, because player untis don't have AI Patterns, so you can't change their behaviour. This "neutralFaction" is the only parameter you need to make the plugin work. There are other options that you can modify, but they are optional.

Hidden units

If you want the unit to be a obstacle, like a breakable wall or a tree, you can also use the parameter {neutralHidden: false} so it won't count as a real unit.

Event command - Change a unit to/from the neutral faction

You can create an event command that changes a normal unit to a neutral unit or viceversa. To do this, create an "Execute Script" event command and select the "Call Event Command" option. Also, set the Object Name to "NeutralAffiliation". Finally, go to the Original Data tab on the event and select the unit you wish to change.

Assign music file to the neutral faction

By default, the neutral phase will have the same music used in the enemy phase, unless it is specified through a map custom parameter. The parameter is called "neutralMusic", and it cointants two values: a value specifying if the music is default from the engine (true) or imported (false), and an id value to specify which song the map will use. For example: { neutralMusic: { id: 4, isRuntime: false } } will use a song that was imported by the player (the value in "isRuntime" is false) and with the ID 4.
Neutral unit in realbattle

A neutral unit being attacked by a player unit. Note how the both the battle sprite and the life crystal of the neutral unit have the color yellow.

Graphic settings for neutral units

By default, all neutral units use the same map and combat sprites as other units from their original army. If you want to change this, there are several possible changes:
Neutral phase Neutral frame

Example assets used for the FRAME and WINDOW settings

Customization of global settings

The plugin comes with a file called _settings.js that can be openend and edited without any programming knowledge. You can open it with Notepad or any other text editor. The file comes with different variables, each of them with a default value assigned. Here is the list of the variables and the explanations of what each one does:

Insert screenshot of a lot of neutral charchips here

Examples assets

This plugin comes with some sample assets so you can test how the custom parameters work. There are two assets that are originally created by SapphireSoft, the developers of the engine, and then edited by BlueLeafy to be used on this plugin. One of them is for the FRAME setting, and the other is for the WINDOW setting. There are also other assets that are made by SapphireSoft and modified by Goinza: a yellow HP bar used for the GAUGE setting, and the neutral motion and charchip variants for the Bandit class.