Animation4Way support for SimpleEntityWithOwner/Force

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Animation4Way support for SimpleEntityWithOwner/Force

Post by Deadlock989 »

Current SEWO/Ps have a picture property which is a Sprite4Way, allowing you to give different sprites to the entity depending on which direction it is facing, but these can only be static sprites. There is also a pictures property which allows for multiple variants of sprite (either random on creation or set by script) but this is a SpriteVariations which is an array of Sprites, so it doesn't support direction. For animations, the only corresponding property is the animations property which is an AnimationVariations, which is an array of Animations. The entity doesn't support Animation4Way anywhere, so you can either have a directional entity, or an animated one, but not both.

So for workaround purposes, it would be great if there was a corresponding animation property as an Animation4Way. This would at least allow per-direction animations and then if you also need variants you can swap entities around. The only recourse at the moment is the rendering API which is not intended for large-scale use.

What would be even better is something which I don't think exists yet: per-direction variation arrays, e.g. SpriteVariations4Way and AnimationVariations4Way. These would respect the prototype random_variation_on_create property and also the runtime graphics_variation property, so that rotating a variant would preserve the index of the variant - it would up to the modder to make sure that the per-direction variations are organised correctly, and I guess it might need a sanity check to make sure that an equal number of variants per direction are supplied.
Image

curiosity
Filter Inserter
Filter Inserter
Posts: 326
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Animation4Way support for SimpleEntityWithOwner/Force

Post by curiosity »

Deadlock989 wrote:
Mon Oct 23, 2023 12:00 pm
What would be even better is something which I don't think exists yet: per-direction variation arrays, e.g. SpriteVariations4Way and AnimationVariations4Way. These would respect the prototype random_variation_on_create property and also the runtime graphics_variation property, so that rotating a variant would preserve the index of the variant - it would up to the modder to make sure that the per-direction variations are organised correctly, and I guess it might need a sanity check to make sure that an equal number of variants per direction are supplied.
Make it Animation4WayVariations instead. There, all your sanity checks are encoded in the type definition now.

Post Reply

Return to “Modding interface requests”