How to make an entity blueprintable

Place to get help with not working mods / modding interface.
Post Reply
blitz_skull
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Mar 01, 2017 4:23 pm
Contact:

How to make an entity blueprintable

Post by blitz_skull »

I've recently taken over a mod for someone and I'm doing my best to keep it maintained. However, I find the API very tough to figure out and there seems to be little-to-no way to learn except through trying random things which due to the terrible debug logging system, has been a pain.

Sorry, rant aside.

I need to know how to make a custom entity blueprintable. That is, I can blueprint it, and remove it using the deconstruction planner. Right now I've got some interesting issues where the deconstruction planner removes my entity (x2) but then it doesn't actually leave the ground. It's no longer selectable and the robot "took" it. But for all intents and purposes. It's still there.

What gives?

gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

Re: How to make an entity blueprintable

Post by gheift »

Which mod?

blitz_skull
Burner Inserter
Burner Inserter
Posts: 12
Joined: Wed Mar 01, 2017 4:23 pm
Contact:

Re: How to make an entity blueprintable

Post by blitz_skull »

It's the Smart Display mod originally by Binbinhfr
You can find the mod description at the link below. I've made some modifications to the way the entity works, but I don't think it ever had the ability to be blueprinted.

viewtopic.php?f=93&t=24720

AndrewIRL
Fast Inserter
Fast Inserter
Posts: 240
Joined: Fri Mar 24, 2017 2:17 pm
Contact:

Re: How to make an entity blueprintable

Post by AndrewIRL »

Any experienced modders who can help with this?

Bilka
Factorio Staff
Factorio Staff
Posts: 3155
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: How to make an entity blueprintable

Post by Bilka »

I had a quick look at the code and I don't get what entity you want to blueprint. I'm not an experienced modder though so I was mostly unable to understand the code. (Maybe because there are literally no comments.....)
Anyways, here is my idea: Since the display seems to consist of three entities + text you'll have to set it up so that the entity that can be blueprinted (the lamp or the radar probably) needs to trigger an event when it's placed to place all the other entites. Same goes for deconstruction, if the main entity (the one the player places) is deconstructed, destroy the other entities. There should already be some events set up for that because the player can mine and place the entity so you should just have to copy the functions from those events to the robot related events.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding help”