Moving vehicles in MP tut ?

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Moving vehicles in MP tut ?

Post by <LT>YosemiteSam[NL] » October 15th, 2007, 6:43 pm

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.

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » October 15th, 2007, 7:15 pm

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.
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

User avatar
[SoE]_Zaitsev
Core Staff
Core Staff
Posts: 14220
Joined: October 21st, 2004, 7:17 pm
Location: Holland
Contact:

Post by [SoE]_Zaitsev » October 16th, 2007, 12:25 pm

Reminds me a bit of the end on jm_railyard.

Leveller made that, maybe you could get in touch with him somehow.
matt101harris wrote:big cock was the first thing that came to my head lol

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Post by <LT>YosemiteSam[NL] » October 16th, 2007, 5:41 pm

aha, thx, I'll try it and get back yo ya.

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Post by <LT>YosemiteSam[NL] » October 17th, 2007, 6:52 pm

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)

All-Killer
CJ Worshipper
CJ Worshipper
Posts: 383
Joined: December 16th, 2005, 6:38 pm

Post by All-Killer » October 17th, 2007, 8:35 pm

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]
Image

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » October 17th, 2007, 11:00 pm

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); 
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

User avatar
<LT>YosemiteSam[NL]
Core Staff
Core Staff
Posts: 2155
Joined: December 7th, 2004, 2:07 am
Location: Netherlands
Contact:

Post by <LT>YosemiteSam[NL] » October 18th, 2007, 8:52 am

aha, ok. I'll try that this evening

All-Killer
CJ Worshipper
CJ Worshipper
Posts: 383
Joined: December 16th, 2005, 6:38 pm

Post by All-Killer » October 18th, 2007, 1:41 pm

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.
Image

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » October 18th, 2007, 11:06 pm

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.
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 19th, 2007, 2:08 pm

Use an array to link the clip to the vehicle.

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


Enough said.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest