Rocket-Silo Construction


Building a Rocket Silo is now a 6 stages process. Each silo needs to be excavated, filled and built, while requiring a lot of power, materials and generating pollution. Custom Space Exploration, Bob&Angels, Industrial Revolution and Exotic Industries compatibility News: new graphics by snouz

Content
7 months ago
0.17 - 1.1
33.6K
Manufacturing

b Rocket silo phase 1 just vanished

4 years ago

I would like you to take a look at this save: http://file.sampo.ru/f7kvnk/
There is a Rocket Silo Construction site being built there. When its phase 1 is done, the construction site just vanishes instead of replacing the site with the phase 2 entity.
I have built the silo a few times in my games. The problem appeared after the last Factorio update. But it may be as well related to other mods.

4 years ago

I will take a look

4 years ago

I just thought that you might need to use, that the silo is near {-136, -173}.

4 years ago
(updated 4 years ago)

@MFerrari: Seems to be a problem with my mod GCKI. It acts on on_built_entity when the first stage of the silo is finished even though that event should be filtered to the car-keys from my mod.

4 years ago
(updated 4 years ago)

Hi @Pi-C tested here and the problem is really GCKI. I saw you added filter in your event ,so why is it destroying the silo ?

4 years ago

silo construction is entering your on_built_entity when it should not... weird
It does not fire when I build other things manually. But the silo is firing it...

4 years ago

I truly don't know! I've tested the filter before, and I think it should be set correctly. There is that discussion about Breaking change/fix: script.raise_event rework on the forums, but I'm getting totally confused the more I try to follow it. :-D
Nevertheless, could it be that the way you're raising the event is the cause? -- I'll look into it again tomorrow, need a break now …

4 years ago

silo construction is entering your on_built_entity when it should not... weird

Right, I've added some debugging code and found the same.

It does not fire when I build other things manually. But the silo is firing it...

So perhaps it is connected to script.raise_event somehow? Can that bypass the filtering?

4 years ago

That is what it looks like. Bypassing with script raise. Maybe a factorio bug

4 years ago

I've made a post on the forum …

4 years ago

That is what it looks like. Bypassing with script raise. Maybe a factorio bug

According to Bilka, "[y]ou have to keep your own Lua-based filtering code around in the event so that other mods raising events doesn't break things." Kind of defeats the purpose of event filtering, but I've just uploaded a fixed version of my mod.

4 years ago

That is what it looks like. Bypassing with script raise. Maybe a factorio bug

According to Bilka, "[y]ou have to keep your own Lua-based filtering code around in the event so that other mods raising events doesn't break things." Kind of defeats the purpose of event filtering, but I've just uploaded a fixed version of my mod.

Yep. We have to add double filters to the events. Worth it only in those cases the of a mod that consumes too much processing...

4 years ago

Yep. We have to add double filters to the events. Worth it only in those cases the of a mod that consumes too much processing...

Which may really just about anything -- not just mods like Autodrive that do lots of expensive operations on every tick. For example, my mod abuses on_built_entity to see if the keys are used to claim, lock/unlock, or summon a vehicle. This doesn't happen really that often (in single player mode, at least -- and relatively speaking, of course). But the event will fire for every single entity -- assembler, wall, transport belt, rocket silo etc. -- that is built, and as building stuff is a main part of Factorio, my function for that event will be entered very often. Same thing is true for on_entity_died: drive your tank through a forest killing trees left and right, aggro enough biters so they come running into your line of fire, or use nukes on a big patch of spawners, and you will see that function getting used very frequently. So event filtering could be very useful if it was implemented correctly.

Anyway, I've disabled it again for now. Makes little sense to use it because I still need the double filters -- and it prevents people who are using the stable version of Factorio from updating my mod. I'll add filtering again once the next version has been declared stable, which hopefully won't take longer than a few weeks. :-D

4 years ago

I don't understand - why don't you have events fire when the player uses the keys ? Is that not possible ?

4 years ago

Event filtering seemed to work:

script.on_event(defines.events.on_built_entity, function(event)
…
end, { {filter = "name", name = "car-key"} })

Debugging output inside the function showed that it was only entered when I used the keys -- not when I placed anything else. But it's different with RCS: You seem to place down the rocket silo, but actually you place RCS stage 1. If that is finished, the mod -- not you! -- raises the event. But events raised by script won't be filtered for some reason. Here is Bilka's comment on the topic.

New response