Page 1 of 1

[Solved] Modify entity scale

Posted: Tue Apr 30, 2019 11:08 pm
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. :/

Re: Modify entity scale

Posted: Wed May 01, 2019 8:18 am
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

Re: Modify entity scale

Posted: Wed May 01, 2019 11:53 am
by Kingdud
...really? dogblammit. Why the snowflake does this carrotting thing start at 1 when every other sane language starts at 0?! fuuuuuuuuuuuuuuuuuuuuu!

Re: Modify entity scale

Posted: Wed May 01, 2019 12:19 pm
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