Modding Bar Event

From Starsector Wiki
Jump to navigation Jump to search

Description

A bar event is a dialogue that appears when the player lands on a colony and flies down to the bar.

Implementation

All bar events implement PortsideBarEvent, and usually extend BaseBarEvent.

There are a few subclasses of `BaseBarEvent` to choose from, depending on what is being implemented. A few of the most useful ones are:

BaseBarEventWithPerson creates an event where the player interacts with a single auto-generated person.

BaseGetCommodityBarEvent creates an event where the player interacts with a single auto-generated person, and allows the player to purchase from them a community for an adjustable multiplier of its usual price.


Example

Perhaps the best example of an event where the player engages in conversation with a person and then receives some intel, based on their choices, is PlanetaryShieldBarEvent. Its unobfuscated source may be viewed from the Starsector installation directoy with a Java decompiler, such as the one that is bundled with IntelliJ Community.