Skip to content

Comments

Added an option to make the buildings semi-transparent instead of cropping them outright.#3

Open
Maoman1101 wants to merge 5 commits intoAtria1234:masterfrom
Maoman1101:master
Open

Added an option to make the buildings semi-transparent instead of cropping them outright.#3
Maoman1101 wants to merge 5 commits intoAtria1234:masterfrom
Maoman1101:master

Conversation

@Maoman1101
Copy link

@Maoman1101 Maoman1101 commented Oct 2, 2025

Hello! As the title says; it's an optional setting and has a customizeable strength. I also updated the changelog and info.json for you so all you should have to do is accept the pull request and it'll be ready for upload to the mod portal. I've tested it in game and it still works both ways.

The "show diff" section below just highlighted the entire file for some reason, so process_sprite_parameters in processing.lua is the key function, at line 43. That's the only "real" code I changed. Everything else is just adding settings and editing json and stuff.

@Maoman1101
Copy link
Author

Maoman1101 commented Oct 2, 2025

factorio_5qAnKuk0Rp Here's a screenshot of the pyanodon labs with the opacity enabled.

@Maoman1101
Copy link
Author

Maoman1101 commented Oct 2, 2025

Oh I just noticed I forgot a dash on line 5 in the changelog, so don't forget to fix that before uploading.

@Atria1234
Copy link
Owner

Thanks for this. When I first worked on this mod, it was meant to have transparent overhangs. Problem with modifying just the code of process_sprite_parameters is that it doesn't affect everything. There are some other ways how sprites are stored which will still have completely removed overhang.

Also I will not merge this in the current state of delete 800 lines, create 800 lines. What line endings are you use?

@Maoman1101
Copy link
Author

Maoman1101 commented Oct 3, 2025

I'm just editing the text in Notepad++ and saving over the file, then uploading it to my fork. It says 800 lines but really only about a dozen were added to that function process_sprite_parameters, you can see this yourself in the comparison--99% of the code is still original. Then there's the changelog and info.json and settings adding to the total, but it should still be less than 100 lines in total (probably "875 minus 826 lines" if I had to guess) . I don't know why it did that with all 800 lines, I'm not very good with github yet, sorry. If you can tell me how to fix that, I happily will.

I haven't seen any buildings get cropped off yet but I'm only about 50 hours into pyanodons so barely even started really. I did notice that for one block, the animated bits were still opaque but the rest that was static remained transluscent--is that what you're referring to?

@Atria1234
Copy link
Owner

I also don't see why it would show up like this, but I can see the correct diff on my local machine. Looking at the code you are not splitting the sprite in two, you are setting transparency of entire sprite. It might work for you because your sprites are barely transparent, so you don't notice it, but if someone would set the transparency of overhang to 95%, the entire building would disapear.

That is the main problem. Proper overhang transparency means you have to split every sprite which has overhang into two sprites. Some of them are easy to do, but some of them are real pain in the ass. If it remember correctly the Animation.stripes was one of the problems. Splitting animation's stripes would mean it has to replace entire animation with something which can have multiple layers. So it would have to modify every single place where Animation is used to properly handle it. And then there are like 5 more types which are also problematic.

@Maoman1101
Copy link
Author

I tried splitting the sprites like you're suggesting but decided against it after fighting with it for a while. I figured having the entire building transparent was better than having the tops chopped off and rolled with it. It is optional after all. Also the vast majority of people just stick with the default values in any given mod and the default of 80% visible works great, I've been playing with it for hours.

I wouldn't worry about people setting the transparency too high. All that'd happen is they'd realize their mistake and go back and lower the value a little more. If you're seriously concerned about it, just limit the minimum value to 10 or something.

@Atria1234
Copy link
Owner

I'm not sure I want to introduce whole sprite transparency to this mod as it fundamentally differs from what the mod is about. If only the overhang would be transparent, I'd definitely include it, but as it is right now I'll have to think about it.

It might be better to just have a separate mod. It could also be more simple since it wouldn't have to handle sprite replacements when there is an overhang.

@Maoman1101
Copy link
Author

I could do that too, sure. Just thought I'd offer it here first.

@Atria1234
Copy link
Owner

Thanks, I might have another look at making just the overhang transparent, but I fear it will just give me PTSD.

If you want to share your modification of my mod, feel free to publish it as a separate mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants