[0.12.17]Clean Pipes 0.0.4 - Decide how pipes connect!

Topics and discussion about specific mods
User avatar
ThaPear
Fast Inserter
Fast Inserter
Posts: 226
Joined: Fri May 30, 2014 8:05 am
Contact:

Re: [0.11.6]Clean Pipes 0.0.4 - Decide how pipes connect!

Post by ThaPear »

I am currently on a holiday without access to a proper computer. I will update it when I get back.

Divran
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Wed Jan 14, 2015 9:13 pm
Contact:

Re: [0.11.6]Clean Pipes 0.0.4 - Decide how pipes connect!

Post by Divran »

I was going to try to make a mod similar to this (as my first try modding factorio), but before I did, I googled and found this mod. So instead, I decided to fix this for the latest version of factorio (0.12.17). Enjoy

EDIT: Only problem is, now I don't know what to make instead :/
Also, modding for factorio is tough for me, since I'm used to modding in Garry's Mod, where it's completely different (and much, much easier imo, but maybe I just have to get past the initial barrier). And it doesn't help that the documentation I can find for factorio is either outdated or hard to find (there's several pages on the wiki which don't seem to have a link to them, so you must know what to search for to find them).

Anyway, the mod I wanted to make involved having pipes modify their inputs/outputs after they were spawned. You solved this by making one pipe entity for each different kind of corner etc, but I wanted to avoid that. Maybe it's not possible.
Attachments
CleanPipes_0.0.5.zip
(27.88 KiB) Downloaded 592 times

RocketScientist
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Nov 14, 2015 1:10 pm
Contact:

Re: [0.12.17]Clean Pipes 0.0.4 - Decide how pipes connect!

Post by RocketScientist »

Nice one, you beat me to it! :evil:

Over a week ago I fixed this too, but since it was my first attempt at modding mods I wanted to test it some more. I see now that it's exactly the same as your code (except for that typo in the error message that keeps annoying me). Anyway, hat's off to you sir!

Also, I feel that there must be a better way to get blueprints to work, without requiring a ton of different parts. My first idea is that there are two options:
- Keep all the different parts in the code, but when robots place these parts they can do it using a regular pipe. I get the feeling this is not possible, but it would be the easy and fast solution.
- When placing the blueprint replace all CleanPipe ghosts by regular pipe ghosts, but remember the CleanPipe part that should go in that spot. Then once the regular pipe is placed, replace it with the clean part. Replacing the parts is definitely possible, but I don't know if it is possible to 'remember' what part should go in place of the regular pipe.

Any thoughts?

Divran
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Wed Jan 14, 2015 9:13 pm
Contact:

Re: [0.12.17]Clean Pipes 0.0.4 - Decide how pipes connect!

Post by Divran »

This is the problem with how factorio has implemeted entity instances. You can't have code on each individual entity instance. In Garry's Mod, you can, which would make having only a single type of pipe for everything be a piece of cake. Each pipe entity would simply store their designated rotation parameter in memory, which would be saved when the blueprint was created, and loaded once the blueprint was pasted. It's unfortunate that factorio didn't do entities this way.

Post Reply

Return to “Mods”