ProjectilePlugin
Custom projectiles and projectile paths.
| Date uploaded | 4 years ago |
| Version | 1.0.0 |
| Download link | LordAshes-ProjectilePlugin-1.0.0.zip |
| Downloads | 283 |
| Dependency string | LordAshes-ProjectilePlugin-1.0.0 |
This mod requires the following mods to function
bbepisTaleSpire-BepInExPack
Unified BepInEx all-in-one modding pack - plugin framework, detour library
Preferred version: 5.4.10brcoding-SetInjectionFlagPlugin
Allows players to flag that mods are installed for BouncyRock
Preferred version: 3.3.4LordAshes-FileAccessPlugin
Provides standardized methods for accessing both local file and url resources. Automatically handles searching local folders for assets.
Preferred version: 1.4.1LordAshes-AssetDataPlugin
Dependency plugin for subscription/notification based data storage and message exchange.
Preferred version: 3.4.0HolloFox_TS-RadialUIPlugin
This is a developer tool based package used to manage and configure Radial UI Menus.
Preferred version: 3.1.2README
Projectile Plugin
This unofficial TaleSpire plugin for adding custom projectiles and projectile path builders. This is an initial release of the plugin with the base feature implemented by very little bells and whistles. Improvements and additional features will be coming soon.
This plugin, like all others, is free but if you want to donate, use: http://LordAshes.ca/TalespireDonate/Donate.php
Change Log
1.0.0: Initial release
Install
Use R2ModMan or similar installer to install this plugin.
Using R2ModMan to edit the configuration for this plugin, one can set the duration (in frames) of the projectile animations. Currently the duration of the animation is always the same regardless of the distance. This is to more easily accomodate other plugins, such as rule set plugins, which need to determine when the animations has completed.
Usage
- Select a mini. This marks that mini as the attacker.
- Right click a different mini (the first target) and select the projectile menu option.
- Select the desired projectile attack from the Projectule menu.
- If multiple targets need to be selected, right click another mini (could be the same one or a different one), select the Projectile menu again and then select the only option in the menu. The option indicates which target and of how many the selection is.
- Once all targets have been chosen, the projectile animation is played.
The appearance of the projectile icon, mesh and the path it takes is dicated by the projectile configuration.
Plugin Details
This plugin requires two types of assets: projectiles and path builders. The plugin comes with two projectile asstes (chaos bolt and boulder) and two path builders (direct and arc).
Projectiles define the various setting of the corresponding projectile like the name, mesh, icon, number of targets, path builder, path builder parameters, etc. Each projectile has its own file thus allowing content creators to easily make additional projectile options.
Path builders determine how the projectile gets from the source (attacker) to the destination(s) (victim(s)).
Creating Projectiles
-
Before you can create a projectile for this plugin, the asset must already exist. Make a projectile asset bundle just like you make any other asset. Projectiles always use Effect mode (even if the asset bundle info.txt file say otherwise), so it is suggested to use the Kind Effect in your info.txt file so that when the asset is spawned as an Effect it will look the same as when it is used as a projectile.
-
You will also need a 64x64 PNG file to represent the projectile icon. The PNG can use transparency.
-
Now you can create the projectile file. It should be a text file with the extension "projectile". The file actually contains JSON content but needs the projectile extension for this plugin to recognize it as a projectile configruation. The contents of the file look similar to this:
{
"name": "Chaos Bolt",
"iconName": "chaosbolt.png",
"assetBundleName": "lachaosbolt",
"targets": 3,
"pathType": "direct",
"targetArea": "SPELL"
}
*name* indicates the display name in the projectiles menu.
*iconName* indicates the name of the file containing the projectile icon (64x64 PNG) file.
*assetBundleName* indicates both the asset bundle file name and the prefab with that contains the projectile mesh.
*targets* indicates the number of targets that the projectile requires.
*pathType* indictaes the name of the path builder to be used to determine the path of the projectile.
*targetArea* indicates the location on the target that the projectile aims for. Valid options are: HEAD, CAST or SPELL,
TORCH, and (default) HIT.
This plugin comes with two Path Builders (valid selection for pathType): direct and arc. The direct path builder moves the projectile from the source to the destination in a straight line. Arc does the same thing except it causes the projectile to gain height and then lose height during the path. However, the plugin supports adding additional path builders in which case more options become avaialable.
Creating Path Builders
Path builders dictate how the projectile gets from the source to the destination. A direct and arc path builder is provided with the plugin but user can create custom path builders for other types of paths. To create a path builder, one creates a very simple C# library. The library must be a static library with one required method. The library can contain other methods for internal use but must contain the one required method. A sample path builder is shown below:
using System.Collections.Generic;
using UnityEngine;
namespace LordAshes
{
public class Direct_PathBuilder
{
public static List<Vector3> MakePath(Vector3 source, Vector3 destination, string parameters, int frames)
{
List<Vector3> path = new List<Vector3>();
Vector3 delta = (destination - source) / frames;
for(int f=0; f<frames; f++)
{
path.Add(source + (f * delta));
}
return path;
}
}
}
The required method of:
public static List<Vector3> MakePath(Vector3 source, Vector3 destination, string parameters, int frames)
is called when a projectile is launched that uses this path builder. It is called once for each target. source is a Vector3 position of the source (attacker). destination is a Vector3 position of the destination (victim). parameters is a single string containing any optional parameters needed by the path builder (or an empty string if not used). frames indicates the number of frames that the path builder should use to get the projectile from source to destination.
The method returns a List of Vector3 indicating the position of the projectile at each step (frame). The number of elements in the List should match the frame number indicated. While failing to comply with this condition will not cause the plugin to fail, it may throw off the timing of other plugins such as rule set plugins.
Limitations
The plugin currently has a number of limitations or features that can be improved:
-
Currently the Path Builders only provide position information and thus the plugin does not set orientation. This means that the plugin cannot be, at the moment, practically used for any directional projectiles like arrows or a commet.
-
Selecting a single option from a sub-menu is redundant. Selection or targets beyond the first should be put in the root menu instead of the Projectiles sub-menu.
-
Keyboard support for selecting targets via keyboard is currently not available.
CHANGELOG
3.1.0: Added configuration dependency only option (which doesn't add a radial menu)
3.1.0: Added error handling on load
3.0.1: Added missing icons
3.0.0: Triggering code rewrite
2.5.1: Bugfix for compatibility with BR Taleweaver update
2.5.0: Updated for compatibility with BR Taleweaver update
2.4.0: Updated for compatibility with BR Slab Browser update
2.3.1: Added missing components. No change to plugin since 2.3.0
2.3.0: Bug fix for Culture issues (users that use ``2,5`` instead of ``2.5``)
2.2.1: Added missing sample fireball asset. No plugin change.
2.2.0: Added Morph support
2.2.0: Rewrote animation to use Coroutines based on time and not frames
2.2.0: Added ability to select non-mini targets
2.1.0: No longer require permission to the target mini
2.1.0: Fix for BR Mass Move update
2.0.0: Fix for BR HF Integration update
1.2.0: Added alternate "Fast Selection" method
1.1.0: Added automatic orientation along path
1.0.0: Initial release