Mod-Defined Train/Platform Conditions

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Quorken
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Aug 18, 2025 3:53 pm
Contact:

Mod-Defined Train/Platform Conditions

Post by Quorken »

Suggestion: Allow mods to define custom conditions for trains and platforms.

Reason: Allows mods to create niche stops that aren't in the base game, like "no filtered cargo slot is empty"

Possible API:
Adding conditions:

Code: Select all

script.add_train_stop(handler)
Where handler is a mod-defined function that computes stop completion/progress when called.

Handler:

Code: Select all

function handler(train, current_stop)
	// Do stuff
	return {
		complete: boolean, -- Determines if the stop is satisfied; required.
		progress: float [0, 1] -- For displaying progress bar on stop condition; optional, defaults to 0
	}
end
Where train is the LuaEntity the condition is defined for, and current_stop is the stop the train is at (which the condition is defined for).

If the API ends up looking different, that's fine - I just wanted to show what it could look like.

Edit:
Ideally, you could also include item/circuit signal selectors, like the Item Count condition has. But even basic stops, similar to Full Cargo, would be helpful.
Post Reply

Return to “Modding interface requests”