BPC_BL_ModCopies
BurrowLib 0.2.0, in the palette under BurrowLib › Mod copies.
Variables
Section titled “Variables”Your mod’s id. Pick one once and never change it, even if you rename the mod.
editable var Id: stringRaise it with every release. The newest build always runs, and of two copies of the same build, exactly one does.
editable var Build: int = 1Running
Section titled “Running”Whether this copy is the one that runs. False until its first tick has decided.
var Running: bool = falseEvents
Section titled “Events”Called once, on the one copy of your mod that runs, before its first tick. Every other copy is destroyed instead.
dispatcher OnRun()Examples
Section titled “Examples”Running a mod once
Section titled “Running a mod once”Give your mod’s actor a BPC_BL_ModCopies component with your mod’s id, and start the mod from the component’s On Run event rather than from BeginPlay. However many copies of the mod a player has installed, On Run fires on one of them.
An Actor Blueprint, BP_RunOnce, with:
- a BPC_BL_ModCopies component named Copies, with Id set to
example.run-once
Event Graph
blueprint BP_RunOnce : Actor at /Game/Mods/BurrowLibExamples/RunOnce/Loom/BP_RunOnceuse /Game/Mods/BurrowLib_0_2_0
// Runs the mod on one copy only, however many copies of it are installed.component Copies: BPC_BL_ModCopies(Id: "example.run-once", Build: 1)
on Copies.OnRun { BPL_BL_Mod.Log(self, "running")}