Transport Belt down shows wrong graphic

Place to get help with not working mods / modding interface.
scy
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 17, 2019 11:23 pm
Contact:

Transport Belt down shows wrong graphic

Post by scy »

Hey, first up: I'm not a modder, I just want to update my favourite (but seemingly abandoned) mod AnonyMods for personal usage.
Thus far, I'm done and I got everything running (except some parts I really wasn't interested in anyways). Now the game runs with the belts and everything, yet the graphics get always fucked up.

I managed to update the belt models to a 0.17 (in a crappy way as shown in the picture) and connected the start and end parts. I'm using a recoloured version of the standard transport-belt.png. (the yellow belt shows how the red'ish is layed down)

Image

I'm committing the following Keys:

Code: Select all

   belt_horizontal
    belt_vertical
    ending_top 
    ending_bottom 
    ending_side
    starting_top
    starting_bottom 
    starting_side
    ending_patch 
and the belt_vertical in particular reads:

Code: Select all

 {
    filename = "__AnonyMods__/graphics/entity/lightning-transport-belt/lightning-transport-belt.png",
    priority = "extra-high",
    width = 64,
    height = 64,
    frame_count = 16,
    y = 2*64,
    hr_version = [...]
  }
  
So, the thing is: right and left change is no problem. Up is selected properly as well (so the 2x64 selects the 3rd row as expected), but uses has the models of the first row.

Where I have absolutely no clue is the curves. They're all totally random and I see no way of transmitting an index, as shown in the transport-belt-pictures.lua of the base mod. I tried copy-pasting them (like I just copy-pasted the graphics) but nothing happens.

There are also a lot of other things I don't understand. The transport-belt-pictures.lua has a property called fast_belt_animation_set with the property animation_set in it. This looks exactly like the animations property in the data:extend call used by AnonymoScoot, but can't change the animations to animation_set, otherwise the key won't be found. Is this a setting issue where I have to change the version of the API as well?

Where do these indexes in the transport-belt-pictures.lua lead to? For me they're just like variables, but I don't see where they're going.
Every help would be appriciated...
And if you read it, AnonymoScoot: awesome mod!!!!!!!!! but get quicker keeping it updated :lol:
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Transport Belt down shows wrong graphic

Post by darkfrei »

Why do you have that white shadows?
scy
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 17, 2019 11:23 pm
Contact:

Re: Transport Belt down shows wrong graphic

Post by scy »

because I simply imported the graphics into photoshop - changed the color gradient and rendered it as png again. It's a shitty solution, and won't be my final one, yet it is not a shadow mask or anything, just the render being unrefined. Here's the picture I'm using

Image

So it has nothing to do with my problem. As shown in the post above, the downward facing belt uses the first row for it's animation while the upward belt uses the thrid (as set in the belt_vertical variable).
posila
Factorio Staff
Factorio Staff
Posts: 5366
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Transport Belt down shows wrong graphic

Post by posila »

Hmm... it's a bug in loading of legacy belt graphics definitions; I suppose it is not used as much as I thought it would be. (Fixed for next release)

In 0.17, preferred definition is through belt_animation_set (see belt definitions in vanilla). If belt_animation_set is not found, it tries to load old definition and then it complains about animations not being found. The indices determine map belt directions onto rows in the spritesheet.
scy
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 17, 2019 11:23 pm
Contact:

Re: Transport Belt down shows wrong graphic

Post by scy »

Thanks posila <3 now the downwards belt renders properly, but the curves are still messed up

Image

I'm sorry if this causes you a lot of work. I'll look up how the new belt_animation_set works, and where to change stuff compared to the old mechanic, if that's a tedious and non rewarding task.

Or am I the one doing something wrong here?
Hiladdar
Fast Inserter
Fast Inserter
Posts: 214
Joined: Mon May 14, 2018 6:47 pm
Contact:

Re: Transport Belt down shows wrong graphic

Post by Hiladdar »

There are two issues, first is "white shadow" issue, second is the rotation of the belt. The white shadow, is when something should be part of the transparent layer, but is not. The rotation of the belt, is when within the graphic file something is not in the correct position, or the code within the mod is pointing to the wrong location within the graphic file. These are both issues I have had to overcome in some of the mods I wrote.

First I will address transparancy. My problem was I was using PCpaint / PCpaint++ and there was not a smooth transition between the transparent background and actual image. PCpaint is horrible on dealing with transparency, while PCpaint++ is ok with it, but not robust enough for what needs to be done. My first solution was to switch to using lunapic, which works through the browser. Luna pic is ok for quick work on a PC that does not have any good image editing software, but slow, and dependent on internet connection. I then I switched to Gimp which is freeware. Both Lunapic and Gimp are much better way better then any version of PCpaint or PCpaint++. One of the things I had to learn and still am learning better utilize the actual software's cababilities. Both Lunapic and Gimp are free, which might be a better option especially if you have a very old version of Adobe. Knowing what I know now, I would go directly to Gimp.

The second part, of your issue, is in how the graphic image is assembled. I would recommend taking a look at the original graphic within .17 and prepositionally replicate that within your own. That may entail creating a number of smaller files graphic files and then manually reassembling them in the same order. An alternate and faster way, using Gimp if what you want to do is only replace one color with a another, is to open the png image up, select the entire image, then from the Colors menu select Rotate Colors, from there I selected from source range to be within the range between 30-60, and the destination range from 300-330. By not mucking around with the layers or animations the risk of breaking something is much lower, I changed the yellow to purplelish, while maintaining transparency for that entire image. The final step is to have your code point to your new graphics file in lieu of the base one within your mod. I have uploaded the modified normal resolution transporter belt file.
transport-belt-new.png
transport-belt-new.png (467.34 KiB) Viewed 1831 times
Taking a quick look at belts, there is a normal resolution and high resolution image, as well as a directory named connectors that has what looks like 4-5 other png files which need to be uploaded. I have not checked splitters or underground belts. Hope some of this is relevant and helps you with your project.

Hiladdar
scy
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 17, 2019 11:23 pm
Contact:

Re: Transport Belt down shows wrong graphic

Post by scy »

Hmm... you did help me A LOT! :) Thanks :)))

Tho maybe not in the way you thought haha
Well first: I'm totally gonna steal your file, thanks mate :) I'm pretty sure I would have gotten the graphics right, but I'm happy you did it, because they look amazing :)

Where you did help me a ton was bringing me back to this project after I kinda skipped some days for evil other games which shall not be named. And I came back with the idea to look for some specifics in the mod files, I didn't find in the vanilla ones, and here we go:

There is a demo-entities.lua I haven't seen before. Now everything makes sense (except why someone's bunching every item in there and calling it something totally unrealted :p ) and now I've found out how to use the new belt_animation_set method.
It was so easy, fml, but as said I'm such a noobie :D
Post Reply

Return to “Modding help”