Mod Modification - Automatic Train Repair for Alert

Modded Question

Using the Automatic train repair mod and it's exactly what I need, but I'd like the alert for a damaged train to be MUCH more obvious - and perhaps persistent. I've poked through the LUA code, but my programming skills are the equivalent to filling your pockets with rancid spaghetti and expecting to be able to launch a rocket. I posted a request to the mod page but it's likely the author has moved on to more interesting things. Any advice on how I might be able to tweak the mod to make the alert longer, louder, and maybe even persistent (until the train is fixed)?

I believe this is the section that needs updating, but having sifted through the API reference my smooth brain couldn't come up with a workable update:

Starts Line 35 in control.lua

-- creates custom alert
local message = {"gui-alert-tooltip.ick-destroyed-train", entity.localised_name, "?"}
if event.cause then
	message = {"gui-alert-tooltip.ick-destroyed-train", entity.localised_name, event.cause.localised_name}
end
for _, player in pairs(game.players) do
	if player.force == entity.force and player.mod_settings["ick-alert"].value then
		player.add_custom_alert(ghost_entity, {type = "virtual", name = "ick-signal-destroyed-train"}, message, true)
	end
end

Posted May 11, 2022, 3:28 PM UTC

10

No comments yet

Nobody commented on this post, or the comments weren't captured.