Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 38 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Moving cars
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 19, 2010 11:19 am
Hey, I'm trying to make a street that has a few cars moving (on both lanes) using the moving brush script. But the problem is their wheels aren't rotating (no animation).

When I started my map, I placed a BMP inside and it's tracks were "moving". So I selected the BMP_static model and the tracks aren't moving anymore. So I thought that all the vehicles that have a _static in their name, also have an animated state. Unfortunately, that only works for tracked vehicles (M1A2, T72, BMP), and probably the track texture is animated through a special shader or something like that.

So I tried using jeannotvb's tutorial on moving vehicles for SP and adapting it for MP. I made a script_vehicle_mp, added nodes, trigger, set everything up with the vehicle window (SHIFT+V). The problem is that I have to add _uaz.gsc to the zone file, which calls on other .gsc files, and in the end this file is called
Code:
animscripts\utility.gsc

which is nowhere to be found, so I get a script error.
But I don't think this is the right way to do it, so it doesn't really matter.

My question is: how do I make the cars' wheels to rotate ?
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 19, 2010 01:08 pm
Well, its a considerable bit of work, but it can be done -

To get the rotating/moving effect, the textures are created in Asset Manager using a material which is a model phong, with "Texture Scroll" check marked. If you deconstruct (no reference to Jacques Derrida!) the textures used in any model, you can re-make the materials that go with it to include texture scroll which will give you the animated effect on any model, on any given texture.

As I said, this is considerable work, but is possible. It was done 4 years ago over at IWNation.com by user Regolith (who made the now-famous Xmodel Extractor). Sadly, none of the movies he made showing what can be have survived so I cant actually show you any.

Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 19, 2010 03:35 pm
Pretty sure the killhouse level uses something you might like, check through the scripts for it.

Without playing it I can't remember vehicle anims but they had cars in both lanes moving.
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 19, 2010 05:45 pm
So it can't be done with animation in MP ?

@techno: killhouse in MP or SP ? I don't really remember which is the level in SP, but I remember the jeepride level (last level) and there were cars on that road (can't remember if their wheels were rotating, but surely they were, otherwise it would have been quite a bug), and the bm21's wheels were rotating (the trucks that were chasing you).
And surely that was done through animation, but it was SP.

Maybe someone who knows more about animation will read this and make a script. In the meantime, I will try to do what DemonSeed said, although I didn't understand half of it :)

Just kidding, I understood that I would have to remake the tire material for all the cars I want to use. If the texture scroll works like the threads of the tanks, then the part with the grooves on the tire will move. But what about the hub cap part, how would I make that revolve around its centre ?
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 19, 2010 06:02 pm
Quote:
Maybe someone who knows more about animation will read this and make a script.


There is no vehicle animation in MP with IW-created games. EVER! This is why people are always looking for "work-arounds" for the past 6 years. So, dont even bother trying to find one. And on one is going to write one for you, coz it cant be done.
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 19, 2010 07:10 pm
Didn't see this was for MP, OK forget the killhouse idea [drink]
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Sunday, Jan. 24, 2010 07:22 pm
OK, so I put some barriers alongside the road so now you can't see the tires (that's my workaround)... the highway is at quite some distance and you can't get closer, so I think it will work.

I'm having a problem with the script, though.
I have 5 different car models (script_models) which travel on 2 opposite lanes. At the beginning of each lane there is a script_origin (their names are startleft and startright) which serve as starting points for the cars.

This is what I made:
Code:
main()
{
	car1 = getent ("car1", "targetname");
	car2 = getent ("car2", "targetname");
	car3 = getent ("car3", "targetname");
	car4 = getent ("car4", "targetname");
	car5 = getent ("car5", "targetname");

	while(1)
	{
	activecarleft = car+randomintrange(1,6);
	activecarright = car+randomintrange(1,6);

	activecarleft thread leftcarmove();
	activecarright thread rightcarmove();
	wait 15;
	}
}

leftcarmove()
{
	startleft = getent ("startleft", "targetname");
	self.origin = startleft.origin;
	self rotateyaw(180, 0.1);
	cartime = 10+randomint(5);
	self movex(-2000, cartime);
	wait cartime;
	self rotateyaw(180, 0.1);
}

rightcarmove()
{
	startright = getent ("startright", "targetname");
	self.origin = startright.origin;
	cartime = 10+randomint(5);
	self movex(2000, cartime);
}


The line
Code:
activecarleft = car+randomintrange(1,6);
should select a random car from those 5, but I get an error that variable car isn't initialized.
I'm not sure how to concatenate a string and an integer. Any help ?

edited on Jan. 24, 2010 02:25 pm by cskiller86
Share |
Samuel033
General Member
Since: Dec 10, 2009
Posts: 484
Last: Dec 25, 2015
[view latest posts]
Level 5
Category: CoD4 MP Mapping
Posted: Sunday, Jan. 24, 2010 08:01 pm
Based on the code car isnt a string, but an unused variable. Just a thought but you might want to get a string first ("car" + some number). I'm not an experienced cod4 coder but I would think it should work.

temp = "car" + somerandomnumberstring;
activecarleft = getent (temp, "targetname");

Or just use a simple switch since there are only 5 possible cars. A switch with 5 cases for rightcar and second one for leftcar. The switch is certainly longer but more straightforward and makes it easy to add different types later. Pickup, Motorcycle etc. Just add another case.


Edit: Oooops, xholyx beat me to it [biggrin]






edited on Jan. 24, 2010 03:02 pm by Samuel033
Share |
xholyx
General Member
Since: Oct 17, 2007
Posts: 116
Last: Sep 7, 2010
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Sunday, Jan. 24, 2010 08:01 pm
try this:

Code:

main()
{
	
	while(1)
	{
	randcar = "car"+randomintrange(1,6)+"";
	randcar2 = "car"+randomintrange(1,6)+"";
	activecarleft = getent(randcar,"targetname");
	activecarright = getent(randcar2,"targetname");

	activecarleft thread leftcarmove();
	activecarright thread rightcarmove();
	wait 15;
	}
}

leftcarmove()
{
	startleft = getent ("startleft", "targetname");
	self.origin = startleft.origin;
	self rotateyaw(180, 0.1);
	cartime = 10+randomint(5);
	self movex(-2000, cartime);
	wait cartime;
	self rotateyaw(180, 0.1);
}

rightcarmove()
{
	startright = getent ("startright", "targetname");
	self.origin = startright.origin;
	cartime = 10+randomint(5);
	self movex(2000, cartime);
}


hehe nice one samual03 :P
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD4 MP Mapping
Posted: Monday, Jan. 25, 2010 11:27 am
Thanks for your answers.

I thought about case structure, last night while I was trying to get asleep.

It works the first way, though. The problem is when the same car gets selected at the same time, and it starts going backwards on one of the lanes. It's actually funny :)
Have to change the code a little... or to make a set of 5 cars for each lane.

edited on Jan. 25, 2010 06:52 am by cskiller86

OK, I made some changes and it works great. I added another car for when the numbers are equal.
Code:
main()
{
	while(1)
	{
	templ = "car"+randomintrange(1,6);
	tempr = "car"+randomintrange(1,6);
	if (templ == tempr)
		tempr = "carextra";
	activecarleft =  getent (templ, "targetname");
	activecarright =  getent (tempr, "targetname");

	activecarleft thread leftcarmove();
	activecarright thread rightcarmove();
	wait 13;
	}
}

leftcarmove()
{
	startleft = getent ("startleft", "targetname");
	self.origin = startleft.origin;
	self rotateyaw(180, 0.1);
	cartime = 7+randomint(5);
	self movex(-1600, cartime);
	wait cartime;
	self rotateyaw(180, 0.1);
}

rightcarmove()
{
	startright = getent ("startright", "targetname");
	self.origin = startright.origin;
	cartime = 7+randomint(5);
	self movex(1600, cartime);
}
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»