func_train entities usually follow an unchanging loop of
path_corner entities, where the
target field of one matches the
targetname of the next. Fact: if more than one
path_corner has the same
targetname, the one which appears earliest on the game’s list is always chosen.
We would like to create two paths, and use a trigger to swap our
func_train from the first path to the second. We make a fork in the path from two
path_corner entities with the same targetname. The engine chooses the earliest entity, but if we can delete that one then we switch to the later one’s path. We cannot do this with
killtarget as both entities have the same
targetname, so we need a hack.
Add this field to the earlier
Create a trigger which targets the
targetname of that entity. The
s_explode6 function runs when the trigger fires, which removes the entity after a short delay. Nothing happens to the other
path_corner because it does not have a
You cannot apply the hack to the second
path_corner as well, or they will both activate at the same time. If you need more than one change of path, you must use a different
path_corner for each branch. It’s simplest to make each new loop out of completely separate sets of entities.