BCMER allows you to control events to a degree using its API. Some features of events are not in the API itself and may require patching into BCMER or accessing data to manipulate it in ways that may not be in the API.
BCMER allows you to force events into the game by running the ForceEvents method. ForceEvents takes in a list of events to roll onto the game on the next ship lever pull.
// Example: Forcing a single event
BrutalCompanyMinus.Minus.API.ForceEvents(["TestEvent"]);
// Example: Forcing multiple events at once
string[] myCustomEvents = { "TestEvent", "TestEventTwo" };
BrutalCompanyMinus.Minus.API.ForceEvents(myCustomEvents);
Forcing events is the most useful to call prior to loading a moon, prior to the ship lever pull. Using it while landed will push it onto the next day.
It is possible to reroll events when landed on the moon, However rerolling events comes with extreme caution and is very heavy on the CPU to calculate.
// Reroll
BrutalCompanyMinus.Minus.API.RegenerateEvents();
Whilst rerolling events is possible at any time by calling this method, I advise against it unless you know what you are doing, as it could lead to buggy game states or errors.
Event data in Brutal can be read via the API by passing in the instance of an event, for example Spiders.Instance.
Passing in a custom event? Instead of using an instance, just pass in the name of the event as a string!
Checking the event executed status of an custom event does not work at the current moment.
By calling DoesEventExist and passing in a string, we can check if a certain event exists or not by referencing its name. This will not work by calling aliased names, as those are not considered an actual event but another way of typing the name out ingame. This call also works on custom events too.
//Expects a string name
bool EventExists = BrutalCompanyMinus.Minus.API.DoesEventExist("ExampleName");
The following table shows methods that can be used to read certain properties for a given event:
| Method | Source | Returns |
|---|---|---|
GetEventDescriptions(MEvent e) |
Returns a list of Descriptions for the event. | List<string> |
GetEventColorHex(MEvent e) |
Returns the hex color for an event | string |
GetEventWeight(MEvent e) |
Returns the event's weight | integer |
GetEventType(MEvent e) |
Returns the event's event type as a string | string |
IsEventEnabled(MEvent e) |
Returns if an event is enabled | boolean |
IsEventSpecial(MEvent e) |
Returns if an event is considered special | boolean |
IsEventBeta(MEvent e) |
Returns if an event is considered Beta | boolean |
IsEventActive(MEvent e) |
Returns if an event is active. This flag may not be present on every event. The active flag is mostly used with events that use MonoBehaviors for features. What seperates this from the Executed status is this is something that can be turned true/false as needed mid-event, depending on the type of event. | boolean |
IsEventExecuted(MEvent e) |
Returns if an event has executed. All events inherit this. | boolean |
GetEventsToRemove(MEvent e) |
Returns a list of events that the event removes. | List<string> |
GetEventsToRemove(MEvent e) |
Returns a list of events that the event adds. | List<string> |
IsEventSpeedRunSafe(MEvent e) |
Returns if the event is considered speedrun safe. | boolean |
GetEventAliases(MEvent e) |
Returns a list of aliases for the event. | List<string> |