Page 1 of 1

night animation problem

Posted: 31 Oct 2022, 11:19
by ur_sc4_guy
I've made a building with 4 subvariants which holds different night animations.The building was not supposed to be rotation-aware. But for some reason it is not working. Here's the code:

Code: Select all

[
	{
		"id":"SomeSC4Fan.TranoGasy.Zone",
		"title":"Trano Gasy",
		"text":"For Malagasy-Themed towns. Or maybe not ?",
		"type":"zone",
		"author":"Some SC4 Fan",
		"rci":true,
		"separator":true,
		"base":"$zoneresidential",
		"frames":[{"bmp":"Frame.png"}],
		"preview frames":[{"bmp":"Preview Frame.png"}],
		"price":30,
		"superior to base":true,
		"placeable":true,
		"persistent":true
	},
	{
		"id":"SomeSC4Fan.TranoGasy.1x1_I.night",
		"type":"animation",
		"frames":[{"bmp":"1x1_I_night.png"}],
		"light":true,
		"light switching":true
	},
	{
		"id":"SomeSC4Fan.TranoGasy.1x1_I",
		"type":"residential",
		"zone":"SomeSC4Fan.TranoGasy.Zone",
		"author":"Some SC4 Fan",
		"frames":[{"bmp":"1x1_I.png","w":32,"count":4}],
		"habitants":11,
		"width":1,
		"height":1,
		"draw ground":true,
		"animation":[{"id":"SomeSC4Fan.TranoGasy.1x1_I.night","y":-24}], 
		"influence culture":1
	}
]
... And there's the result.
Screenshot_20221031-114954.jpg
The night animation of the 3 other subvariants are "stuck" with the building's respective one. What's the problem here?
Thanks in advance.

Re: night animation problem

Posted: 01 Nov 2022, 13:56
by Bearbear76
I'm not 100% sure this will work but try adding something like this to the animation frames:

Code: Select all

"frames": [{"bmp": "1x1_I_night.png", "w": <number>, "count": 4}],

Re: night animation problem

Posted: 01 Nov 2022, 18:46
by ur_sc4_guy
sorry to deceive you, but it didn't work. Now the night animations are flushing.

Re: night animation problem

Posted: 01 Nov 2022, 19:18
by Kulche
You can't create night animation 'variants' without using lua as far as I'm aware. Try separating the png into windows and define them as separate drafts.

Re: night animation problem

Posted: 01 Nov 2022, 20:07
by ur_sc4_guy
Kulche wrote: 01 Nov 2022, 19:18 You can't create night animation 'variants' without using lua as far as I'm aware. Try separating the png into windows and define them as separate drafts.
I did as you said. Thanks. It worked.

Re: night animation problem

Posted: 02 Nov 2022, 12:52
by Bearbear76
Some SC4 Fan wrote: 01 Nov 2022, 18:46 sorry to deceive you, but it didn't work. Now the night animations are flushing.
Yeah, that's kind of what I thought was going to happen. :lol:

Re: night animation problem

Posted: 05 Nov 2022, 23:40
by CommanderABab

Code: Select all

[
	{
		"id":"SomeSC4Fan.TranoGasy.Zone",
		"title":"Trano Gasy",
		"text":"For Malagasy-Themed towns. Or maybe not ?",
		"type":"zone",
		"author":"Some SC4 Fan",
		"rci":true,
		"separator":true,
		"base":"$zoneresidential",
		"frames":[{"bmp":"Frame.png"}],
		"preview frames":[{"bmp":"Preview Frame.png"}],
		"price":30,
		"superior to base":true,
		"placeable":true,
		"persistent":true
	},
	{
		"id":"SomeSC4Fan.TranoGasy.1x1_I.night",
		"type":"animation",
		"frames":[{"bmp":"1x1_I_night.png","w":32,"count":4}],
		"rotation aware": true,
		"light":true,
		"light switching":true
	},
	{
		"id":"SomeSC4Fan.TranoGasy.1x1_I",
		"type":"residential",
		"zone":"SomeSC4Fan.TranoGasy.Zone",
		"author":"Some SC4 Fan",
		"frames":[{"bmp":"1x1_I.png","w":32,"count":4}],
		"habitants":11,
		"width":1,
		"height":1,
		"rotation aware": true,
		"draw ground":true,
		"animation":[{"id":"SomeSC4Fan.TranoGasy.1x1_I.night","y":-24}], 
		"influence culture":1
	}
]