What are Plug-ins?†
Plug-ins are features that extend the functionality of Bakin's tools and engine programmatically using C#.
There are two main types of plug-ins:
- Tool Plug-ins (.dll format)
- Engine Plug-ins (.cs format)
As of March 2025, only engine plug-ins have been released for the creation environment.
Plug-in Types†
- Engine plug-ins are used to extend the operation of the Bakin engine.
The engine plug-in currently has the following two types of functions:
- Event Scripts: Extend the functionality of events by assigning C# programs to them
- Battle Plug-ins: Replace Bakin's battle system with a C# program
How to Use Plug-ins†
- For engine plug-ins, create the folder specified in the description below directly under the project folder you are editing and store plug-ins in it.
- Event Scripts
- First create a 'script' folder and add the .cs file to it.
- After launching Bakin, click the arrow in the "C# Program Assignment" field on the lower left of the event sheet.
- Select the script you wish to assign from the list that opens.
- Plug-ins with multiple methods can use the event panel to specify which method to apply.
See Control for the "Call C# Program" panel.
- Notes
cs files can also be stored in subfolders.
Note that the dll file must be placed directly under the script.
- Battle Plug-ins
- Create a 'battlescript' folder and add a set of .cs files to it.
- It is applied automatically when the project is launched, and no tool operation is required.
Delete Plug-ins†
- Event Scripts: Delete the .cs file you wish to remove from the 'script' folder.
- Battle Plug-ins: Delete the entire 'battlescript' folder.
You can also use "Remove Battle-Related Scripts from Game File" in the Map Editor's top menu > Functions > Expanded Features.
How to Create Plug-ins†
(!)Bakin updates may affect the operation of plug-ins created in the past. Please check the differences each time an update occurs.
- Event Scripts
After launching Bakin, click the arrow in the "C# Program Assignment" field on the lower left of the event sheet.
Press the "Create New" button at the top to start the editor (the editor associated with .cs).
- It is recommended that Visual Studio (Community version is acceptable) be installed with C# development ready.
- You can also use other editors to create .cs files and put them in the 'script' folder without going through Bakin.
- Battle Plug-Ins
Execute "Copy Battle-Related Scripts to Game File" in the Map Editor's top menu > Functions > Expanded Features.
See Map Editor Overview for more information on this feature.
When executed, a 'battlescript' folder will be created in the project folder currently being edited, and a battle plug-in template (the same as the default battle process) will be created in that folder.
Edit the created file with your editor.
- Metadata Settings
- No metadata in event scripts.
- For battle plug-ins, replace // @@version xx.xx.xx.xx.xx at the beginning of BattlePluginDef.cs with the corresponding Bakin version.
- Plug-in Help
If you distribute plug-ins and need to explain the contents, please create and include a readme.txt file.
- Plug-in Settings
There is currently no ability to specify plug-in preferences.
Key Points When Creating Plug-ins†
- Link Any DLL
By making the following statement at the beginning of a C# program, you can link and use any DLL file in the script folder.
This feature can also be used to load DLLs in the script folder.
Please refer to "Introduce Steam "Achievements" into the Game" in Plug-in Samples.
// @@link xxx.dll
- Import Another cs File
You can import another cs file by making the following statement:
// @@include xxx.cs
Please use this option when a large process is divided into multiple cs files.
Refer to the battle plug-ins in "Battle Plug-In Samples".
By inserting the above description into BattlePluginDef.cs in various places and incorporating the processing of branches and leaves, all battle processing is made the target of the build.
- Access C# Assigned to Another Event
By using @ref and writing as follows, you can access C# assigned to another event.
- Write the following for the cs file of another event you want to access at the beginning of the cs file
// @@ref OtherScript.cs
- Obtain target MapCharacter from mapScene
var chr = mapScene.mapCharList.Find(x => x.Name == "Name_of_Another_Event");
- Access members of a class assigned to another MapCharacter through a cast
((OtherScript)chr.bindedScript).field = "ABC";
- Resources Referenced Only from Plug-ins
If you have a resource that is referenced only from a plug-in, you must specify that resource as the target for export.
To specify, right-click on the resource you wish to export in the tree of entries in the Resources menu, and then select “Be Sure to Include in Published Work Export”.
Plug-in Distribution†
- Event Scripts: Distribute the created cs files in any way you wish.
- Battle Plug-ins: Zip the entire 'battlescript' folder and distribute it in any way you wish.
Distribution as .csrbr Files†
Compressing the event script .cs files and related files into a Zip file and rewriting the extension to .csrbr will make distribution and importing into Bakin easier.
- They can distribute through the Steam Workshop.
- In the event sheet "C# Program Assignment", click the Add button to select the .csrbr file.
Once added, the .csrbr file will be automatically decompressed and extracted.
- Battle plug-ins cannot be distributed in .csrbr format.
Plug-in Reference†
References to currently available classes can be found at the following URL.
RPG Developer Bakin Plug-in Reference:https://rpgbakin.com/csreference/
As of September 2023, the classes used in the creation of event scripts and battle plug-ins are available to the public.
Plug-in Samples†
See Plug-in Samples for sample codes of the plug-ins.
Explanations of the sample codes published on the Steam Workshop are available.