Author Topic: [SOLVED] Loop vehicle?  (Read 185 times)

0 Members and 1 Guest are viewing this topic.

Offline Doodles_Inc

  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 117
  • Country: br
  • Respect: 36
  • if I surprised you, you had underestimated me
    • doodlescriminoser
    • View Profile
  • WaW: Doodles_Inc

Loop vehicle?

« on: September 09, 2017, 05:35:05 pm »
So, I need to make so when my vehicle reaches it's final node, he goes backwards till the start node and then goes to the final node in a loop, but, I don't really know how to code it, someone has any ideas?
I made a script, but it doesn't work, if you want to check it... [You are not allowed to view external links. Register or Login to see them]
Thanks.
« Last Edit: September 09, 2017, 05:38:02 pm by Doodles_Inc »
if I surprised you, it was because you underestimated me

This topic contains a post which is marked as the Best Answer. Click here to view it.

Offline Wolfilms

  • Rotting Walker
  • Posts: 68
  • Country: us
  • Respect: 10
    • View Profile

Re: Loop vehicle?

« Reply #1 on: September 10, 2017, 09:24:24 am »
I'm guessing the train moves to the last node, but then never goes back the other way? Meaning you can get it moving forward, but it won't go backwards?

Offline Doodles_Inc

  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 117
  • Country: br
  • Respect: 36
  • if I surprised you, you had underestimated me
    • doodlescriminoser
    • View Profile
  • WaW: Doodles_Inc

Re: Loop vehicle?

« Reply #2 on: September 10, 2017, 01:25:18 pm »
I'm guessing the train moves to the last node, but then never goes back the other way? Meaning you can get it moving forward, but it won't go backwards?
Exactly

Offline Wolfilms

  • Rotting Walker
  • Posts: 68
  • Country: us
  • Respect: 10
    • View Profile

Re: Loop vehicle?

« Reply #3 on: September 10, 2017, 02:42:15 pm »
My best guess is you can't have negative speed (so -25, and -4 aren't possible... I think). I can't test anything now, but you might need to get another path that goes the the opposite way since the original path only goes forward (meaning the nodes are connected the the one in front of it).

Offline Doodles_Inc

  • - Original Poster (OP) -
  • Pack-a-Puncher
  • Posts: 117
  • Country: br
  • Respect: 36
  • if I surprised you, you had underestimated me
    • doodlescriminoser
    • View Profile
  • WaW: Doodles_Inc

Re: Loop vehicle?

« Reply #4 on: September 11, 2017, 11:05:22 am »
So yeah, after a lot of research and the Wolfilms repeated nodes method, I had managed to make it work, kind of, but, a guy named ZoekMeMaar, sad that, I can set a new path for the vehicle whenever I want like this:
    n_path_start = GetVehicleNode( "new_node", "targetname" );
    level.vh_train AttachPath( n_path_start );
    level.vh_train StartPath();
So yeah, if I mix this and the Wolfilms method, problem solved!
« Last Edit: September 11, 2017, 11:10:23 am by Doodles_Inc »

Marked as best answer by Doodles_Inc. [22/09/2017, 20:05:26]