Components

From Cosmoteer Wiki
< Modding(Redirected from Components)
Modding/Components
Jump to navigation Jump to search
CalloutIconWarning.png
Notice
This page is currently WORK IN PROGRESS. Some things might not be up-to-date or even documented at all.

Feel free to contribute and don't worry about perfection - other editors can make corrections if necessary. Just get creating!

Code location (what's this?): Cosmoteer.Ships.Parts.Logic

A component is a block, defined inside the Components group of a part .rules file. Any block defined there is called a component.

In terms of function, as the name suggests, it's something that belongs to a part and generally provides some sort of functionality to it.


All of these are components : storages, shot emitters, consumers, states, toggles, triggers, timers, sensors, graphics and more...

Existing components

Below is a list of all some of the existing components, so that you hopefully may find some things useful for your own mod.

Also check out the table below that to learn about the classes, from which the components are inherited from, what logic they implement and more.

CalloutIconWarning.png
Notice
This list is currently work-in-progress: it might not be up-to-date, some things might be missing.

Feel free to contribute to make it better!
CalloutIconTip.png
Tip
Sort according to your needs by clicking the headers.
Components and inheritance
Name Category Short description

(click a component for more details)

Code Reference

(what's this?)

Inherits from
MultiToggle 🎚️Toggle A toggle that switches based on how specified toggles are switched.

Can be set up to switch in specific states,

e.g. when all specified toggles are ON.

Cosmoteer.Ships.Parts.Logic.PartMultiToggle

Component
TriggeredToggle 🎚️Toggle A toggle that switches when a specified trigger fires. Cosmoteer.Ships.Parts.Logic.PartTriggeredToggle

OperationalPartComponent
DistanceThreshold 🎚️Toggle A toggle can switch and has a value that depends

on the distance from another component relative to a set distance.

Cosmoteer.Ships.Parts.Logic.DistanceThreshold

OperationalPartComponent
ToggleProxy 🎚️Toggle A toggle proxy. Cosmoteer.Ships.Parts.Logic.PartToggleProxy

Component
ToggleTrigger ⚡ Trigger A trigger that fires whenever a specified toggle switches. Cosmoteer.Ships.Parts.Logic.PartToggleTrigger

OperationalPartComponent
ModeTrigger ⚡ Trigger A trigger that fires whenever a mods changes. (elaborate?) Cosmoteer.Ships.Parts.Logic.PartModeTrigger

OperationalPartComponent
Multitrigger Trigger ((TBA - see article for now))
TriggerProxy ⚡ Trigger A trigger proxy. Cosmoteer.Ships.Parts.Logic.PartTriggerProxy

Component
BuffProvider 🔮Buff A buff provider.

Allows other parts to use the buffs.

Cosmoteer.Ships.Parts.Buffs.PartBuffProvider

OperationalPartComponent
Timer ⏲️Timers A trigger that fires after a certain time. Cosmoteer.Ships.Parts.Logic.PartTimer

OperationalPartComponent
Stopwatch ⏲️Timers A trigger that fires at a rate. Cosmoteer.Ships.Parts.Logic.PartStopwatch

OperationalPartComponent
TriggeredEffects 🖼️ Media A component that performs hit (elaborate? and media effects when triggered. Cosmoteer.Ships.Parts.Effects.PartTriggeredEffects

Component
BaseBulletDeath 🎯Projectiles Cosmoteer.Bullets.Death.BaseBulletDeath

BulletComponent
DeathByLifetime 🎯Projectiles Cosmoteer.Bullets.Death.BulletDeathByLifetime

BaseBulletDeath
DeathByEnemyProximity 🎯Projectiles Cosmoteer.Bullets.Death.BulletDeathByEnemyProximity

BaseBulletDeath
ResourceStorage Storage Allows the part to store resources. Can be used as a toggle.
ValueTween Other Cosmoteer.Ships.Parts.Logic.PartValueTween

OperationalPartComponent
ToggledComponents Other Cosmoteer.Ships.Parts.Logic.PartToggledComponents

Component

Origins of Inheritance

The table below describes different classes that components can inherit from.

All components inherit from at least one of these classes.

More on the game's source code can be read about here.

Types from which a component can be inherited from
Type Code Reference

(what's this?)

Descirption
Component Cosmoteer.Ships.Parts.PartComponent

The base class for part sub-components

This is the base class for all components that can be attached to parts.
CalloutIconNote.png
Info
A component might not necessarily inherit from this class directly, it may inherit from another class that inherits from this class.
OperationalPartComponent Cosmoteer.Ships.Parts.OperationalPartComponent

(inherits from PartComponent)

Extends the PartComponent base class to implement on/off "operational" functionality common to many components.

This class is used for components, that want to have an on/off switch functionality — mainly for the components that depend on power.
CalloutIconNote.png
Info
Anything that inherits from this class can be made active/inactive based on the state of a toggle, e.g. IsOperational, used in a lot of components.
ChainablePartComponent Cosmoteer.Ships.Parts.ChainablePartComponent

(inherits from PartComponent)

The base class for part components that can be chained to other part components.

This class is used for components that can be chained to other components. (elaborate?)
BulletComponent Cosmoteer.Bullets.BulletComponent

(inherits from SceneComponent)

The base class for components that can be attached to bullets.

This class is used for components that can be attached to bullets. (are there constraints for regular components being attached to bullets?)
BaseBulletDeath Cosmoteer.Bullets.Death.BaseBulletDeath

(inherits from BulletComponent)

The base class for bullet components that cause self-death

This class is used for bullet components that are able to destroy the bullet part the are attached to.

Takeaways

CalloutIconWarning.png
Notice
This section is currently work-in-progress: it might not be up-to-date, some things might be missing.

Feel free to contribute to make it better!