A moving path_track

Avatar
KyloX
62 Posts
Posted Mar 11, 2015
Okey, this is what I got:

I have 2 tracktrains, first is moving a straight line, second should be moving to first tracktrain. But I am facing a problem were path_tracks don't parent to a moving object, instead, second tracktrain moves to the middle of the map ( the center of the map ).

// From Valves wiki, path_track doesn't parent to a movable object.
Is there a way around this or I am busted with this?

Advertisement
Registered users don't see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Mar 12, 2015
Replied 23 hours later
Hey,

Like you read, it's not possible to parent the path_tracks. I remember I even tried one time disabling the SmartEdit and adding the keyvalue "parentname" to no avail.

I'm not sure exactly about what you are attempting to achieve, but if I think in 2 dimensions I can always make it by making the 2nd train to follow up a diagonal line (but at a higher speed than the first train) like so:

What you could alternatively do is this:

  • Make your second moving thingie (brush, entity, whatever...)
  • Parent it to a func_door entity. Make the func_door brush the size you wish according to the movement you want your moving thing to describe.
  • Parent the func_door to your first tracktrain, and make the door to open whenever you want.

Example:

I hope that helped.

Avatar
KyloX
62 Posts
Posted Mar 12, 2015
Replied 31 minutes later
Thanks for the reply, but it isn't fully what I am looking for.

This is the full plan I want:
I am trying to make a horror map with similar expects of the games monster SCP-173. While the player doesn't look at the object, it gets closer to player.
As npcs don't work in Portal 2 as well they don't move so fast. I tried making a tracktrain mechanism and it almost working... just the part where actually going to a player doesn't.
I though point_teleport might solve my problem by teleporting path_track to a player in some periods of time, but... point_teleport doesn't parent as well...

Avatar
josepezdj
2,386 Posts
Posted Mar 12, 2015
Replied 4 hours later

Hmmmm... if I got your meaning right, the only real way to achieve what you want is Vscripting, since you need to update every once in a while your moving object position in accordance to the player's position.

I might feel capable of giving you a hand on it despite of my limited scripting knowledge... if you allow me a reasonable time (I'm top busy lately). Basicly the idea would be:

  • You get the player's position, a vector.
  • You get your moving object's initial position, another vector.
  • You set as the new position for your moving object some point between its original position and the players' position X units away from any of them and every X seconds, only when the player is not looking at the moving object. This can be made by means of a trigger_look parented to the moving object and a basic script.
Avatar
CamBen
973 Posts
Posted Mar 12, 2015
Replied 2 minutes later
I achieved a sorta working scp 173 in portal 2 using phys_thrusters and large triggers to detect the player so it knows where to push but I have a feeling Jose's method would be better.
Avatar
KyloX
62 Posts
Posted Mar 12, 2015
Replied 1 hour later
But if using Vscripting the way you explain it, he probably would just go for the player in a straight line always. If it were one big empty room this would be perfect, but in a maze structure, would it work?
Unless... triggers to teleport the "object" closer or on corners of the hallway.
Advertisement
Registered users don't see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Mar 12, 2015
Replied 14 minutes later
Well, you're right, my idea was the simplest case. I'm sure what you said can also be achieved by vscripting, but I can't manage it, it's out of my current vscripting knowledge, sorry