Furnaces and Assembly machines only rotate if fluid recipe

Place to get help with not working mods / modding interface.
Post Reply
Avacado
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Fri Jul 22, 2016 3:17 pm
Contact:

Furnaces and Assembly machines only rotate if fluid recipe

Post by Avacado »

I'm the author of Whistle Stop Factories, and I'm trying to get the loaders under the big factories to rotate along with the structure. I've run into a few problems, but the last one is that unless an assembly machine has a fluid recipe, the on_player_rotated_entity event doesn't fire. And for the furnace, that event never fires.

That behavior makes sense, because the only time it is normally meaningful for those structures to be rotated is when the assembly machine has a fluid recipe loaded so that the rotation moves the fluidboxes.

Both entities always have .rotatable=true (regardless of what recipe is loaded). Any suggestions on how to get these to always respond to rotation and always trigger the on_player_rotated_entity event?

MostlyNumbers
Inserter
Inserter
Posts: 26
Joined: Fri Apr 13, 2018 10:07 pm
Contact:

Re: Furnaces and Assembly machines only rotate if fluid recipe

Post by MostlyNumbers »

I assume you're talking about factories already placed on the map getting rotated, not inside the cursor stack?

If nothing else, you could add a custom input tied to rotate commands, then look at what entity is under the cursor

Avacado
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Fri Jul 22, 2016 3:17 pm
Contact:

Re: Furnaces and Assembly machines only rotate if fluid recipe

Post by Avacado »

I've done some more digging and part of the problem is the entity isn't actually being rotated (the .direction isn't changing). So if I did any sort of virtual "rotation" it would put the actual entities .direction out of sync with the entities actual state (which would dictate the rotation of the fluidboxes if and when such a recipe is activated). Fortunately the entity is close enough to radially symmetric, that it might not matter.

In the meantime I've been exploring a few other options too. The first one I was able to do is remove "off_when_no_fluid_recipe" from my assembling table which means the pipes are on all the time and it can get rotated all the time.

That doesn't really help me with the furnace though, so I'm half debating if I should add an always on fluidbox. Though the better solution I think might be done by utilizing graphics specifications. Like the oil refinery has 4 different sets of graphics for each of the 4 directions. Maybe if I do the same thing for my other entities (even if it means just referencing the same set of graphics 4 times), it may force the entity into thinking it needs to be rotating to show off all of its sides. I think this last method might be the most "clean" solution.

Avacado
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Fri Jul 22, 2016 3:17 pm
Contact:

Re: Furnaces and Assembly machines only rotate if fluid recipe

Post by Avacado »

I started adding animation coding for each of the different directions, but when that doesn't work I realized that the Oil Refinery also doesn't rotate when the fluidboxes are turned off, so I guess it is time to add a fluidbox to my furnace.

Post Reply

Return to “Modding help”