Skip to content

Commit 2dfebdf

Browse files
committed
push to 1.10.7
- updated changelog - updated event descriptions
1 parent a22b90a commit 2dfebdf

File tree

5 files changed

+83
-69
lines changed

5 files changed

+83
-69
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Factorio - Logistic Train Network
22
Factorio mod adding "logistic-train-stops" acting as anchor points for building a train powered logistic network.<br/>
33
It can handle multiple train configurations and will pick the best available train for a delivery.<br/>
4-
With Choumiko's RailTanker it will also deliver liquids.<br/>
54

65
Forum: https://forums.factorio.com/viewforum.php?f=214<br/>
76
Download: https://mods.factorio.com/mods/Optera/LogisticTrainNetwork<br/>

changelog.txt

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
---------------------------------------------------------------------------------------------------
2+
Version: 1.10.7
3+
Date: 2019-04-13
4+
Features:
5+
- Added on_dispatcher_no_train_found event #173
6+
Bugfixes:
7+
- Fixed nil error in debug log introduced in 1.10.6
8+
---------------------------------------------------------------------------------------------------
29
Version: 1.10.6
310
Date: 2019-04-06
411
Bugfixes:

info.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "LogisticTrainNetwork",
3-
"version": "1.10.6",
3+
"version": "1.10.7",
44
"title": "LTN - Logistic Train Network",
55
"author": "Optera",
66
"contact": "https://forums.factorio.com/memberlist.php?mode=viewprofile&u=21729",

script/dispatcher.lua

+1-9
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,7 @@ function ProcessRequest(reqIndex)
521521
if not selectedTrain or not trainInventorySize then
522522
if message_level >= 2 then printmsg({"ltn-message.no-train-found", from, to, matched_network_id_string, tostring(minTraincars), tostring(maxTraincars) }, requestForce, true) end
523523
if debug_log then log("No train with "..tostring(minTraincars).." <= length <= "..tostring(maxTraincars).." to transport "..tostring(totalStacks).." stacks from "..from.." to "..to.." in network "..matched_network_id_string.." found in Depot.") end
524-
script.raise_event(on_dispatcher_no_train_found_event, {
525-
to = to,
526-
to_id = toID,
527-
from = from,
528-
from_id = fromID,
529-
network_id = requestStation.network_id,
530-
minTraincars = minTraincars,
531-
maxTraincars = maxTraincars,
532-
shipment = loadingList,
524+
script.raise_event(on_dispatcher_no_train_found_event, { to = to, to_id = toID, from = from, from_id = fromID, network_id = requestStation.network_id, minTraincars = minTraincars, maxTraincars = maxTraincars, shipment = loadingList,
533525
})
534526
return nil
535527
end

script/interface.lua

+74-58
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ remote.add_interface("logistic-train-network", {
2121
on_dispatcher_no_train_found = function() return on_dispatcher_no_train_found_event end,
2222

2323
-- update for updated deliveries after leaving provider
24-
on_delivery_pickup_complete = function() return on_delivery_pickup_complete_event end,´
24+
on_delivery_pickup_complete = function() return on_delivery_pickup_complete_event end,
2525

2626
-- update for completing deliveries
2727
on_delivery_completed = function() return on_delivery_completed_event end,
@@ -38,67 +38,83 @@ end
3838

3939

4040
--[[ EVENTS
41-
on_stops_updated ->
42-
called after LTN finished gathering stop data and created deliveries
43-
44-
Contains:
45-
logistic_train_stops = {
46-
[stopID], {
47-
-- stop data
48-
activeDeliveries,
49-
entity,
50-
input,
51-
output,
52-
lampControl,
53-
errorCode,
54-
55-
-- control signals
56-
isDepot,
57-
network_id,
58-
maxTraincars,
59-
minTraincars,
60-
trainLimit,
61-
provideThreshold,
62-
provideStackThreshold,
63-
providePriority,
64-
requestThreshold,
65-
requestStackThreshold,
66-
requestPriority,
67-
lockedSlots,
68-
noWarnings,
69-
70-
-- parked train data
71-
parkedTrain,
72-
parkedTrainID,
73-
parkedTrainFacesStop,
74-
}
75-
}
76-
77-
78-
on_dispatcher_updated ->
79-
called after LTN finished gathering stop data and created deliveries
80-
81-
Contains:
82-
update_interval = int -- LTN update interval (depends on existing ltn stops and stops per tick setting
83-
provided_by_stop = { [stopID], { [item], count } }
84-
requests_by_stop = { [stopID], { [item], count } }
85-
deliveries = { trainID = {force, train, from, to, networkID, started, shipment = { item = count } } }
86-
available_trains = { [trainID ], { capacity, fluid_capacity, force, network_id, train } }
87-
88-
89-
on_delivery_completed ->
90-
Called when train leaves delivery target stop
91-
92-
Contains:
93-
event.delivery = {force, train, from, to, networkID, started, shipment = { [item], count } }
41+
on_stops_updated
42+
Raised every UpdateInterval, after delivery generation
43+
-> Contains:
44+
event.logistic_train_stops = { [stopID], {
45+
-- stop data
46+
activeDeliveries,
47+
entity,
48+
input,
49+
output,
50+
lampControl,
51+
errorCode,
52+
53+
-- control signals
54+
isDepot,
55+
network_id,
56+
maxTraincars,
57+
minTraincars,
58+
trainLimit,
59+
provideThreshold,
60+
provideStackThreshold,
61+
providePriority,
62+
requestThreshold,
63+
requestStackThreshold,
64+
requestPriority,
65+
lockedSlots,
66+
noWarnings,
67+
68+
-- parked train data
69+
parkedTrain,
70+
parkedTrainID,
71+
parkedTrainFacesStop,
72+
}}
73+
74+
75+
on_dispatcher_updated
76+
Raised every UpdateInterval, after delivery generation
77+
-> Contains:
78+
event.update_interval = int -- LTN update interval (depends on existing ltn stops and stops per tick setting
79+
event.provided_by_stop = { [stopID], { [item], count } }
80+
event.requests_by_stop = { [stopID], { [item], count } }
81+
event.deliveries = { trainID = {force, train, from, to, networkID, started, shipment = { item = count } } }
82+
event.available_trains = { [trainID ], { capacity, fluid_capacity, force, network_id, train } }
83+
84+
85+
on_dispatcher_no_train_found
86+
Raised when no train was found to handle a request
87+
-> Contains:
88+
event.to = requester.backer_name
89+
event.to_id = requester.unit_number
90+
event.network_id
91+
(optional) event.item
92+
(optional) event.from
93+
(optional) event.from_id
94+
(optional) event.minTraincars
95+
(optional) event.maxTraincars
96+
(optional) event.shipment = { [item], count }
97+
98+
99+
on_delivery_pickup_complete
100+
Raised when a train leaves provider stop
101+
-> Contains:
94102
event.trainID
103+
event.delivery = {force, train, from, to, networkID, started, shipment = { [item], count } } -- updated shipment to current train inventory
104+
event.original_shipment = { [item], count } }
95105
96106
97-
on_delivery_failed ->
98-
Called when rolling stock of a train gets removed or the delivery timed out
99-
100-
Contains:
107+
on_delivery_completed
108+
Raised when train leaves requester stop
109+
-> Contains:
110+
event.trainID
101111
event.delivery = {force, train, from, to, networkID, started, shipment = { [item], count } }
112+
113+
114+
on_delivery_failed
115+
Raised when rolling stock of a train gets removed or the delivery timed out
116+
-> Contains:
102117
event.trainID
118+
event.delivery = {force, train, from, to, networkID, started, shipment = { [item], count } }
103119
104120
--]]

0 commit comments

Comments
 (0)