- Edited
Master Modding
Build menus
Editor group menus
Editor group menus are the icons you see in build mode which represent the groups into which parts are categorized. For example weapons would go into the weapons group. For a part to be sorted into an editor group the part.txt has to have this line: EditorGroup = "Weapons"
Cosmoteer 0.9.13 to present
In order to create a new custom editor group it has to be added to vanilla's editor_groups.txt
via the mod.txt
{
Action = Add
AddTo = "<Gui/editor groups.txt>"
Name = "Special"
ToAdd
{
NameKey = "EditorGroups/Special"
Icon
{
Texture = "Gui/group_special.png"
}
}
}
or more advanced
{
Action = Overrides
OverrideIn = "<gui/game/designer/editor_groups.txt>"
Overrides = &<gui/editor_groups.txt>
}
Then it has to be added to the en.txt
.
EditorGroups
{
Special = "Special"
}
A part in this new group has to be set as follows:
EditorGroup = "Special"
EditorGroupKey = "EditorGroups/Special"
Ship classes
A ship class is for example Terran
or Asteroid
. Ship classes can have their own specific parts that cannot be build by other ship classes. They can also offer the same parts as other classes.
To create a custom ship class it has to be added to vanilla's rules.txt
via the mod.txt
.
{
Action = AddMany
AddTo = "<rules.txt>/Ships"
ManyToAdd
[
&<Abh.txt>/Abh
]
}
Next the ship class has to be setup with its parts, its doors, special writing rules, its RenderLayers, Blueprint and decal roof.
Abh : <../../Data/Ships/base ship.txt>
{
IDString = Abh
OtherIDs = ["MyShips"]
NameKey = "ShipClasses/Abh"
DefaultPartID = corridor
DefaultDoorID = door
HoleDoorID = wall_hole
ExternalWalls = &<../../Data/Ships/Terran/Walls/external walls.txt>
ExternalRoofWalls = &<../../Data/Ships/Terran/Walls/external roof walls.txt>
CommandRequiredCategories = ["command"]
Parts
[
// Basic.
&<../../Data/Ships/Terran/corridor/corridor.txt>/Part
]
Doors
[
&<../../Data/Ships/Terran/door/door.txt>
&<../../Data/Ships/Terran/wall_hole/wall_hole.txt>
]
CategoryNouns
[
{Category=thruster; SingularKey="CategoryNouns/ThrusterSingular"; PluralKey="CategoryNouns/ThrusterPlural"}
]
RenderLayers
[
// Floors.
{
Key = "floors"// Ship bucket layer.
Value // The actual material.
{
UniqueBucket = -400
RenderStage = Lower
DrawWithShipGhost = true
AtlasTextureParams
{
SampleMode = Point
MipLevels = 7// Assumes 64x64 min part sprite size.
}
Material
{
Shader = "../../Data/Ships/Common/parts.shader"
}
}
}
]
Blueprints : <../../Data/Ships/base ship.txt>/Blueprints
{
ExternalWalls = &<../../Data/Ships/Terran/Walls/external blueprint walls.txt>
}
Roofs : <../../Data/Ships/base ship.txt>/Roofs
{
RoofTexturesFolders = ["../../Data/Ships/Terran/Roof Textures"]
DefaultRoofTexture = "plates1"
RoofDecalsFolders = ["Roof Decals"]
}
}
Special case
For parts being shared between ship classes and being sorted to different editor groups these parts have to be re-assigned via a representative. See Inheritance section.
Part : <photon_torpedo_tube.txt>/Part
{
ID = "Lafiel.photon_torpedo_tube",OtherIDs = ["photon_torpedo_tube"]
EditorGroup = "WeaponsMissile"
}
To limit the number of certain parts these parts should have a unique category. This will prevent the limitation to be applied accidentally to other parts.
CategoryLimits
[
{Category = "lab"; Max = 4}
]
Inheritance
Inheritance is an advanced technique which enables reusing code. However, it does not always work and has to be treated case by case. Currently, inheritance (0.14.x) does not work with shields with regards to size or orientation.
The basic invocation for inheritance is marked by :
followed by the parent from which it inherits. Note: line placement is important as it can be misinterpreted especially when followed by a group. If the group is not related to the inheritance itself separate it by one empty line.
Part : <photon_torpedo_tube.txt>/Part
Components : ^/0/Components, <../t/bio_regen.txt>, <../t/bio_shield.txt>
Graphics : &<../t/g1x1.txt>/Graphics
Settings or values can be overridden by re-declaring them. This does not always work for example with sprites or animation and has to be treated case by case.
: /BASE_SOUNDS/AudioInterior
{
Sound = "operating.wav"
Volume = .15
MaxConcurrentVolume = .3
Speed = .75
MaxConcurrent = 1
}
Custom sound effect extraordinaire
Usually, custom sound effects for parts can just be added by using simple inheritance and adjusting the path to a sound file:
: /BASE_SOUNDS/AudioExterior
{
Sound = "shoot.wav"
Volume = .75
SpeedVariation = .25
}
However, it's not that simple if you want to create a custom sound effect which can be called like particle effects.
Sound effects have to inherit from a sound class for convenience and consistency.
Sound classes are defined in base_sounds.txt
.
AudioExterior
{
Type = Audio
DynamicVolume
{
MinDistance = 0
MaxDistance = 12
DistanceFalloff = 1
MinZoom = 1
MaxZoom = 70
ZoomFalloff = 2
}
DynamicFilter
{
MinDistance = 0
MaxDistance = 2
DistanceFalloff = 1
MinZoom = 1
MaxZoom = 12
ZoomFalloff = 2
Filter
{
FilterType = LowPassAmplify
FromFrequency = 7350
ToFrequency = 500
FrequencyFactorExponent = 0.5
}
}
MaxConcurrent = 5
}
Alternatively, stand alone sounds effects can be defined in common_sounds.txt
. These are the same as sound classes but use more options.
ThrusterBurst
{
Type = Audio
DynamicVolume
{
MinDistance = 0
MaxDistance = 1.5
DistanceFalloff = 1
MinZoom = 1
MaxZoom = 12
ZoomFalloff = 5
}
Sound = "thruster_burst.wav"
MaxConcurrent = 2
ConcurrencyDuration = 1
RampUpTime = .1
RampDownTime = .1
}
Sound effects are defined in common_effects.txt
.
AlertNavalKlaxon
[
: /BASE_SOUNDS/AudioExterior //AudioInterior
{
Sound = "../sounds/alert_klaxon.wav"
Volume = 1
SpeedVariation = .1
MaxConcurrentVolume = 1.2
MaxConcurrent = 1
}
]
With this you can call it as &/COMMON_EFFECTS/AlertNavalKlaxon
Use proper add action in mod.txt to add these files.
{
Action = Overrides
OverrideIn = "<./Data/common_effects/common_effects.txt>"
Overrides = &<Effects/common_effects.txt>
}
To be continued