Search found 235 matches

by PFQNiet
Thu Mar 25, 2021 1:37 am
Forum: Modding help
Topic: Detect placement of blueprint
Replies: 2
Views: 528

Detect placement of blueprint

What is the proper way to respond to a blueprint being placed? I would like to have a table of ghosts to do stuff with. Would this be done as just a large number of entity creation events where the entity is a ghost? If so, how would I tell the difference between an item holding a single entity, or ...
by PFQNiet
Sun Mar 21, 2021 10:33 am
Forum: Modding interface requests
Topic: Allow items and fluids in a selector
Replies: 2
Views: 287

Re: Allow items and fluids in a selector

"Signals" also includes virtual signals, though, which may not be wanted.
by PFQNiet
Wed Mar 17, 2021 10:34 pm
Forum: Modding discussion
Topic: I'll do Factorio style art for your mod for free!
Replies: 2
Views: 409

Re: I'll do Factorio style art for your mod for free!

Do you have any examples of your work to show? I understand you're offering to do this to build a portfolio in the first place, but it may be helpful to show us that you're a capable artist :)
by PFQNiet
Wed Mar 10, 2021 9:04 am
Forum: Not a bug
Topic: [1.1.26] Modded recipes producing tiny amounts of fluid produce zero instead
Replies: 4
Views: 385

[1.1.26] Modded recipes producing tiny amounts of fluid produce zero instead

My mod - among many other things - rescales fluids to closer match the numbers of solid items being used. So instead of a recipe for example taking 1 iron plate, 5 sulfur, 100 water to make 50 sulfuric acid, it would take 1 plate, 5 sulfur, 10 water and produce 5 acid. This is an overhaul mod and I'...
by PFQNiet
Wed Mar 10, 2021 2:02 am
Forum: Implemented mod requests
Topic: on_item_request_removed
Replies: 18
Views: 1760

Re: on_item_request_removed

Does "register_on_entity_destroyed" not work for item request proxies? Because that might be a helpful first step. You'd have to determine if it was caused by the requesting entity being destroyed, or the player cancelling the request, or it being fulfilled, but it could be wrangled. Alter...
by PFQNiet
Tue Mar 09, 2021 10:05 am
Forum: Modding help
Topic: Power details
Replies: 0
Views: 161

Power details

I'm a little bit confused by how power works and am hoping someone can help out! I first noticed that if I have exactly 20MW of production, and exactly 20MW of consumption, the order of things matters. Specifically, if I had more production and then remove production until I'm down to 20MW, everythi...
by PFQNiet
Mon Mar 08, 2021 11:14 am
Forum: Modding interface requests
Topic: "hidden" flag and Production window
Replies: 1
Views: 212

"hidden" flag and Production window

Maybe I'm just using "hidden" wrong, I don't know. But I have a fluid with "hidden = true", as it is used as an abstraction in my mod. It is part of a recipe for a specific assembling-machine entity and I don't want it to appear in production stats. I do, however, want the consum...
by PFQNiet
Mon Mar 08, 2021 8:36 am
Forum: Modding help
Topic: Detecting insufficient power
Replies: 1
Views: 185

Re: Detecting insufficient power

Answering my own question here: no.

"low_power" is only triggered when power production falls below 75% of demand, so is insufficient for detecting a lack of power.

Instead, compare `energy` with `electric_buffer_size`. This ratio shows how much demand is being met.
by PFQNiet
Sun Mar 07, 2021 11:48 am
Forum: Modding help
Topic: Detecting insufficient power
Replies: 1
Views: 185

Detecting insufficient power

Given an electric energy interface that consumes energy, is it sufficient to check entity.status == defines.entity_status.low_power?
by PFQNiet
Sun Mar 07, 2021 11:23 am
Forum: Modding help
Topic: Generator and scale_fluid_usage
Replies: 4
Views: 322

Re: Generator and scale_fluid_usage

Oh I see, it's to do with fluid temperatures. Gotcha. So it's looking like I'll need to go with script-driven. Which... is actually fine, since I have another entity that is already script-driven and I've optimised quite well. Unless someone has an idea for how to do it with built-in entities, I'll ...
by PFQNiet
Sun Mar 07, 2021 4:51 am
Forum: Modding help
Topic: Generator and scale_fluid_usage
Replies: 4
Views: 322

Re: Generator and scale_fluid_usage

I've just noticed that it defaults to `false` anyway so no wonder nothing changed when I manually set it to `false`!

So I may need to go with a script-driven entity if I want to do this... That's awkward, but manageable.
by PFQNiet
Sun Mar 07, 2021 3:58 am
Forum: Modding help
Topic: Generator and scale_fluid_usage
Replies: 4
Views: 322

Generator and scale_fluid_usage

I have a generator entity and I would like it to consume fluid at a constant rate regardless of power consumption on the network. I thought `scale_fluid_usage = false` would do that, but apparently not. The property didn't seem to have any effect and eventually my test setup became fully backed up o...
by PFQNiet
Fri Feb 26, 2021 9:09 am
Forum: Modding help
Topic: [Tutorial] PNG size optimization
Replies: 14
Views: 1294

Re: [Tutorial] PNG size optimization

I use an online compressor it limits colors to 256 Urg. Non-automatable dubious "service" that does god-who-knows to your pictures. I hope you didn't catch any virusses. It just... all it does is change the PNG image mode from RGB to Indexed. And that's all you need to do too. Here's my &...
by PFQNiet
Sat Feb 06, 2021 12:26 am
Forum: Modding help
Topic: How does electric wiring work?
Replies: 15
Views: 856

Re: How does electric wiring work?

Well personally I wouldn't let a difference between 4.6 and 4.7ms to be an obstacle to this really cool idea :D It would be nice to get some dev confirmation but it does seem like connections are somehow position-based. What if you offset the pole by half a tile in the direction of the rail? You'll ...
by PFQNiet
Mon Feb 01, 2021 12:39 pm
Forum: Modding help
Topic: ss_Baum's questions, now:Add circuit network condition
Replies: 33
Views: 1703

Re: ss_Baum's questions, now:Event code runtime

Yes, when an event is triggered, it happens immediately. Factorio is (mostly) single-threaded and everything happens in sequence.
by PFQNiet
Sun Jan 31, 2021 1:06 am
Forum: Modding help
Topic: ss_Baum's questions, now:Add circuit network condition
Replies: 33
Views: 1703

Re: ss_Baum's questions, now:Start a for-loop for a table from a specific entry

If your table is an array then you can use a more "typical" for loop:

Code: Select all

for i=start,start+100 do
  local entity = entities[i]
  if not entity then break end
  -- ...
end
by PFQNiet
Sat Jan 30, 2021 5:53 pm
Forum: Mods
Topic: [1.1] Looking for playtesters: Satisfactorio
Replies: 1
Views: 456

[1.1] Looking for playtesters: Satisfactorio

Hello! I have been working on an overhaul mod since September, and today I'd like to (very tentatively) put it out into the world for playtesting. Satisfactorio : An overhaul mod that replicates Satisfactory in Factorio's engine. Inspired by a Satisfactory mod that introduces Factorio-like elements,...
by PFQNiet
Fri Jan 29, 2021 12:17 pm
Forum: Modding help
Topic: ss_Baum's questions, now:Add circuit network condition
Replies: 33
Views: 1703

Re: ss_Baum's questions, now: how to code efficient with the factorio api

"UPS efficiency" is... a bit of a cult obsession around here :p But realistically, many of the more "quirky" mods like your transport belt idea are just that: quirky. Nobody is going to build a megabase with your mod, and that's okay. In fact, beyond early-game, people aren't lik...
by PFQNiet
Thu Jan 28, 2021 8:56 pm
Forum: Won't implement
Topic: Change on_pre_build for power poles built by dragging
Replies: 1
Views: 237

Change on_pre_build for power poles built by dragging

When dragging a power pole, on_pre_build is fired for every position that the player's cursor moves over, without regard for whether a power pole is actually built. There doesn't appear to be any way in Lua to detect whether the placement will result in a power pole being built. I can work around th...

Go to advanced search