[RESOLVED] data.raw help?...

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Volvith
Inserter
Inserter
Posts: 40
Joined: Mon Jun 26, 2017 12:28 pm
Contact:

[RESOLVED] data.raw help?...

Post by Volvith »

Code: Select all

data.raw["transport-belt"]["express-transport-belt"]["belt_horizontal"].hr_version.filename = "__TTL__/graphics/entity/fast/transport-belt/hr-fast-transport-belt.png"
This is pretty much me trying, and failing, to overwrite the high resolution sprites of express transport belts.
Error on startup: "Failed to load mods: __TTL__"/data-updates.lua:55: attempt to index field "hr_version' (a nil value)"
If anyone know the proper phrasing for the hr_version graphics, help plz! :3
Full Error Code
Last edited by Volvith on Wed Jul 19, 2017 8:11 pm, edited 1 time in total.
Rational People: If it ain't fucked, don't fuck it.
Engineers: If it ain't fucked, unfuck it till it's perfect.
Me as an Engineer: If it ain't fucked, i'll fuck it till it is.

keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: data.raw help?...

Post by keyboardhack »

The problem is with this line:

Code: Select all

data.raw["transport-belt"]["express-transport-belt"]["ending_patch"].hr_version.filename = "__TTL__/graphics/entity/fast/transport-belt/hr-fast-transport-belt.png"
Because the code for the table ending_patch looks like this:

Code: Select all

{
	sheet =
	{
		filename = "__base__/graphics/entity/transport-belt/start-end-integration-patches.png",
		width = 40,
		height = 40,
		priority = "extra-high",
		hr_version =
		{
			filename = "__base__/graphics/entity/transport-belt/hr-start-end-integration-patches.png",
			width = 80,
			height = 80,
			priority = "extra-high",
			scale = 0.5
		}
	}
}
So you have to access the hr_version filename like this:

Code: Select all

                                                                    ------
data.raw["transport-belt"]["express-transport-belt"]["ending_patch"].sheet.hr_version.filename = "__TTL__/graphics/entity/fast/transport-belt/hr-fast-transport-belt.png"
Lines shows the change to the code.
Waste of bytes : P

User avatar
Volvith
Inserter
Inserter
Posts: 40
Joined: Mon Jun 26, 2017 12:28 pm
Contact:

Re: data.raw help?...

Post by Volvith »

keyboardhack wrote:
Collapsed quote.
Damn, that explains a lot... :/
I completely forgot to even check the demo-pics for the belts.

Anyhow, injected the .sheet into the line, boom, works like a charm.
Thanks a lot man, saved me a good while of stumbling around with my eyes closed there!... :D
Rational People: If it ain't fucked, don't fuck it.
Engineers: If it ain't fucked, unfuck it till it's perfect.
Me as an Engineer: If it ain't fucked, i'll fuck it till it is.

Post Reply

Return to “Modding help”