[Dominik][0.17.60] Fluid mixing by entity.teleport(0,0)

This subforum contains all the issues which we already resolved.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2888
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

[Dominik][0.17.60] Fluid mixing by entity.teleport(0,0)

Post by boskid »

Another one:
  1. Two different fluid sources connected with underground pipes that is cut in between by another underground pipe
    teleport-mixing-1.png
    teleport-mixing-1.png (36.27 KiB) Viewed 8572 times
  2. Remove cutter underground pipe
    teleport-mixing-2.png
    teleport-mixing-2.png (33.22 KiB) Viewed 8572 times
  3. Hover mouse over left (any) underground pipe
  4. Code: Select all

    /c game.player.selected.teleport(0,0)
  5. teleport-mixing-3.png
    teleport-mixing-3.png (32.82 KiB) Viewed 8572 times
edit: disabling teleport(0,0) will not work as there is another possible scenario: put stray pipe, teleport it to overlap assemblers fluid box, setup underground pipes (here underground pipes will connect to pipe, not fluid box of assembler) then teleport away previously teleported pipe segment - this joins fluid systems

edit: fluid mixing will happen with every teleportation that is rejected (for example because in new position underground pipe also would mix fluids). This may be an issue with mods like picker dollies that can be used to move entities (it uses teleport - that was part of bug report 72292)

Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [0.17.60] Fluid mixing by entity.teleport(0,0)

Post by Dominik »

Ok this one should be easy. In the past I had to solve this for delete, rotate, change force (actually I will check this one) so it should be quite the same.
edit: oh I misuderstood it at first. I am not sure how hard it's gonna be.

Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.60] Fluid mixing by entity.teleport(0,0)

Post by Dominik »

Problem with teleport is that the way it works is that it takes the whole entity (can be a crafter with 25 fluidboxes), moves it to the new place, tries if it's ok, moves it back, and it it was ok, moves it again. So now if that underground pipe moves somewhere and moves back, it does not know anymore if it should first connect to the left or to the right. I think that the same issue is with the pipe upgrade.
It is solvable, but as you wrote in the other place - I don't want to be adding special cases to otherwise simple code just because of this.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2888
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by entity.teleport(0,0)

Post by boskid »

Just another case for teleport mixing (hinted in first post):
mixing-by-overlapping-teleport.png
mixing-by-overlapping-teleport.png (166.58 KiB) Viewed 8443 times
  1. Build two assemblers with different fluids and one stray pipe above left assembler
  2. Hover over stray pipe and

    Code: Select all

    /c game.player.selected.teleport(0,2)
  3. Now as crude oil output is overlapping with pipe, build pipe in middle
  4. Hover over stray overlapping pipe and

    Code: Select all

    /c game.player.selected.teleport(0,2)
  5. Fluid mixing (left assembler will show it is connected to sulfuric acid and consistency check will crash)
IMO Internally this is different issue than teleport(0,0), but let this report be here to ease of searching

Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.60] Fluid mixing by entity.teleport(0,0)

Post by Dominik »

Resolved this by preventing the action altogether if the blocked connection is in play. See viewtopic.php?f=182&t=73884 for more.

Post Reply

Return to “Resolved Problems and Bugs”