Part (modding)

From Cosmoteer Wiki
< ModdingModding/Part
Jump to navigation Jump to search


Parts are what ships are made of. In game, you place them in Build Mode, and destroy them during combat.

In the code, each part is made of variables called data fields (or "fields" for short), but also components, and stats.

Note that the graphics are components as well.


Through modding, you can modify almost all aspects of base game parts, or add entirely new ones.

Examples

Below is the .rules file for the Boost Thruster, called "thruster_boost" in the game's files.

It's heavily shortened so you can see the general structure :

Part : <../base_part_terran.rules>/Part
{
	NameKey = "Parts/ThrusterBoost"
	IconNameKey = "Parts/ThrusterBoostIcon"
	ID = cosmoteer.thruster_boost // Part IDs must always be in the form of "author_name.part_name". If making your own mod, do *not* use "cosmoteer" as your author name, because it may conflict with future vanilla parts.
	EditorGroup = "Flight"
	DescriptionKey = "Parts/ThrusterBoostDesc"
	Resources
	[
		[steel, 56]
		[coil2, 10]
		[tristeel, 8]
	]
	TypeCategories = [thruster, uses_power]
	Size = [2, 5]
	
	// ...

	Components : ^/0/Components
	{
		IsOperational
		{	
			// ...
		}

		// ...

		Graphics
		{	
			// ...
		}
	}
}

As you can see, everything is in a huge Part{} block containing data fields, first and then the components inside a {}.

CalloutIconWarning.pngWork in Progress
This subsection is currently work-in-progress: Some things may be missing.

Feel free to contribute to make it better!

Example mods

See also