Page 1 of 1

Add Sprite4Way to ContainerPrototype

Posted: Fri Jul 05, 2024 6:20 pm
by embermctillhawk
TL;DR
Topic name.

What?
Add an optional entry of type Sprite4Way to ContainerPrototype, similar to how CombinatorPrototype has the "sprites" entry, which will override the "picture" entry if present.
I don't remember if the game already will allow rotating the collision box if the entity is non-square with the ContainerPrototype. I know it does this for CraftingMachinePrototype. That might need tweaking as well if this was implemented.
Probably rotating is only allowed if the Sprite4Way is defined.

Why?
Nonsquare containers already exist in the vanilla game as cars and tanks and trains. The engine already allows for nonvehicle nonsquare containers and uses them for things like the crashed ship. However, it does not allow for rotating these nonsquare containers, which messes with things like blueprints.
There are ways to work around this but this mostly involves writing custom lua to hook into various events. See; the modular chests mod.
I was working on a cursed mod with silly things like 2x5 assemblers and long chests but very quickly found out the limitations of the existing system. Adding this at the engine layer would be much cleaner than anything that could be done in lua.

Re: Add Sprite4Way to ContainerPrototype

Posted: Fri Jul 05, 2024 6:39 pm
by Koub
[Koub] Moved to modding interface requests.

Re: Add Sprite4Way to ContainerPrototype

Posted: Fri Jul 05, 2024 11:36 pm
by FuryoftheStars
I feel like this may be related?
viewtopic.php?f=28&t=100628

Re: Add Sprite4Way to ContainerPrototype

Posted: Sat Jul 06, 2024 1:04 am
by curiosity
FuryoftheStars wrote:
Fri Jul 05, 2024 11:36 pm
I feel like this may be related?
viewtopic.php?f=28&t=100628
Only related. This is a better and more concrete request.

Re: Add Sprite4Way to ContainerPrototype

Posted: Sat Jul 06, 2024 7:56 am
by Rseding91
curiosity wrote:
Sat Jul 06, 2024 1:04 am
FuryoftheStars wrote:
Fri Jul 05, 2024 11:36 pm
I feel like this may be related?
viewtopic.php?f=28&t=100628
Only related. This is a better and more concrete request.
It's the other way around. An entity needs to support rotation before having directional sprites has any meaning. Supporting direction/rotation implies there is sprite support for those directions.

Re: Add Sprite4Way to ContainerPrototype

Posted: Sat Jul 06, 2024 8:50 pm
by curiosity
Rseding91 wrote:
Sat Jul 06, 2024 7:56 am
It's the other way around. An entity needs to support rotation before having directional sprites has any meaning. Supporting direction/rotation implies there is sprite support for those directions.
But there is no point is directional sprites if the entity doesn't support directions. The two are equivalent. And this request is asking for only one type of entity.