So i've been considering slight change on the payload map i am working on and i couldn't find much reference over internet about this issue. I'll explain what i want would like to do and what seems to happen if i do it.
I have path_track path_69, in which i have next stop target as path_70_alt_1 and branch path path_70. So basically the alt-way is enabled on the go and once the cart would read certain point on the track, i would trigger EnableAlternatePath so the track would change it's way to path_70 but problem is that the map crashes as soon as i join team (because the payload goal system cannot reach to the end and create visual path gui)
If i keep the original path from path_69 to path_70 and branch as path_70_alt_1 and switch for example on point capture with EnableAlternatePath, game crashes again. Anyone got such idea working like how switch from next stop target to branch path?
I think that the branching path logic on path_tracks is broken, and to my knowledge people that make branching payloads use I/Os to enable a path at random (starting with both disabled).
I wouldn't advise you do this. Firstly you are limited by the HUD--both paths need to be the same length or it completely breaks and becomes unusable. Secondly it's very difficult to balance. I believe the only "finished" map to do this is pl_Dyanamite (yes, capitalized) and it's not only really imbalanced but also quite a terribly done map in the first place. The maps that never got finished that used branching paths might be more balanced but again the strain of such an idea is so much that no one really finishes. I think nik was making one, if I remember right, and it never left alpha.
Yeah i suspected that it could be broken as the hud won't adjust on the fly and trying to do so will cause game crash. But the main idea was that lets say if other team reaches fairly quick to CP1 and is onward on CP2, they have to take the longer route. When teams switch, if the other team nearly manages to CP1 and is onward to CP2, they would have the shorter route in their use. So i would disable the alternative way completely if there is little time left.
This is actually a quite far thought idea, as both teams will have the longer route (if they are both good) but would the player understand that, it is another case. I would hate to rely on random route picking as it completely breaks the idea.
I guess what i am trying to do is not possible atm.
YES IT IS! everything is possible.
have you considered using the teleportToPathTrack input on func_tracktrain? that way you can get the cart on any path you want (crash free!) but I'm not sure the hud is going to work. There might be a way to fix the hud depending on your track layout but hey, one thing at a time.
I considered teleporting but it would make it jump from spot to another, thus, looking very stupid. It's used only on multiple stage payloads.
Though.. if i make it teleport on same spot as it starts teleport from, just changing the path_track, it could work unless it's disappearing and appearing with delay. Interesting, I'll try that. Thanks.
just make sure paths are equal lenghts, make sure rollbacks etc. occur in the same are. here is a link to on of my maps that might help. http://forums.tf2maps.net/downloads.php?do=file&id=4870 also pl_clastic_heights has an alternate route example. just decomplie it. it is on the contest entry page for dynamic payload. it is my map. actually anyone can do the same if they want to.
Here's the caveat:
The HUD does not update properly after setup is complete.
I'm failing to remember the exact conditions, but I believe the path would only properly update the HUD if the route moved from no roll zones to one with roll zones, and back. Things also get wonky if the route changes in length.
What I did for my Dynamic Payload contest entry is a bit of a hack. Simply, I set the default route to be path_start to path_end, then have the alternate on path_start to be the true next path, then I can do whatever modifications to the route I want to, then on setup end do the following (IIRC):
1) disable the team train watcher entity
2) switch path_start to it's alternate route (the true route)
3) re-enable the team train watcher
If you'd like the uncompiled map to dissect, I'd be happy to supply that.