Rewriting Entity Paths

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 path_corner:

"use" "s_explode6"

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 use field.

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.


2 thoughts on “Rewriting Entity Paths

  1. Another thing to note. If you use a mod that allows targetname2 (Quoth) you can killtarget the second targetname. Works for path_corner and path_rotate.

    • On the other hand, when Quoth 3 comes round and starts storing path_corner information on the func_train itself to use the entities elsewhere, that hack stops working – whichever way you do it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s