Add Sprite4Way to ContainerPrototype
Posted: Fri Jul 05, 2024 6:20 pm
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.
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.