Access to sprite filenames for entities and items and other things with sprites
Access to sprite filenames for entities and items and other things with sprites
For entities that have sprites, I would like to be able to find out what file they were loaded from, in the control phase.
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Access to sprite filenames for entities and items and other things with sprites
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.
Right now I’m sneaking data out through flying-text, and I can feel Wube glaring at me.
Re: Access to sprite filenames for entities and items and other things with sprites
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.
Re: Access to sprite filenames for entities and items and other things with sprites
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?
PS: Why do the science packs use different sprites instead of tint in the first place?
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Access to sprite filenames for entities and items and other things with sprites
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.
Re: Access to sprite filenames for entities and items and other things with sprites
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.
Re: Access to sprite filenames for entities and items and other things with sprites
Asking each individual mod what color its entities are is a silly hack that won't ever scale.
Re: Access to sprite filenames for entities and items and other things with sprites
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.
Re: Access to sprite filenames for entities and items and other things with sprites
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.
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Access to sprite filenames for entities and items and other things with sprites
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.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.
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.