Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicating frames through listing them multiple times within Frames: crashes the game on load. #16576

Closed
GraionDilach opened this issue May 21, 2019 · 4 comments · Fixed by #17627

Comments

@GraionDilach
Copy link
Contributor

The electro animation in RA1/TS/RA2 had a setup with the first four frames played three times before the fifth frame.

Setting this up via

	die6: electro
		Frames: 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
		Length: 29
		UseTilesetExtension: true
		TilesetOverrides:
			DESERT: TEMPERAT
			INTERIOR: TEMPERAT

produces a crash however:

Exception of type `System.InvalidOperationException`: :0: Sequence ^BasicInfantry.die6 uses frames [0..28], but only 0..13 actually exist
   at OpenRA.Mods.Common.Graphics.DefaultSpriteSequence.<>c__DisplayClass59_1.<.ctor>b__0(Int32 frameCount)
   at OpenRA.Graphics.SpriteCache.get_Item(String filename, Func`2 getUsedFrames)
   at OpenRA.Mods.Common.Graphics.DefaultSpriteSequence..ctor(ModData modData, TileSet tileSet, SpriteCache cache, ISpriteSequenceLoader loader, String sequence, String animation, MiniYaml info)
@GraionDilach
Copy link
Contributor Author

GraionDilach commented Aug 18, 2019

TBH, this case be worked around with Combine: usage, so this should probably just be documented somewhere.

	die6:
		Combine:
			electro:
				Length: 3
			electro:
				Length: 3
			electro:
				Length: 3
			electro:
				Length: 3
			electro:
				Length: *
		Length: *

On the other hand, the setup is missing from the base mods.

@reaperrr
Copy link
Contributor

Have you tried simply removing the Length: 29?

At least to my knowledge, sequence length is auto-calculated from the number of entries in Frames. Length isn't meant to be used together with that.

@GraionDilach
Copy link
Contributor Author

Think I did and it just played the first frame as expected - since Frames could be used for Facing + Length combinations too. I settled down with Combine, because it can be used to do the same, and I finally comprehended how the yaml should be written for it after all these 3 years or so.

@Mailaender
Copy link
Member

I also stumbled upon this when doing back and forth animations using Frames. See #17627 for my proposed fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants