UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Doodles_Inc on September 10, 2017, 02:35:05 am

Title: Loop vehicle?
Post by: Doodles_Inc on September 10, 2017, 02:35:05 am
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... https://pastebin.com/jLxivaUp (https://pastebin.com/jLxivaUp)
Thanks.
Title: Re: Loop vehicle?
Post by: Wolfilms on September 10, 2017, 06:24:24 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?
Title: Re: Loop vehicle?
Post by: Doodles_Inc on September 10, 2017, 10: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
Title: Re: Loop vehicle?
Post by: Wolfilms on September 10, 2017, 11: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).
Title: Re: Loop vehicle?
Post by: Doodles_Inc on September 11, 2017, 08:05:22 pm
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!