Page 1 of 1

Moving vehicles in MP tut ?

Posted: October 15th, 2007, 6:43 pm
by <LT>YosemiteSam[NL]
Is it at all possible to make a movable jeep (model jeep).
I read the post regarding the rollercoaster but I can't figure it out.
Searched around for a tut but can only find the SP tut.

Posted: October 15th, 2007, 7:15 pm
by Luke
You can make it move just like you can a brushmodel, if thats all you're trying to do. You just need to add the model as a script_model and give it a targetname. I think theres at least 1 tutorial on scripting objects to move on here.

Posted: October 16th, 2007, 12:25 pm
by [SoE]_Zaitsev
Reminds me a bit of the end on jm_railyard.

Leveller made that, maybe you could get in touch with him somehow.

Posted: October 16th, 2007, 5:41 pm
by <LT>YosemiteSam[NL]
aha, thx, I'll try it and get back yo ya.

Posted: October 17th, 2007, 6:52 pm
by <LT>YosemiteSam[NL]
Ok, I made a movable truck. But you can walk through it. I made it a script_model instead of a script_brushmodel, cause script_brushmodel doesn't work on models like a car (I think).
Any suggestions on how to make the truck solid (not with clip around it I mean)

p.s. When you place the same truckmodel in a map it's solid. (just standing in a map, not moving I mean)

Posted: October 17th, 2007, 8:35 pm
by All-Killer
KS is correct, but to do it even better its better to make a array of the clips and vehicle, you can do this by giving them the same targetname, only a little change to the code.

Instead of vehicle = getent ...... use this:

Code: Select all

vehicle = getentarray("vehicle","targetname");

   for (i=0 ; i < vehicle.size; i++) 
Offcourse change the name to somewhat else.

Now the game will see the clips and the boat was 1 object so they will nicely move the same. KS way is also possible but this is just a bit cleaner code to use.[/code]

Posted: October 17th, 2007, 11:00 pm
by Luke
If you want multiple vehicles moving in differen't directions, speeds and distances, that won't work. Would be easier to just link the clips to the vehicles with

Code: Select all

clip linkto(vehicle); 

Posted: October 18th, 2007, 8:52 am
by <LT>YosemiteSam[NL]
aha, ok. I'll try that this evening

Posted: October 18th, 2007, 1:41 pm
by All-Killer
Why cant that work? Cant see why?

If you want multiple vehicles moving all a different way, then you need to have different coordinants in the commands right? So it doesnt make sence then.. you just need more arrays like vehicle1, 2 etc.

Posted: October 18th, 2007, 11:06 pm
by Luke
Well i'm not saying it won't work, just that generally you would use an array for things that do the same thing. I guess you could do it like that with a defined speed, and target each vehicle. But it depends what he wants to do with them.

Posted: October 19th, 2007, 2:08 pm
by Drofder2004
Use an array to link the clip to the vehicle.

for(i=0;i<array.size;i++)
array linkto(vehicle);


Enough said.