Serious Modding
So you think you have mastered beginner level and are ready for the next level? Then you are at the right place.
At this point you are expected to at least have seen most if not all parameters and components there is and be familiar with making simple mods. For details on them or as a reminder consult the wiki.
Things to do first before even starting
Have an idea of what you want to do. How you want it to work. How you want it to look or know how it should look. Write it down or take notes or better yet draw up the whole design or specification.
If you are already familiar with the sprites in vanilla and know about spritting then you may consider doing them first. But you should do that only if you are confident on how to set them up later. Otherwise do them later.
First steps
Decide on the name of your mod and how you will handle versions. How many versions you need depends on either how simple the mod is or how much you want to accomplish before you consider it finished. By finish I mean a point where you don't think you will be adding new parts or expansions. It doesn't mean you would stop improving it. Cosmoteer is still in constant change. You will not get around updating your mod.
Starting with Cosmoteer 0.14.0 all mods are required to have an author ID, your (forum) name, and mod name with the following format: authorID.modID
.
Decide on the name of your part(s). It's not longer necessary to have a unique name. If you plan the part to have variants give it proper name extensions. At this time DO NOT use space or -
with part names or component names.
Setting up
First set up your part text file. Immediately update your en.txt
. You may check the base_part.txt
or vanilla part files if you are missing some required parameters. Add your part to mod.txt
.
Part size and form
At this point you want a different kind of part than vanilla with a different size and or form. Weapons like turrets have a size that also covers their turret and the barrels.
Forbidden areas are automatically produced as soon as the physical size of the part is smaller than the size they were setup with. The physical form of the part can be completely inside the size given, hence, surrounded by forbidden areas! As of Cosmoteer 0.10.x PhysicalRect
and SaveRect
are required for these parts.
If your part has a different form than a rectangle or a circle you can define its hitbox by using CustomCollider
. You will also have to use ExternalWallsByCell
and InternalWallsByCell
to define where walls should be or not should be. You may also have to adjust corners. These are required for smoothing the outer line of the ship when attached to other parts.
If your part is meant to merge with other parts like corridors do. You have to add WallsBlend
and BlueprintWalls
.
Parts like thrusters can have a forbidden area added to them by using ProhibitLeft
, ProhibitRight
, ProhibitAbove
, ProhibitBelow
.
If your part's form is not uniform and symmetric you will also have to create its mirror part. Cosmoteer does not have true mirror function but uses rotation and transformation for mirroring. You will have to use FlipHRotate
, FlipVRotate
, UsePartWhenFlipped
and CustomCollider
.
Note: CustomCollider
overrides the parts hitbox. You must see to it that it covers the actual physical part.
Note: All coordinates used in parts are relative to the top left corner and are always written as [x, y]
Component placements
For a surface weapon turrets should be placed near the edge. As of Cosmoteer 0.13.x they can be placed completely inside when used as roof turret. Roof turret shots and effects must be rendered on the Upper
layer set by RenderBucket
respectively Bucket
.
External turrets or shield emitters require a Type = CircleCollider
and or CustomCollider
.
When something is chained to a rotating component like Type = TurretWeapon
or (Type = Rotation
) the location of the tied component is always relative to the rotation point.
Shots and beams
As of Cosmoteer 0.14.0 shots can be reused within the same part and beams are in a separate text file.
As of Cosmoteer 0.14.1 emitters are their own components
As of Cosmoteer 0.14.2 shots have the same ID format as parts.
Shots and beams have to be defined in their own text files. See vanilla.
As of Cosmoteer 0.14.0 weapons can use ammo from many storages.
This is done by replacing AmmoUsed
with an AmmoUsage
where you list groups each with their specific AmmoStorage
and ´´Amount``.
Animation
Barrel animation is done by using Type = Sprite
and within AtlasSprite
. Batteries and ammo are done by using Type = AmmoSprites
and within AmmoLevels
.
Other animations are done within Type = Graphics
, usually by Operational
-, NonOperational
- but could be nested in all sub-components by using AnimationFiles
within DamageLevels
. Damage is shown by DamageLevels
. Additional animation can be added in graphics by using DoodadToggle
, ShowToggledDoodadsWhenNotOperational
, ToggleOnDoodad
and ToggleOffDoodad
AnimationFiles
can be nested in each AtlasSprite
and DamageLevels
level.
To animate a rotation use RotSpeed
with AnimationFiles
. As of Cosmoteer 0.14.3 rotation animation orientation is no longer random and is tied to the component's.
Animation sprites must always be of the same size.
To fixate the animation to a starting frame like a barrel at rest, set ClampAnimation = true
. The last frame will serve as the stopped first frame.
For AmmoLevels
you can set HasZeroAmmoSprite = true
if you want it to be always displayed. Otherwise the frame is displayed based on the correlated number of ammo or batteries. If the numbers differ the game automatically interpolates based on the number of frames.
As of Cosmoteer 0.14.6 an AnimationToggle
within Type = Graphics
can control all animations within. Type = AmmoSprites
can now have individual counting range for a storage to display the same or different sprites. This is done by defining the start and end with RangeLow
and RangeHigh
. Note: they don't seem to work out visually yet.
Storages
Storages are among the most important components. Storages have many uses and are divided into two types based on usage: Type = AmmoStorage
and Type = AmmoConsumer
.
Pre-0.14.0 By using many storages a type of control logic can be made with limitations.
Aside from the crew they can be manipulated via Type = AmmoConverter
. You can use them to fill or drain and by doing so you can build a pseudo timer. Pre-0.14.x timers are unreliable.
As of Cosmoteer 0.14.0 converters can manipulate multi storages both ways.
Note: ammo types must be registered: either added to mod.txt or a collective file.
Note: custom priorities must be registered: either added to mod.txt or a collective file.
Effects
Weapons require Type = TriggeredEffects
.
Graphical effects are defined in their own text file.
Note: effects must be registered: either added to mod.txt or a collective file.
HitEffects
As of Cosmoteer 0.14.0 weapon components are no longer required to use HitEffects
with a part. Type = TriggeredEffects
can now be used independently by using the new trigger components and or logic glue (see Advanced modding).
Shields and thruster
Shields and thrusters are multi component systems. Aside from their main component additional components are used to for creating their specific effects.
Vanilla shields consist of the actual shield, the emitter and their effects. These can be dropped if necessary. Shields can be rotated by chaining to a turret weapon or the rotation component.
Likewise thrusters consist of the actual thruster, the burst control mechanic and their effects. These can be dropped if necessary. Thrusters cannot be rotated.
As of Cosmoteer 0.14.0 thruster no longer have lateral thrust.
As of Cosmoteer 0.14.2 shields have their own specific PenetrationResistance.
Further leading guides
Advanced Modding
Master Modding
Appendix
Modding Guideline for Quality Control, "Do's and don'ts for modding"
Extreme Modding only for those perfectionists