Creating Custom Entities

Place to get help with not working mods / modding interface.
Post Reply
jnotaro
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Feb 09, 2015 6:32 am
Contact:

Creating Custom Entities

Post by jnotaro »

Hello,
I am currently trying to create a new mod with a group of friends that will add a large amount of functionality to the game. One aspect of this is nuclear power. However in order to implement this in a semi-realistic manner we need to create new entities, like a centrifuge. How can I accomplish this.

Thanks for the quick reply but
My issue is not how to make new entities that are based off of ones already found in vanilla. I can makes things like that (ex. assembler 4). My issue is making entities that are NOT based off of ones already in the game.
A centrifuge would work similarly to a chemical plant but only a few recipes could be made in it and those recipes could not be made anywhere else, and a Nuclear plant would work like a generator only it would run off of solid fuel not liquid fuel.
Last edited by jnotaro on Mon Feb 09, 2015 1:49 pm, edited 1 time in total.

Justin Festa
Inserter
Inserter
Posts: 28
Joined: Wed Feb 04, 2015 12:07 pm
Contact:

Re: Creating Custom Entities

Post by Justin Festa »

should be in mod help, but your question is how to add new things to the game?

Well long story short you have to base it off prototypes that already exist. Does this centrifuge act like an assembler/smelter? ie: take in an item and give you a new one?

To add new stuff to the game there are usually 6 things you have to do....

entity (the object how it works what it looks like on the map etc)
item(what it looks lik in inventory how it stacks etc)
recipe(how to make said item)
tech(how to unlock it if you dont start with it)
data.lua (require the new prototype)
localisation(what its called in game)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Creating Custom Entities

Post by ssilk »

Moved from mods
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
morphman
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu Jan 22, 2015 10:11 am
Contact:

Re: Creating Custom Entities

Post by morphman »

You can't create new entity types (also called prototypes), since those are hard coded right now.
However, you do have several options you can change to make it act like you want to.

In your example, a centrifuge acts just like a chemical plant, but has different recipes. Then copy the entity description for a chemical plant, but change "crafting_categories = {"chemistry"}," into "crafting_categories = {"[YourCategoryName]"},".
Then all you need to do is create a recipe-categories.lua (check the original files for syntax) with [YourCategoryName] in it and have your recipes for the centrifuge be of that category.

The game will treat it like a chem plant, but the player will see it as a completely different type of machine, with its own list of recipes.

Post Reply

Return to “Modding help”