Search found 235 matches

by PFQNiet
Sun Nov 08, 2020 6:20 am
Forum: Modding help
Topic: Filtering an event vs handling event with if - performance.
Replies: 7
Views: 580

Re: Filtering an event vs handling event with if - performance.

I would have to assume that using an event filter is significantly faster, otherwise the option wouldn't exist. However, the downside is that you can only have one event handler per event, and therefore only one filter. If you want multiple filters, you will need to go the `if` route. You should sti...
by PFQNiet
Sun Nov 08, 2020 5:22 am
Forum: Modding interface requests
Topic: Add modifier keys used to on_player_used_spider_remote
Replies: 7
Views: 560

Re: Add modifier keys used to on_player_used_spider_remote

Depending on event order, you might be able to listen for both the CustomInput and the on_player_used_spider_remote events, and amalgamate them. If a shift-click happens in the same tick that the player used a spider remote, then ta-da there's your modifier keys on the spider remote!
by PFQNiet
Sat Nov 07, 2020 9:58 am
Forum: Resolved Problems and Bugs
Topic: [Rseding91] Removing fluid from train via script doesn't reset inactivity
Replies: 1
Views: 935

[Rseding91] Removing fluid from train via script doesn't reset inactivity

Test setup: build a rail, a train stop, and a train with a cargo and fluid wagon. Send the train to the stop with "inactivity" set to like a minute. Tests: - With the cargo wagon selected... /c game.player.selected.insert{name="iron-plate",count=100} The train's inactivity timer ...
by PFQNiet
Sat Nov 07, 2020 8:41 am
Forum: Modding help
Topic: Fluids, Trains and Inactivity
Replies: 2
Views: 190

Re: Fluids, Trains and Inactivity

Huh, I just tested in vanilla with a simple: game.player.selected.insert_fluid{name="water",amount=100} And the inactivity timer reset just fine. So something's wrong with my mod code. Time for debugging my own problems! EDIT: nvm, it works now. I must've done something else wrong and acci...
by PFQNiet
Fri Nov 06, 2020 6:52 pm
Forum: Modding help
Topic: Fluids, Trains and Inactivity
Replies: 2
Views: 190

Fluids, Trains and Inactivity

Okay so I have modded a building that loads stuff into a parked train. For solid items, this works great as every time the script transfers a stack into the train, it resets the train's "inactivity" timer. However, for fluids, a change in the fluid wagon's contents does not seem to be rese...
by PFQNiet
Wed Nov 04, 2020 8:23 am
Forum: Modding interface requests
Topic: Apply built-in tooltips to custom GUI elements
Replies: 8
Views: 724

Apply built-in tooltips to custom GUI elements

I have a custom GUI element that it would be nice to have an item tooltip on. Or a recipe tooltip. Or whatever vanilla tooltip may be best applicable to the use case. Unfortunately it seems that the tooltip is limited to LocalisedString. It would be nice if we could have something like a TooltipSpec...
by PFQNiet
Wed Nov 04, 2020 8:07 am
Forum: Implemented mod requests
Topic: LuaEntityPrototype::max_power_production read
Replies: 3
Views: 322

Re: LuaEntityPrototype::max_power_production read

There's no easy way to calculate this at the moment. Generators consume a fixed amount of fluid per tick, and the power produced is a function of that consumption and the fluid's temperature and heat capacity. If the generator's fluid box is suitably locked down (filtered to a single fluid, and lock...
by PFQNiet
Tue Nov 03, 2020 3:27 pm
Forum: Modding help
Topic: Biters attack indestructible cars
Replies: 5
Views: 196

Re: Biters attack indestructible cars

I solved my problem like so: local function onDamaged(event) if event.entity.type == "car" then local driver = event.entity.get_driver() if not driver and event.cause and event.cause.type == "unit" then event.cause.set_command{ type = defines.command.stop, ticks_to_wait = 1 } end...
by PFQNiet
Tue Nov 03, 2020 2:36 pm
Forum: Modding help
Topic: Biters attack indestructible cars
Replies: 5
Views: 196

Re: Biters attack indestructible cars

Well, I can confirm that if an unoccupied car coasts into enemy territory then the biters do indeed ignore it. I ran in to chase after the car and aggro'd them myself, then when I got into the car they started attacking it, and when I left the car they stayed attacking it. So it does indeed seem lik...
by PFQNiet
Tue Nov 03, 2020 1:42 pm
Forum: Modding help
Topic: Biters attack indestructible cars
Replies: 5
Views: 196

Biters attack indestructible cars

Normally enemies don't bother attacking indestructible things, since they're... well, indestructible. But I just drove this indestructible car into a biter camp and got out. They completely ignored me, even when I attacked them myself, instead remaining fixated on the car. https://media.discordapp.n...
by PFQNiet
Tue Nov 03, 2020 1:35 pm
Forum: Modding help
Topic: Override Storage Value for Storage Tank Prototype
Replies: 4
Views: 247

Re: Override Storage Value for Storage Tank Prototype

If you make the fluid box height higher than 1 then pipes won't be able to fill it! But pumps would be able to, up to a height of 4.

It's definitely the area that you want to change in order to make the storage bigger.
by PFQNiet
Tue Nov 03, 2020 6:49 am
Forum: Modding help
Topic: Fast-replace pipe with modded storage tank
Replies: 4
Views: 284

Re: Fast-replace pipe with modded storage tank

Except that you can place a pump over two pipes and fast-replace them that way. I was hoping to get that behaviour with my entity.
by PFQNiet
Tue Nov 03, 2020 6:47 am
Forum: Modding help
Topic: Override Storage Value for Storage Tank Prototype
Replies: 4
Views: 247

Re: Override Storage Value for Storage Tank Prototype

Storage is based on the fluid box size. storage = fluid_box.base_area * fluid_box.height * 100 In the case of the vanilla storage tank, that's 250 * 1 * 100 = 25k storage. So if you want a specific storage, let's say 100k, divide that by 100 and set that as the base_area (since messing with "he...
by PFQNiet
Mon Nov 02, 2020 2:21 pm
Forum: Modding interface requests
Topic: Make ItemWithLabel::label accept LocalisedString
Replies: 2
Views: 281

Make ItemWithLabel::label accept LocalisedString

I have a tool that is used by holding it in the cursor. I'd like to use its label to provide feedback to the user, but it only supports strings, not LocalisedString. This would be fine for, say, numeric feedback, but I want it to say "no signal" under certain circumstances and I can't do t...
by PFQNiet
Sat Oct 31, 2020 8:17 pm
Forum: Modding help
Topic: What makes a "flee" command complete?
Replies: 0
Views: 147

What makes a "flee" command complete?

The "flee" command can be given to units to make them run away from something. But there doesn't appear to be any way to specify how far away they should try to get, or how long they should flee for. Is it possible to set either of these? Or are these hard-coded (and if so to what values)?...
by PFQNiet
Sat Oct 31, 2020 6:05 pm
Forum: Resolved Problems and Bugs
Topic: [posila] [1.0.0] Crash modding capsule with warmup
Replies: 1
Views: 224

[posila] [1.0.0] Crash modding capsule with warmup

As far as I can tell this should be as simple to reproduce as: data.raw.capsule['raw-fish'].capsule_action.attack_parameters.warmup = 30 Then, attempting to use a fish causes the game to crash. Extract from the log: Factorio crashed. Generating symbolized stacktrace, please wait ... c:\cygwin64\tmp\...
by PFQNiet
Thu Oct 29, 2020 8:28 pm
Forum: Won't implement
Topic: Concave polygons
Replies: 6
Views: 689

Concave polygons

Just found out the hard way that attempting to call rendering.draw_polygon with vertices that aren't a convex hull results in odd and unpredictable results. My workaround is having to break the shape down into convex parts myself and render them separately, which is not ideal. Could support for conc...
by PFQNiet
Thu Oct 29, 2020 1:23 pm
Forum: Modding help
Topic: Fast-replace pipe with modded storage tank
Replies: 4
Views: 284

Fast-replace pipe with modded storage tank

I have what is effectively an inline storage tank (it has some script behaviour but that's not important). It's 2x1 just like the Pump. I'd like for the player to be able to fast-replace pipes with this entity just like you already can with pumps, however just setting its "fast_replaceable_grou...
by PFQNiet
Thu Oct 29, 2020 9:51 am
Forum: Modding help
Topic: Enable/disable train stop with script
Replies: 0
Views: 140

Enable/disable train stop with script

I can toggle the state of things like assembly machines with "entity.active = false" and it will show a status of "Disabled by script". But I notice that train stops aren't listed as active ("game.print(stop.active)" shows "false" at all times and it cannot be...
by PFQNiet
Thu Oct 29, 2020 8:47 am
Forum: Modding help
Topic: Location ping
Replies: 2
Views: 249

Re: Location ping

You can game.print() (or player.print(), force.print() as appropriate) with:

Code: Select all

game.print("[gps=0,0]")
This basically does the same as the player pinging that location on the map, and the player can click on it in the chat log to open the map to that position.

Go to advanced search