Page 2 of 2

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

Posted: Sat Aug 01, 2015 12:45 pm
by ThaPear
I am currently on a holiday without access to a proper computer. I will update it when I get back.

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

Posted: Thu Nov 19, 2015 5:06 pm
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.

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

Posted: Wed Nov 25, 2015 10:48 pm
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?

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

Posted: Wed Feb 17, 2016 8:47 am
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.