Bug in offshore-pump sprite tint

Place to get help with not working mods / modding interface.
Post Reply
Ondras4620
Burner Inserter
Burner Inserter
Posts: 13
Joined: Wed Nov 25, 2020 1:44 pm
Contact:

Bug in offshore-pump sprite tint

Post by Ondras4620 »

Hello i've been modding for while and made mod for tinting with help of somebody on Factorio discord but nobody could find out what my error means,

error is 100% replicatable
error is in serpernt.block
error and log files are atteched to this post

what i was about to do ? i have some functions that loops a lot but main thing is to give function sprite and tint color
after that my function should recursively run until it finds sprite with hr_version or layers, after that it tints

what i got ? Error... error about boolean on sprite ? yeah i cant give more detail cause there is nothing very useful in logs if you undestand modding then check it out thanks everyone !! :)

Any suggestions are accepted too! this might be question for devs too.
Attachments
Blui_1.0.0.zip
(2.01 KiB) Downloaded 67 times
factorio-previous.log
(19.57 KiB) Downloaded 62 times
factorio-current.log
(19.57 KiB) Downloaded 60 times

Pi-C
Smart Inserter
Smart Inserter
Posts: 1654
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Bug in offshore-pump sprite tint

Post by Pi-C »

Ondras4620 wrote:
Thu Dec 30, 2021 11:14 am
what i was about to do ? i have some functions that loops a lot but main thing is to give function sprite and tint color
after that my function should recursively run until it finds sprite with hr_version or layers, after that it tints

what i got ? Error... error about boolean on sprite ? yeah i cant give more detail cause there is nothing very useful in logs if you undestand modding then check it out thanks everyone !! :)
You wrongly assume that the argument "sprite" that you pass on to setTint() will always be a table. The error in this case was caused in solveWorldPoints(), where you iterate over all values in the table and call setTint() for each value. Just add a type check and it should work. I've made a minimal example (removed cruft, added logging, and added the check) that will work. Just replace data-updates.lua with this version, run it, and check the log file. You probably should add such a test to dePipeIfy as well. It didn't throw an error with the prototypes you've used, but it could crash with other prototypes.
Attachments
data-updates.lua
(1.04 KiB) Downloaded 62 times
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding help”