I love factorio but am a complete coding bolthead.
However, I wondered if someone could construct a mod for me, it's a very simple one.
That you may put only pumpjacks on oil and put only drilling machines on ores. That is to say, you may not put anything else on ore or oil patches; no belts, no electricity poles etc. All the things required to run pumpjacks and mining machines must be off ore.
Thank-you for your suggestion but this is not quite what I am looking for.
That only allows you to build in certain areas, agreed, but I am just looking for a mod that prevents non mining equipment from being built on ore and oil patches.
Thanks
Re: New Mod to make life... ...different
Posted: Wed Feb 22, 2017 5:38 pm
by DedlySpyder
Just wondering, but why? Sounds like it would just make mining ore much more tedious because you could only mine around the edges
Re: New Mod to make life... ...different
Posted: Wed Feb 22, 2017 6:54 pm
by Yoyobuae
DedlySpyder wrote:Just wondering, but why? Sounds like it would just make mining ore much more tedious because you could only mine around the edges
-- data.raw.corpse.small-scorchmark.collision_mask.1 = doodad-layer
local mustbemasked = {
"accumulator",
"assembling-machine",
"constant-combinator",
"container",
"curved-rail",
"decider-combinator",
-- "electric-pole", -- i think it must be avaible
"electric-turret",
-- "entity-ghost", -- idk
"fluid-turret",
"furnace",
"gate",
"generator",
"inserter",
"lab",
"loader",
"logistic-container",
"pipe",
"pipe-to-ground",
-- "player", -- nope! nope!
"power-switch",
"pump",
"radar",
"roboport",
"rocket-defense", -- idk
"rocket-silo",
-- "simple-entity", -- idk
"smart-container",
"solar-panel",
-- "splitter", -- i think it must be avaible
"storage-tank",
-- "tile-ghost", -- idk
-- "transport-belt", -- i think it must be avaible
"turret",
-- "underground-belt", -- i think it must be avaible
-- "unit", -- pls dont
-- "unit-spawner", -- pls dont
"wall"
}
-- I don't know why I need add these layers, these always was here
local add_layer = {"item-layer", "object-layer", "player-layer", "water-tile",
"resource-layer"}
-- functions must be higher than starting code
function funk1 (prototype_type, name)
log(name)
for j, prototype in pairs (prototype_type) do
if prototype.collision_mask then
log( j .."Here is collision mask! " .. serpent.line(prototype.collision_mask))
for index1, maskname1 in pairs (add_layer) do
log("index1, maskname1 = " .. index1 .. ", " .. maskname1)
local nextindex = 0
local mustbeadded = true
for index2, maskname2 in pairs (prototype.collision_mask) do
nextindex = index2 + 1
if maskname1 == maskname2 then
mustbeadded = false
end
log("no-build-ore.log", "maskname1:" .. maskname1 .. " maskname2" .. maskname2)
end
if mustbeadded then
data.raw[prototype_type][prototype][collision_mask][nextindex] = maskname1
end
end
else
prototype.collision_mask = {}
for idx1, name1 in pairs (add_layer) do
prototype.collision_mask[#prototype.collision_mask+1] = name1
end
log(serpent.line(prototype.collision_mask))
end
end
end
-- start is here!
for i, prot_typ in pairs (mustbemasked) do
-- log("i = " .. i .. ", name = " .. name)
local name = prot_typ
funk1 (data.raw[prot_typ], name)
end
Re: New Mod to make life... ...different
Posted: Wed Feb 22, 2017 9:57 pm
by Strategic Sage
It seems to me that for this kind of thing it would be a lot easier to just not do it than to code it that way. I.e., if you don't want to be able to build anything on ore ... don't build it there .
Re: New Mod to make life... ...different
Posted: Fri Feb 24, 2017 3:24 pm
by lamenters
BryanSw wrote:It seems to me that for this kind of thing it would be a lot easier to just not do it than to code it that way. I.e., if you don't want to be able to build anything on ore ... don't build it there .
Yes, that is absolutely what you can do but it takes real discipline.
Why do it? Because if you have lots of large but low value ore patches, it makes base design an awful lot more complex.
EDIT: Spelling
Re: New Mod to make life... ...different
Posted: Fri Feb 24, 2017 5:17 pm
by darkfrei
lamenters wrote:
BryanSw wrote:It seems to me that for this kind of thing it would be a lot easier to just not do it than to code it that way. I.e., if you don't want to be able to build anything on ore ... don't build it there .
Yes, that is absolutely what you can do but it takes real discipline.
Why do it? Because if you have lots of large but low value ore patches, it makes base design an awful lot more complex.
EDIT: Spelling
You can download the mod higher.
Re: New Mod to make life... ...different
Posted: Wed Apr 19, 2017 2:53 pm
by lamenters
The above mod looks fine. (My apologies for the late reply, a death in the family)
I shall try it out tonight and let you all know.
Does it work with bob's mods and angel's mods?
Looking at the code, I would think not but TBH, I know nothing about it.
Thanks
Re: New Mod to make life... ...different
Posted: Wed Apr 19, 2017 3:30 pm
by darkfrei
The code define types, not names of entities. It means, it must working​ with all mods, when here is no bug. Code was not enough tested and make backup before installing.