Search found 9 matches

by wasmoo
Fri Aug 11, 2023 3:02 am
Forum: Modding help
Topic: Access to entity prototype's "action" field
Replies: 5
Views: 1255

Re: Access to entity prototype's "action" field

Seems like there are more nuances with `nested_result`. Sometimes it has an `action` and sometimes it's just an array of TriggerEffectItem.
by wasmoo
Thu Aug 10, 2023 10:32 pm
Forum: Modding help
Topic: Access to entity prototype's "action" field
Replies: 5
Views: 1255

Re: Access to entity prototype's "action" field

Thank you. The issue seems to be that the "nested-result" TriggerEffectItem has a type of nil. This code logs the nil type:


for _,prototype in pairs({game.entity_prototypes["land-mine"]}) do
for a_index,trigger_item in pairs(prototype.attack_result or {}) do
for d_index,trigger_delivery in ...
by wasmoo
Wed Aug 09, 2023 12:39 pm
Forum: Modding help
Topic: Access to entity prototype's "action" field
Replies: 5
Views: 1255

Re: Access to entity prototype's "action" field

I was able to create a workaround where I create an `ammo-type` for the action.
However, this had a different problem where the "nested-result" effect had a type of "nil", and I couldn't retrieve the underlying action.
by wasmoo
Wed Aug 09, 2023 6:31 am
Forum: Modding help
Topic: Access to entity prototype's "action" field
Replies: 5
Views: 1255

Access to entity prototype's "action" field

I'm trying to dynamically determine the "damage-type" of the cursor's item stack. For example, if holding a "poison-capsule", I want to find the damage-type "poison".

However, for poison capsules, the damage isn't done by the thrown attack_parameters, but rather from a smoke-with-trigger that has ...
by wasmoo
Wed Mar 24, 2021 10:55 pm
Forum: Modding interface requests
Topic: [1.1.28] No pollution from Heat Energy Source
Replies: 3
Views: 1729

[1.1.28] No pollution from Heat Energy Source

I created a heat-powered radar:

radar.energy_source = {
type = "heat",
max_temperature = 2000,
default_temperature = 15,
specific_heat = "100KJ",
max_transfer = "1000YW",
min_temperature_gradient = 1,
min_working_temperature = 100,
minimum_glow_temperature = 80,
pipe_covers = data.raw ...
by wasmoo
Wed Mar 24, 2021 12:55 am
Forum: Modding interface requests
Topic: [1.1.27] Way to detect type of fast transfer
Replies: 0
Views: 760

[1.1.27] Way to detect type of fast transfer

I am making a mod that implements a burner-powered roboport. I do this by forcing buildings on the same location (a roboport, a power pole, and a burner-generator.) I want to allow the user to fast-transfer fuel into the generator.

Currently, I have code that detects when the user attempts to fast ...
by wasmoo
Tue Jul 21, 2020 5:07 am
Forum: Not a bug
Topic: [0.18.36] Set energy doesn't work on misc types
Replies: 1
Views: 948

[0.18.36] Set energy doesn't work on misc types

I attempted to set the energy levels of certain entities from an on_tick() function.


function setEnergy(entity)
entity.energy = 999999999
end


The following types of entities could not achieve full power, even when energy was set very high:
lamp
decider-combinator
arithmetic-combinator ...
by wasmoo
Tue Jul 21, 2020 5:02 am
Forum: Resolved Problems and Bugs
Topic: [Rseding91] [0.18.36] Energy lost when setting energy on a heat buffer
Replies: 1
Views: 3242

[Rseding91] [0.18.36] Energy lost when setting energy on a heat buffer

I created a mod that adds heat-powered buildings. When I attempted to set the energy level of one of these buildings, the power value was set to 0, and the temperature was reduced to the min_working_temperature. (Setting temperature worked fine.)

Here's a minimalist example:


-- data.lua
local ...
by wasmoo
Mon Apr 27, 2020 12:26 pm
Forum: Ideas and Requests For Mods
Topic: Modular energy_source for entities
Replies: 0
Views: 817

Modular energy_source for entities

I'd like to recreate every entity with each energy source. Here are the ones I've had to hack:
solar panels
roboport
beacon
electric-turret

My current hack is to create an invisible generator and electric-pole on the same spot, but certain behaviors still don't work correctly, like the UI ...

Go to advanced search