You are viewing a potentially older version of this package. View all versions.
cubly-ColourfulFlashlights-4.0.1 icon

ColourfulFlashlights

Customise the colour (color) of your flashlights! Syncs with other players!

Date uploaded 7 months ago
Version 4.0.1
Download link cubly-ColourfulFlashlights-4.0.1.zip
Downloads 15750
Dependency string cubly-ColourfulFlashlights-4.0.1

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Colourful Flashlights

Change the colour (color) of your flashlight via the terminal in the company ship! Multiplayer compatible, syncs with other players!

Select from some built-in colours or effects, use any hexadecimal colour code or define presets in a configuration file!

Terminal options

Command Colour/Function Example
cf white White (Game default)
cf blue Blue
cf red Red
cf green Green
cf yellow Yellow
cf pink Pink
cf orange Orange
cf purple Purple
cf <code> Use a hex colour code cf #FF22BB
cf rainbow <speed> A smooth rainbow effect. Speed is an integer 1-20 cf rainbow 10
cf disco <speed> Flicks between some colours. Speed is an integer 1-20 cf disco 8
cf random Toggling your flashlight off/on picks a random colour each time
cf health White when 100% health and transitions to red as health lowers
cf preset <name> Load a preset you defined in UserPresets.json cf preset example
cf speed <integer> Adjust the speed of an effect, providing an integer 1-20 cf speed 5
cf save <name> Save your current flashlight state as a preset cf save frog
cf state View details on your current flashlight state
cf help View the help page
cf View the mod page

Presets

You can create presets in BepInEx/config/ColourfulFlashlights/UserPresets.json

Note: You do not need to restart the game for your changes to be loaded.

The format is an array of objects defining a name, mode, speed and an array of hexadecimal colours.

name is a string that must be unique from other preset names, case-insensitive, max 15 characters long.

mode is an integer (see table below for options).

speed is an integer 1-20, with 1 being the slowest and 20 the fastest. Can be omitted for modes that don't require it.

colours is an array of strings, which must be hexadecimal colour codes, e.g. ["#FF00BB", "#CC5500"]

To load a preset in game, use cf preset <name> in the terminal.

You can save the current state of your flashlight with the cf save <name> command. If you provide a name of an existing preset, that preset will be overwritten. Preset names are case-insensitive and limited to 15 characters in length.

Modes

Mode Integer Mode Name Details
0 Fixed A fixed colour
1 Cycle Cycles (flicks) through colours
2 Smooth Cycle Smoothly cycles (transitions) through colours
3 Random Randomly chooses a new colour when the flashlight is turned on
4 Health Changes smoothly from one colour to another based on player health

Fixed Mode

{
    name: "foo",
    mode: 0,
    colours: ["#3BC4E3"]
}

Even if you have more colours in the array, only the first one is used to make a fixed flashlight.

Cycle and Smooth Cycle Modes

{
    name: "foo",
    mode: 1,
    speed: 8,
    colours: ["#3BC4E3", "#E07EC8", "#FFFFFF", "#ED0057", "#ED7700"]
}

In cycle mode, the flashlight will swap through the colours at a rate determined by the speed option.

Setting mode to 2 will create a smooth cycle, the flashlight will transition smoothly, while blending from one colour to the next.

Random Mode

{
    name: "foo",
    mode: 3,
    colours: ["#3FF707", "#005CFF", "#FF0000", "#FF7C4B"]
}

Random mode will choose a new colour from the provided colours at random, each time the flashlight is turned off and then back on.

If no colours are provided, then a random colour will be generated each time (behaviour of the built in cf random option).

Health Mode

{
    name: "foo",
    mode: 4,
    colours: ["#005CFF", "#FF0000"]
}

In health mode, the flashlight will update based on it's holder's current health.

The first colour in the array is 100% health and the second is 10% health. For health values between 100% and 10%, the colour will be interpolated. In this example, starting with a blue colour and getting more red the more damage the holder takes.

Full UserPresets.json Example


[
    {
        name: "example1",
        mode: 2,
        speed: 4,
        colours: ["#3BC4E3", "#E07EC8", "#FFFFFF", "#ED0057", "#ED7700"]
    },
    {
        name: "example2",
        mode: 0,
        colours: ["#1FFFB4"]
    },
    {
        name: "example3",
        mode: 3,
        colours: ["#3FF707", "#005CFF", "#FF0000", "#FF7C4B"]
    },
]

"example1" slowly and smoothly cycles through the colours in the array (in the order they appear).

"example2" is a fixed colour so only the first colour in the array will be used.

"example3" will choose a random colour from the colours array each time the flashlight is toggled.

To load a preset in game, use cf preset <name> in the terminal. For example: cf preset example1

Configuration

There are 3 configuration options, found in BepInEx/config/ColourfulFlashlights/Config.cfg

Option Type Details
Sync Others true/false If true, you will see other players' flashlight effects/colours. If false, other players' flashlights will be default (fixed white).
Sync Own true/false If true, other players will see your flashlight effects/colours. If false, your flashlight will be default (fixed white) for other players.
Sync Cyclic Effects true/false If true, all effects and colours will synchronise (dependent on above options). If false, only fixed mode flashlights will sync, all other effects will appear default (fixed white).

Issues and Feedback

If you find any issues, bugs, or just want to provide feedback, feel free to open an issue on GitHub.

CHANGELOG

4.0.1

  • Fixed a bug with health mode

4.0.0

  • Added a rainbow effect which cycles through colours
  • Added a random effect which is a random colour everytime you toggle the flashlight
  • Added a disco effect which flicks between colours
  • Added a health effect which changes colour based on player health
  • Added a user presets configuration file to define user made presets
    • Old 'custom' settings will be moved into UserPresets.json
  • Added new configuration options for syncing flashlight states
  • Added preset command to load presets
  • Added save command to save presets
  • Added state command to view current state
  • Added speed command to control speed of effects
  • Updated existing commands
  • Removed TerminalApi dependency

3.1.1

  • Fixed a bug when selecting a configuration defined colour

3.1.0

  • Fixed a critical bug when reading persistent data

3.0.0

  • Updated for V73
  • Rewrote most of the mod

Older version history

2.2.1

  • Changed repository location

2.2.0

  • Added tip popup when first using an uncoloured flashlight
  • Updated commands
  • Updated README

2.1.0

  • Updated command syntax, now uses base 'cf' command and accepts arguments to set colours
  • Added 'hex' option in game to set any colour in-game (e.g cf hex #22CCFF)
  • Updated command list in-game
  • Updated README

2.0.0

  • Now syncs all player flashlight colours!
  • Requires all players to have the mod installed
  • If you would only like to see your own flashlight colour, you can also change the new 'Sync others' config option to false

1.1.2

  • Minor tweaks

1.1.1

  • Fixed config description error

1.1.0

  • Colour choice will now persist across game launches
  • Updated README

1.0.1

  • Added cflist command to list colour options
  • Updated README

1.0.0

  • Release