From 4cf9e5283b8710c08e22fd4786d48f9264298d87 Mon Sep 17 00:00:00 2001 From: Maverick2797 Date: Mon, 8 Nov 2021 20:36:01 +0800 Subject: split_at_index where index=1 Splitting at index=1 results in multiple empty trains being created. Can be prevented by an atc_speed > 0 check by the user, but easier just to return false and do nothing. --- advtrains_luaautomation/README.md | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 advtrains_luaautomation/README.md (limited to 'advtrains_luaautomation/README.md') diff --git a/advtrains_luaautomation/README.md b/advtrains_luaautomation/README.md old mode 100644 new mode 100755 index 683e45c..de4be3b --- a/advtrains_luaautomation/README.md +++ b/advtrains_luaautomation/README.md @@ -260,6 +260,8 @@ There are several functions available especially for shunting operations. Some o - `split_at_index(index, atc_command)` Splits the train at the specified index, into a train with index-1 wagons and a second train starting with the index-th wagon. The `atc_command` specified is sent to the second train after decoupling. `"S0"` or `"B0"` is common to ensure any locomotives in the remaining train don't continue to move. + `index` must be more than 1 to avoid trying to decouple the very front of a train. + Example: train has wagons `"foo","foo","foo","bar","bar","bar"` Command: `split_at_index(4,"S0")` Result: first train (continues at previous speed): `"foo","foo","foo"`, second train (slows at S0): `"bar","bar","bar"` -- cgit v1.2.3