[Solved] Modify entity scale

Place to get help with not working mods / modding interface.
Post Reply
Kingdud
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Sat Dec 16, 2017 3:23 am
Contact:

[Solved] Modify entity scale

Post by Kingdud »

Yet another noob question. I am making a big electric furnace. As in, the normal furnace is 3x3, mine is 38x38. I think what i want to do (because I suck at graphics and just want to re-use the existing ones) is to change the 'scale' property of the animation. Am I right? If not, what's the best way to go about making it bigger?

Code: Select all

local entity_smelter = table.deepcopy(data.raw.furnace["electric-furnace"])
--todo: replace graphics
entity_smelter.animation.layers[0].hr_version.scale = 12.5
entity_smelter.animation.layers.hr_version.scale = 12.5
entity_smelter.name = "bulk-smelter"
entity_smelter.crafting_speed = 2
entity_smelter.energy_usage = "72900kW"
entity_smelter.collision_box = {
	{
	  -18.8,
	  -18.8
	},
	{
	  18.8,
	  18.8
	}
}
entity_smelter.selection_box = {
	{
	  -19,
	  -19
	},
	{
	  19,
	  19
	}
}
entity_smelter.crafting_categories = 
{
	"bulksmelting"
}
entity_smelter.energy_source = {
	emissions_per_minute = 405,
	type = "electric",
	usage_priority = "secondary-input"
}
entity_smelter.minable = {
	mining_time = 0.2,
	result = "bulk-smelter"
}
That's what I have so far. The line I'm having trouble with is:

Code: Select all

entity_smelter.animation.layers[0].hr_version.scale = 12.5
I don't actually know how to index into the layers data structure. :/
Last edited by Kingdud on Wed May 01, 2019 12:58 pm, edited 1 time in total.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Modify entity scale

Post by DaveMcW »

You are close! The trick is lua uses 1 as the first index.

Code: Select all

entity_smelter.animation.layers[1].hr_version.scale = 12.5

Kingdud
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Sat Dec 16, 2017 3:23 am
Contact:

Re: Modify entity scale

Post by Kingdud »

...really? dogblammit. Why the snowflake does this carrotting thing start at 1 when every other sane language starts at 0?! fuuuuuuuuuuuuuuuuuuuuu!

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Modify entity scale

Post by darkfrei »

Kingdud wrote:
Wed May 01, 2019 11:53 am
...really? dogblammit. Why the snowflake does this carrotting thing start at 1 when every other sane language starts at 0?! fuuuuuuuuuuuuuuuuuuuuu!
If it will helpful for you
viewtopic.php?f=135&t=45107

Post Reply

Return to “Modding help”