Search found 91 matches

by danielbrauer
Thu Apr 04, 2019 6:13 pm
Forum: Modding help
Topic: Looking for a Set data structure
Replies: 11
Views: 175

Re: Looking for a Set data structure

These guys recommend a table of bools indexed by whatever you want in your set: https://www.lua.org/pil/11.5.html
by danielbrauer
Wed Apr 03, 2019 11:32 pm
Forum: Won't implement
Topic: Raise events by default
Replies: 4
Views: 323

Re: Raise events by default

They events specifically are not raised by default because otherwise every single mod out there would have to care about other mods messing with their state when they perform what is supposed to be a non-intrusive operation. I guess my question is what you mean by “non-intrusive”? The entities on t...
by danielbrauer
Tue Apr 02, 2019 10:18 pm
Forum: Won't implement
Topic: Raise events by default
Replies: 4
Views: 323

Raise events by default

Would it make more sense for LuaSurface::create_entity() and LuaEntity::destroy() to raise events by default? Right now they default to running silently, and I've noticed a lot of mods create or destroy things without raising events. This makes it hard to keep track of which entities exist without r...
by danielbrauer
Tue Apr 02, 2019 3:34 pm
Forum: Modding interface requests
Topic: API usage validation
Replies: 2
Views: 234

API usage validation

I recently encountered a problem where other mods are not correctly passing an entity when raising the script_raised_built event. I can program defensively, but the current situation means every mod developer needs to program defensively just to avoid errors. It would be super cool if Factorio consi...
by danielbrauer
Sat Mar 30, 2019 1:28 am
Forum: Modding help
Topic: Sprite transparency threshold
Replies: 11
Views: 632

Re: Sprite transparency threshold

Here is a mod which shows two test sprites. The source images are identical, but one has no-crop.
CropTest_0.0.0.zip
(81.95 KiB) Downloaded 30 times
This is what it looks like in 0.17.14:

Image

Oddly enough, in 0.17.22 both sprites are missing the zero alpha section.
by danielbrauer
Fri Mar 29, 2019 2:13 pm
Forum: Resolved Problems and Bugs
Topic: [0.17.2] UI Scale slider doesn't do anything when set to Automatic
Replies: 9
Views: 262

Re: [0.17.2] UI Scale slider doesn't do anything when set to Automatic

Thanks for reconsidering!
FactorioBot wrote:
Fri Mar 29, 2019 12:44 pm
Changed the custom scale slider in interface settings to be disabled when automatic scale is selected.
by danielbrauer
Fri Mar 29, 2019 1:08 pm
Forum: Releases
Topic: Version 0.17.22
Replies: 5
Views: 5967

Re: Version 0.17.22

Thanks for the update! I haven't seen this in the release notes (for .15 or since then) so I just wanted to check if it slipped through the cracks: In 0.17.15 cropping will check all channels are zero not just alpha. From my own testing it seems to work as before (transparent pixels get cropped even...
by danielbrauer
Sat Mar 23, 2019 4:34 pm
Forum: Modding help
Topic: Need Solution to Deadlock
Replies: 2
Views: 166

Re: Need Solution to Deadlock

It sounds like the general problem is units shooting at things which are immune to their attacks. In this case it lasts forever and so it’s obviously silly, but even if you’re vulnerable to an enemy it doesn’t make sense to attack it for zero damage. So if it’s possible to not attack enemies which a...
by danielbrauer
Wed Mar 20, 2019 5:40 pm
Forum: Modding help
Topic: Sprite transparency threshold
Replies: 11
Views: 632

Re: Sprite transparency threshold

posila wrote:
Sun Mar 17, 2019 7:37 pm
In 0.17.15 cropping will check all channels are zero not just alpha.
I didn't see any mention of this in the release notes, and in my tests I'm still seeing pixels with non-zero colour being cropped. Did the change perhaps get missed?
by danielbrauer
Wed Mar 20, 2019 11:03 am
Forum: Modding help
Topic: Keeping track of all the things
Replies: 4
Views: 252

Re: Keeping track of all the things

AlienX wrote:
Tue Mar 19, 2019 12:40 am
Just to answer your question of when does "on_entity_cloned" happen.
Thanks for the info!
by danielbrauer
Mon Mar 18, 2019 10:07 am
Forum: Releases
Topic: Version 0.17.14
Replies: 30
Views: 11757

Re: Version 0.17.14

Worst is though the inconsistency with treadmills and inserter, of the treadmill going on for a few pixel. Will there be an option if this goes live to have the old look? This sort of problem is best handled with mods. Adding options in the game means the developers have to deal with the resulting ...
by danielbrauer
Sun Mar 17, 2019 10:26 pm
Forum: Modding help
Topic: Can't upload mod to portal
Replies: 2
Views: 148

Re: Can't upload mod to portal

Ah of course, thank you! I forget that Mac OS creates a root folder when unzipping, even if it wasn't present in the zip.
by danielbrauer
Sun Mar 17, 2019 10:04 pm
Forum: Modding help
Topic: Can't upload mod to portal
Replies: 2
Views: 148

Can't upload mod to portal

I keep getting an error about not having the right directory structure, but it's as straightforward as could be. I created the zip with git archive --format zip But I get this error from the form: Error: Your mod ZIP has the wrong structure. Mod files including info.json must be in a directory. (cod...
by danielbrauer
Sun Mar 17, 2019 9:19 pm
Forum: Modding help
Topic: Keeping track of all the things
Replies: 4
Views: 252

Re: Keeping track of all the things

Thanks for the confirmation. Hooking into these calls does seem to be working.
by danielbrauer
Sun Mar 17, 2019 9:18 pm
Forum: Modding help
Topic: Sprite transparency threshold
Replies: 11
Views: 632

Re: Sprite transparency threshold

Fantastic, thanks!
by danielbrauer
Sat Mar 16, 2019 6:19 pm
Forum: Modding help
Topic: Keeping track of all the things
Replies: 4
Views: 252

Keeping track of all the things

I'd like to have a list of all science labs at all times. Obviously doing this with find_entities_filtered every frame is a colossal waste. Does the API provide all the events I need to maintain my list? I'm not 100% sure which events I should be looking at: on_built_entity on_entity_cloned -- When ...
by danielbrauer
Sat Mar 16, 2019 5:23 pm
Forum: Modding help
Topic: Trouble getting data to persist
Replies: 2
Views: 101

Re: Trouble getting data to persist

That was it, thank you! Moving the global references into callbacks fixed the issue, and now my table appears to persist.
by danielbrauer
Sat Mar 16, 2019 2:58 pm
Forum: Modding help
Topic: Trouble getting data to persist
Replies: 2
Views: 101

Trouble getting data to persist

Hey, I'm having trouble keeping track of animations I've created across loads. My code looks like this: if global.labAnimations == nil then global.labAnimations = {} end local labAnimations = global.labAnimations -- table is filled out like this when iterating through all labs: if labAnimations[lab....
by danielbrauer
Fri Mar 15, 2019 10:52 am
Forum: Modding help
Topic: How do I tell if a lab is running?
Replies: 2
Views: 97

Re: How do I tell if a lab is running?

Will do! Just making sure there isn't a more straightforward way to figure out if it's running.
by danielbrauer
Fri Mar 15, 2019 10:51 am
Forum: Modding help
Topic: Sprite transparency threshold
Replies: 11
Views: 632

Re: Sprite transparency threshold

Thanks, turning off cropping fixed the issue. I guess my other solution is better if I'm trying to keep overdraw down though, right?

Go to advanced search