Telogistics

by S6X

Teleport items from planet to planet, as long as you can spare the electricity.

Content
5 months ago
2.0 - 2.1
13.3K
Factorio: Space Age Icon Space Age Mod
Logistics

g Auto-Teleporter not Auto-Teleporting

1 year, 5 months ago
(updated 1 year, 5 months ago)

Hi, this is somewhat of a stretch since i doubt that S6X can do much with my limited information. Just wanting to know if this occurs to someone else;
(Mods: Krastorio 2 spaced out, all them planets (with some deactivated because of this mods GUI, some other QOL Mods). So;

The teleporters worked just fine with a unique ID, target state empty and teleport when full.
all of a sudden; they just dont. tried every combination of setting, they teleport once or twice and then stop. there is enough energy on both sides, they are empty/full depenting on location and need. they port just fine on click, but not automatically.

edit: when i change some settings like "target state empty" to "target state any", they port 2-3 times and then again stop :(

anyone else?
any ideas?

brgds and thanks for this awesome mod @S6X!

1 year, 5 months ago

I'm glad you like the mod.

This issue has come up before, and the usual cause is the automatic teleportation when full. When a teleportation cycle finishes after teleporting when full, the teleporter is temporarily deactivated. This is normally desirable: that way, it won't immediately be detected as full (because it is) and start teleporting again right away before you've even had the chance to unload it. This state lasts until either the teleporter is detected as not being full, or you change settings. Normally, this all works fine, but the polling only happens around three times per second so if you're loading and unloading simultaneously and the teleporter is at or near capacity the whole time, then it might never be detected as "not full," then it will just sit there.

Here's a quick test: the next time a full teleporter gets stuck, make sure no inserters/loaders/etc. can immediately put items back into it, and remove a stack of items. Wait for about a second with the teleporter no longer full and then put the stack back in so it is full again. If the teleporter then activates, then this is the problem.

1 year, 5 months ago

Hi, thanks for your quick response!

So it seems that for some reason and after working for lots of hours, the loaders caused this issue with two specific teleporters (all others work just fine).
What i did now to fix it; i removed the loaders and replaced them with inserters. now there are a few more seconds until the teleporter is full and he is not imediatelly force-fed with lots of items.
seems to work again. still strange since it did work for around 60 hours.

13 days ago

Как обойтись без правки мода

Ручной сброс. Команда /tl_reset пересоздаёт tele_table без inv_was_full и timeout, так что все защёлки снимаются. Смена настроек в GUI делает то же самое для одного телепортера, поэтому у автора и получается «2-3 раза, потом снова встаёт».
Управление по схеме. Ветка с сигналом пространственной локации (строки 261-276) не использует inv_was_full. Подключите провод к телепортеру и сделайте на decider combinator условие вроде «количество предметов ≥ порога», на выходе сигнал нужной планеты. Тогда телепорт запускается по схеме, и защёлки нет. Минус в том, что «полный» приходится считать порогом по предметам, а не по слотам. Это точно работает с одним типом предметов, а со смешанным содержимым порог будет приблизительным.

Правка мода

Здесь нужен не быстрый опрос, а перевзвод по таймеру. Защёлка нужна только на время, пока вы успеваете разгрузить телепортер. Поэтому её можно снимать и по истечении времени, а не только когда замечено «не полон».

В teleport_success (после строки 660):

lua
local now = game.tick
if stbl.inv_was_full then stbl.inv_was_full_since = now end
if dtbl.inv_was_full then dtbl.inv_was_full_since = now end

В tele_tick вместо строк 256-259:

lua
if (tbl.inv_was_full) then
local inv = tele.get_inventory(defines.inventory.chest)
local expired = tbl.inv_was_full_since and (tick - tbl.inv_was_full_since) > 600 -- 10 с
if (not inv.is_full() or expired) then
tbl.inv_was_full = nil
tbl.inv_was_full_since = nil
end
end

Значение 600 тиков можно вынести в runtime-настройку. Недостаток: если приёмный конец тоже настроен на «телепорт при заполнении» и вы не успели его разгрузить за это время, он отправит содержимое обратно. Так что разгрузка должна укладываться в окно (10 с и есть то самое окно, которое можно менять). Правку перезапишет любое обновление мода, поэтому её стоит предложить S6X на Mod Portal как настройку.

New response