Access to sprite filenames for entities and items and other things with sprites

Things that we aren't going to implement
Post Reply
sparr
Smart Inserter
Smart Inserter
Posts: 1095
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Access to sprite filenames for entities and items and other things with sprites

Post by sparr »

For entities that have sprites, I would like to be able to find out what file they were loaded from, in the control phase.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by danielbrauer »

Example use case is DiscoScience, where the most resilient way to map colours is by icon rather than tech name (Bob’s Tech, for instance, switches some icons around).

Right now I’m sneaking data out through flying-text, and I can feel Wube glaring at me.

Bilka
Factorio Staff
Factorio Staff
Posts: 2481
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by Bilka »

I saw disco science doing the flying text hack when I recently pointed out some specifics about memory leaks and desyncs. My immediate thought was "why don't they just read the setting that controls the colors in bobs mod and calculate the colors from that (during runtime)", so for this specific use case, why don't you do that?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

sparr
Smart Inserter
Smart Inserter
Posts: 1095
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by sparr »

Because that would mean duplicating a bunch of code from Bob's mods in every other mod that wants to know what color the science packs are, and getting it wrong any time Bob changes the order, which is silly for information that's directly available in the data stage.

PS: Why do the science packs use different sprites instead of tint in the first place?

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by danielbrauer »

Bilka wrote:
Mon Apr 15, 2019 4:15 pm
"why don't they just read the setting that controls the colors in bobs mod and calculate the colors from that (during runtime)"
If I understand correctly, that would be code written just to support one mod. I don’t really care about Bob’s mod in particular: I would like a robust and generic way of associating colours with ingredients.

Rseding91
Factorio Staff
Factorio Staff
Posts: 10758
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by Rseding91 »

I don't consider that a valid use for wanting to read file names. You should be using something like a remote interface to ask the mod what color(s) the packs are otherwise it's just another hack and I won't support it.
If you want to get ahold of me I'm almost always on Discord.

sparr
Smart Inserter
Smart Inserter
Posts: 1095
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by sparr »

Asking each individual mod what color its entities are is a silly hack that won't ever scale.

Bilka
Factorio Staff
Factorio Staff
Posts: 2481
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by Bilka »

sparr wrote:
Wed Apr 17, 2019 8:20 pm
Asking each individual mod what color its entities are is a silly hack that won't ever scale.
Right now it's using file names and hardcoding the color and then transferring that to the control stage using a hack. That's not any better :p
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.


Rseding91
Factorio Staff
Factorio Staff
Posts: 10758
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by Rseding91 »

Additionally, there is no such thing as a "color" for a science pack. That's a made up concept by you/others. That's why you're having such a hard time making it work: it's not a real thing. Like trying to nail imaginary jello to the wall - you're 5 problems deep in something you just can't do.
If you want to get ahold of me I'm almost always on Discord.

danielbrauer
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu May 18, 2017 2:22 pm
Contact:

Re: Access to sprite filenames for entities and items and other things with sprites

Post by danielbrauer »

Rseding91 wrote:
Wed Apr 17, 2019 8:56 pm
Additionally, there is no such thing as a "color" for a science pack. That's a made up concept by you/others. That's why you're having such a hard time making it work: it's not a real thing. Like trying to nail imaginary jello to the wall - you're 5 problems deep in something you just can't do.
Right, but there are icons for science packs, and most humans can look at one and tell you what colour it is. Saying that colour is a made up concept is ignoring a real meaning of this data to users.

Nonetheless, it makes sense to me that graphics in general aren’t something you want gameplay to depend on. Analyzing or mapping values to specific graphics after the data stage is simply not a problem your API is trying to solve.

I think that’s completely fine. It just means that mods like DiscoScience are using the API for something it’s not intended for, and they’ll end up resorting to hacks.

Post Reply

Return to “Won't implement”

Who is online

Users browsing this forum: No registered users