Failed to load mod - Sprite position [Resolved]

Place to get help with not working mods / modding interface.
AlmightyCrumpet
Inserter
Inserter
Posts: 23
Joined: Sun Mar 26, 2017 10:16 am
Contact:

Failed to load mod - Sprite position [Resolved]

Post by AlmightyCrumpet »

Okay, my first mod and I'm having trouble to get the game to load now with it active.
All I'm trying to do is to add different versions of belts/splitters/underground belts and I'm fairly certain I have the files and code to load them in and it work (Had it load in before but with the wrong animation and no entity descriptions)

Now after trying to sort the animation and description and add in the HR image I get the error in the image attached, which makes no sense to me as that value it states seems within the images size.

I'm using the base game images so that the sizes match and I am also matching the code snippets for the items so that the animation sizes are right.
Does anyone have any ideas?? (I will provide code snippets when asked. I feel it's a little unnecessary to just dump it all here when it might be irrelevant)
Any help is muchly appreciated, thanks.

- Mathew
Attachments
f-error.png
f-error.png (34.31 KiB) Viewed 4569 times
Last edited by AlmightyCrumpet on Fri Aug 18, 2017 11:40 am, edited 1 time in total.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Failed to load mod - Sprite position

Post by Klonan »

AlmightyCrumpet wrote:Okay, my first mod and I'm having trouble to get the game to load now with it active.
All I'm trying to do is to add different versions of belts/splitters/underground belts and I'm fairly certain I have the files and code to load them in and it work (Had it load in before but with the wrong animation and no entity descriptions)

Now after trying to sort the animation and description and add in the HR image I get the error in the image attached, which makes no sense to me as that value it states seems within the images size.

I'm using the base game images so that the sizes match and I am also matching the code snippets for the items so that the animation sizes are right.
Does anyone have any ideas?? (I will provide code snippets when asked. I feel it's a little unnecessary to just dump it all here when it might be irrelevant)
Any help is muchly appreciated, thanks.

- Mathew
I suppose you did {x = 640} instead of {width = 640}

Providing your code would help a lot
AlmightyCrumpet
Inserter
Inserter
Posts: 23
Joined: Sun Mar 26, 2017 10:16 am
Contact:

Re: Failed to load mod - Sprite position

Post by AlmightyCrumpet »

Small snippet of the transport-belt-pictures. I'll also attach the file along with the entity file.

Code: Select all

--CODE
MB = {}
MB.modName = "MoreBelts"
MB.baseGraphicsIcons = "__".. MB.modName .."__/graphics/icons/"
MB.baseGraphicsEntity = "__".. MB.modName .."__/graphics/entity/"

---------------------- Brisk Picture Locations
brisk_belt_filename = MB.baseGraphicsEntity .. "brisk-transport/brisk-transport-belt.png"
hr_brisk_belt_filename = MB.baseGraphicsEntity .. "brisk-transport/hr-brisk-transport-belt.png"
---------------------- Speedy Picture Locations
speedy_belt_filename = MB.baseGraphicsEntity .. "speedy-transport/speedy-transport-belt.png"
hr_speedy_belt_filename = MB.baseGraphicsEntity .. "speedy-transport/hr-speedy-transport-belt.png"
---------------------- Rapid Picture Locations
rapid_belt_filename = MB.baseGraphicsEntity .. "rapid-transport/rapid-transport-belt.png"
hr_rapid_belt_filename = MB.baseGraphicsEntity .. "rapid-transport/hr-rapid-transport-belt.png"


---------------------- BRISK BELT PICTURES
brisk_belt_horizontal =
  {
    filename = brisk_belt_filename,
    priority = "extra-high",
    width = 40,
    height = 40,
    frame_count = 32,
    hr_version =
    {
      filename = hr_brisk_belt_filename,
      priority = "extra-high",
      width = 80,
      height = 80,
      frame_count = 32,
      line_length = 16,
      scale = 0.5
    }
  }
brisk_belt_vertical =
  {
    filename = brisk_belt_filename,
    priority = "extra-high",
    width = 40,
    height = 40,
    frame_count = 32,
    y = 40,
    hr_version =
    {
      filename = hr_brisk_belt_filename,
      priority = "extra-high",
      width = 80,
      height = 80,
      frame_count = 32,
      line_length = 16,
      y = 160,
      scale = 0.5
    }
  }

So no, I hadn't used 'x' instead of 'width'. Also the majority of the code is a copy of the base game because I was trying to get it close as to fix it.
Attachments
item-transport.lua
(2.79 KiB) Downloaded 154 times
entity-transport.lua
(17.29 KiB) Downloaded 143 times
transport-belt-pictures.lua
(7.71 KiB) Downloaded 156 times
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Failed to load mod - Sprite position

Post by Klonan »

You're missing 'line_length' for the normal res definitions
AlmightyCrumpet
Inserter
Inserter
Posts: 23
Joined: Sun Mar 26, 2017 10:16 am
Contact:

Re: Failed to load mod - Sprite position

Post by AlmightyCrumpet »

Unfortunately adding in the line_length does not solve this either (also it errors on the HR image too which has the 'line_length')
This really has me stumped as it worked at least once before

Code: Select all

---------------------- BRISK BELT PICTURES
brisk_belt_horizontal =
  {
    filename = brisk_belt_filename,
    priority = "extra-high",
    width = 40,
    height = 40,
    frame_count = 32,
    line_length = 8,
    hr_version =
    {
      filename = hr_brisk_belt_filename,
      priority = "extra-high",
      width = 80,
      height = 80,
      frame_count = 32,
      line_length = 16,
      scale = 0.5
    }
  }
f-error2.png
f-error2.png (25.39 KiB) Viewed 4539 times

I must have just missed something out entirely.
And thank you for you fast responses.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Failed to load mod - Sprite position

Post by darkfrei »

Just make the picture twice bigger.
AlmightyCrumpet
Inserter
Inserter
Posts: 23
Joined: Sun Mar 26, 2017 10:16 am
Contact:

Re: Failed to load mod - Sprite position

Post by AlmightyCrumpet »

darkfrei wrote:Just make the picture twice bigger.
That did actually get the game to load without the mod crashing so that's a step forward at least.
However now the animations are all screwed :/
f-issue.png
f-issue.png (726.93 KiB) Viewed 4510 times
The first belt line only shows the end of the lines and the other two just flicker in and out of existence XD
As for the splitters they just seem to slide right and reset.

Assuming this is due to the new image sizes.
This still baffles me though as the code I used for what is there so far is all from the base game files
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Failed to load mod - Sprite position

Post by darkfrei »

Can you place here complete mod folder?
AlmightyCrumpet
Inserter
Inserter
Posts: 23
Joined: Sun Mar 26, 2017 10:16 am
Contact:

Re: Failed to load mod - Sprite position

Post by AlmightyCrumpet »

Sure, it's attached.
Also I managed to solve the issue with the belt images at the least.
Turns out the base transport-belt image sizes are different to the fast-transport-belt sizes (which was the code I was using) now just need to fix the splitter.

I get the feeling it's the same thing so if it works, thank you all for the help it's been great :)
If not then the file is attached and feel free to tell me where I've been an idiot :P
Attachments
MoreBelts_0.0.1.zip
(12.7 MiB) Downloaded 128 times
AlmightyCrumpet
Inserter
Inserter
Posts: 23
Joined: Sun Mar 26, 2017 10:16 am
Contact:

Re: Failed to load mod - Sprite position

Post by AlmightyCrumpet »

YUP. It's sorted now (>__>)

Turns out it was just because I was using the base Transport-Belt (yellow) images against the Fast-Transport-Belt (red) code

Thank you all once again for your many helpful messages.
All that's left to do now is colour the belts and give them descriptions :)

Many Thanks
- Mathew
Post Reply

Return to “Modding help”