Error loading spritesheet bounds

Place to get help with not working mods / modding interface.
Post Reply
Tilehax
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Jul 03, 2024 9:25 pm
Contact:

Error loading spritesheet bounds

Post by Tilehax »

Hello, I am making an ore protype and running into issues with loading the spritemap. (Not an animation)
The error I receive is: "The given sprite rectangle (left_top=0x1024, right_bottom=128x1152) is outside the actual sprite size (left_top=0x0, right_bottom=1024x10240. ...
This is for the stages of a new ore I am modding. This specific issue comes from the stages poperty of my resource entity prototype. My code:

Code: Select all

stages = {
        sheet =
        {
            filename = "__mod-name__/icons/pentite-ore.png",
            line_length = 8,
            height = 128,
            width = 128,
            variation_count = 64,
        }
    }
I can confirm that my spritemap is 8x8 sprites, each 128 pixels in size, and the total sprite is 1024x1024. In my testing, I also tried with height and width = 64, and I still recieve and error, but instead of right_bottom being 128x1152, I get 128x1088. I have also attempted using different scale modifiers to no change in error message.
I don't know how to fix this, and if anybody could help tell me what's wrong I would be very grateful!
Attachments
Here is my texture which is not working
Here is my texture which is not working
pentite-ore.png (1.79 MiB) Viewed 192 times

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

Re: Error loading spritesheet bounds

Post by Bilka »

See the description of ResourceEntityPrototype::stages:
When using AnimationVariations::sheet, frame_count is the amount of frames per row in the spritesheet. variation_count is the amount of rows in the spritesheet. Each row in the spritesheet is one stage of the animation.
So this should work:

Code: Select all

stages = {
        sheet =
        {
            filename = "__mod-name__/icons/pentite-ore.png",
            height = 128,
            width = 128,
            variation_count = 8,
            frame_count = 8
        }
    }
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding help”