Search found 37 matches

by aaron311
Fri Oct 10, 2025 12:07 pm
Forum: Modding help
Topic: play_sound(...) - is there any 'rate limit' to the API?
Replies: 4
Views: 224

Re: play_sound(...) - is there any 'rate limit' to the API?

Thanks for confirming! I am willing to send you my code if I get desperate, but let me troubleshoot more before I burn more of your time. :)

I was already thinking this was a PEBKAC error on my part, and just wanted to rule out that there was some subtle API misunderstanding I had. Your replies ...
by aaron311
Fri Oct 10, 2025 3:59 am
Forum: Modding help
Topic: play_sound(...) - is there any 'rate limit' to the API?
Replies: 4
Views: 224

Re: play_sound(...) - is there any 'rate limit' to the API?

play_sound() calls can not play the sound if it would play with 0 volume due to it being played too far from the listener, if the sound position is covered by fog of war

Makes sense. But in this case I'm using luaForce.play_sound() with a nil PlaySoundSpecification.position thus I believe it's ...
by aaron311
Tue Oct 07, 2025 2:00 am
Forum: Modding help
Topic: play_sound(...) - is there any 'rate limit' to the API?
Replies: 4
Views: 224

play_sound(...) - is there any 'rate limit' to the API?

Hi,

I have a mod that (conditionally) uses luaForce.play_sound(...) in a on_entity_died event handler. Despite my best efforts and tracing through with a debugger, I'm finding that the sound does not reliably play despite the function call for sure executing.

Is there any circumstance where play ...
by aaron311
Mon Sep 29, 2025 10:16 pm
Forum: Modding interface requests
Topic: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)
Replies: 9
Views: 1047

Re: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)

Ah, makes sense. Still, if you could comment with example types of things that needed to be "rolled back" via a custom mechanism for a mod, we could try to start making a list of things that would need to have a solution. IDK. Just a thought.
by aaron311
Mon Sep 29, 2025 12:46 pm
Forum: Modding interface requests
Topic: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)
Replies: 9
Views: 1047

Re: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)

Hi folks,

Thank you for the interest, discussion, and suggestions!

The more I think I’m about an uninstall script the more I am convinced that - while it would represent a lot of flexibility - it does not make sense architecturally. I also think that it sets up uninstalls to nearly “always fail ...
by aaron311
Wed Sep 17, 2025 11:23 pm
Forum: Modding interface requests
Topic: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)
Replies: 9
Views: 1047

Re: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)

Another example situation I just hit right now when writing a mod. In my mod, I did this:

player.mute_alert(defines.alert_type.entity_destroyed)

I load a save with my mod. Save game. Then I disable mod. File no longer plays alerts anymore even with mod removed.

It would be great if Factorio ...
by aaron311
Thu Apr 03, 2025 11:09 pm
Forum: Modding interface requests
Topic: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)
Replies: 9
Views: 1047

Re: Mod "garbage collection" via some means (not sure what would make sense, though)

Something I realized after posting this is that while I like the general concept of being able to attach a 'mod owner' to global state objects like luaForce, cleanup does get a bit complicated if you have a structure where one force is defined as collapsing into another when the mod goes away, but ...
by aaron311
Wed Apr 02, 2025 12:06 am
Forum: Modding interface requests
Topic: Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)
Replies: 9
Views: 1047

Mod-associated permanent-state "garbage collection" via some means (not sure what would make sense, though)

Hey,

This is only a half-formed request, but interested in what people might think -

I don't do much modding, but I did publish a mod back in the 1.0/1.1 days, and thinking about resurrecting it for 2.0, now. It was a semi-evil mod that made force changes in order to accomplish prioritization of ...
by aaron311
Mon Feb 03, 2025 3:36 pm
Forum: Ideas and Suggestions
Topic: Roboports should output missing materials to circuit network / Roboports emit signals with missing blueprint items
Replies: 163
Views: 71852

Re: Roboports should output missing materials to circuit network / Roboports emit signals with missing blueprint items

Hey,

So for years I've wanted this functionality as well (to set up remote outposts that auto-request delivery of missing requests). I've used Ghost Scanner at various times in small networks when the performance impacts were acceptable (many to the original author of Ghost Scanner and all those ...
by aaron311
Thu Jan 30, 2025 12:30 am
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

Re: "Noob" prototype "type checking" question

Got it! Thanks. I think I wasn't properly interpreting the description of the 'type' property which is what confused me initially.
by aaron311
Wed Jan 29, 2025 1:23 pm
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

Re: "Noob" prototype "type checking" question

Hi @Xorimuth,

Thank you for your helpful and insightful commentary.




I don't think pairs() will work for what you want either, using pairs() on a LuaObject will not iterate through all valid properties, it will generally do nothing. (I think for some things, it can be used, like for a ...
by aaron311
Wed Jan 29, 2025 4:04 am
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

Re: "Noob" prototype "type checking" question

Update - ahh, yes, now I remember why I started down this path. It's because attempting to access a property that doesn't apply to an entity will trigger an exception rather than returning nil. THAT'S why I was trying to detect the type proactively and only THEN read properties I knew would exist ...
by aaron311
Tue Jan 28, 2025 2:58 am
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

Re: "Noob" prototype "type checking" question

Got it, thanks for the help!
by aaron311
Mon Jan 27, 2025 11:15 pm
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

Re: "Noob" prototype "type checking" question


I get the sense that you might be assuming that the Factorio prototype system is a lot more "object oriented" than it really is, which could be why you're struggling. A prototype in Factorio is really more just a clump of data telling the game engine what it is. On the C++ side, there's a whole ...
by aaron311
Mon Jan 27, 2025 9:09 pm
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

Re: "Noob" prototype "type checking" question

Gotcha. So in the case where a mod is extending an existing prototype, checking .type (instead of .name) would return the same Lua *Prototype class of the 'base' object despite it potentially having a different prototype name due to deepcopy+extend? Is that it? Or is it possible to modify .type when ...
by aaron311
Sun Jan 26, 2025 9:58 pm
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 1968

"Noob" prototype "type checking" question

Sorry. Bit of a concept question here, definitely of the 'noob' variety -

So, despite having written a mod for Factorio I still struggle a lot with the concept of prototypes in the game and what that actually "means" (my mod didn't deal with too much custom prototype stuff, etc. hence why I think ...
by aaron311
Fri Mar 15, 2024 3:31 pm
Forum: News
Topic: Friday Facts #402 - Lightspeed circuits
Replies: 170
Views: 59353

Re: Friday Facts #402 - Lightspeed circuits

First off, I LOVE what you're doing with the expansion. Secondly, I LOVE your latest series of FFF.

None of the following criticisms are intended to detract from either of these. :lol:

I was super excited to see the wireless signal transmission feature of the Radars until I read this:

So we ...
by aaron311
Sun Oct 23, 2022 6:45 pm
Forum: Documentation Improvement Requests
Topic: Documentation Improvement Requests
Replies: 316
Views: 131068

Re: Small documentation improvement requests

Hello,

I really found the "Data Lifecycle" documentation page very helpful when I was reading it the other day struggling to remember how the various initialization-related events worked. It's great, but there were a few outstanding questions in my mind after reading it.


#1. I had a question ...
by aaron311
Thu Oct 20, 2022 11:25 pm
Forum: Modding help
Topic: Pedantic double-check: on_configuration_changed() always fires when game version changes?
Replies: 3
Views: 1506

Re: Pedantic double-check: on_configuration_changed() always fires when game version changes?

Super helpful, thank you!

@boskid if it's all right with you I might try to distill your detailed answer into a small set of enhancements to be added to the Data Lifecycle documentation page.

Go to advanced search