meta data for this page

Mod-internal and cross-mod references

It is important to understand the meaning of contentName to add new ropeways to the game. Every ropeway needs to link to one ropeway carrier and one ropeway support. In many cases, all three shall be contained in the same mod.

Is this relevant for me?

  • If you create new vehicles, this page will not be relevant for you.
  • If you create a new ropeway and add both a ropeway carrier and a ropeway within the same mod, this page will not be relevant as well.
  • If you create a new ropeway using default supports and carriers, this page will not be relevant as well.
  • But: If you want to create a ropeway and use carriers or supports multiple times, i.e. from other mods, this page is important for you.

Any time you specify a contentName, e.g. by specifying contentName = “yourcontent”, in your data table, it will be converted into the format mods.yourmodname.yourcontent. Please note that any contentName you add in a mod should not start with default.. This is important to avoid unintended behaviour (using such a contentName that is completely identical to vanilla content will make the game use vanilla content instead of your mod content).

Mod-internal references

If you add a new ropeway, you will likely want to add new supports.

Assume that the carrier is initialised using following code:

ModLoader.addContent("carrier", {
	contentName = "mycarrier",
	-- more code follows
	-- ...
};

You can now use the carrier in your ropeway by stating:

ModLoader.addContent("ropeway", {
	contentName = "myropeway",
	-- some more code
	-- ...
 
	carrierType = "mycarrier",
	-- more code
	-- ...
};

In the code above, mycarrier will automatically be converted into mods.yourmodname.mycarrier while the ropeway is built in-game. This means you do not have to care about the naming conversion from mycontent to mods.yourmodname.mycontent.

Cross-mod references

However, if you want to add cross-mod references (e.g. yourmod should use a ropeway carrier or ropeway support from yourothermodname) you need to consider the naming conversion. Any time you want to use myothercarrier from yourothermodname, you will need to hard-code the other mod's name into the data table:

ModLoader.addContent("ropeway", {
	contentName = "myotherropeway",
	-- some more code
	-- ...
 
	carrierType = "mods.yourothermodname.myothercarrier",
	-- more code
	-- ...
};

In general it should be preferred to include all dependencies (i.e. ropeway, supports and carriers) into the same mod. However, if this leads to adding the exact same content twice or more in different mods, cross-mod references are recommended.