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

Members Online

»
0 Active | 15 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: making waves
bodyguard
General Member
Since: Jun 30, 2005
Posts: 442
Last: Dec 4, 2007
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 07:57 am
hey guys

i recently asked anyone if they could tell me where i can find and how to add water onto a beach and make it lap up against the sand ...can anyone tell me how to do this and then also what texture i should use thanks guys

bodyguard[rocking]
Share |
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 10:51 am
the way that I did it is to make my beach have a slight angle to it, up away from the ocean. give it a bit of randomness with the terrain height, so it looks better in the end. make a huge brush with any of the water textures, and put it where you want the low end of the wave to be. turn it into a script_brush with a targetname of "water"

then put this in your .gsc:

Code:

tide()
{
	water = getent("water", "targetname");

	while(1)
	{
		wavespeed = randomint(5)+1;
		wavedelay = randomint(5)+1;
		water movez(10, wavespeed);
		water waittill("movedone");
		water movez(-10, wavespeed, wavespeed/3);
		water waittill("movedone");
		wait (wavedelay);
	}
}



I used to have a video of it in action, but I can't find it. basically though, the water brush moves up and down at random speeds, and since the beach is sloped, as the brush moves up, it also moves inward on the beach. depending on how you do the terrain, it can look pretty good actually.

And if that's not what you're asking about, sorry. I'm a bit tired at the moment.

As far as the textures, I just use any of them, but for oceans, I fit the texture to the brush to stretch it out, and make the normal ripples into larger waves. Looks good in DX7, can't vouch for DX9.

edited on Mar. 14, 2007 06:56 am by med
Share |
bodyguard
General Member
Since: Jun 30, 2005
Posts: 442
Last: Dec 4, 2007
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 11:03 am
hey med

if u can find that vid i would be very great ful thats exactly what i am asking about ...but what do u mean script_brush ..its been a while mate need the info hehehe..

i did the brush real slopes away like the ocean now all i need its to get this script_brush thing happening

thanks med
bodyguard
any replies greatful[rocking]
Share |
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 11:14 am
Sorry, it's been a while for me coding too. I meant a script_brushmodel. Right click on your water brush in the 2d screen, select script->brushmodel then press "n", give it a key of "targetname" and a value of "water"

here is the video I had. orbitfiles is the only way I can find to host it, so you'll have to download the file. it's not too big, iirc. and it kind of looks bad, but that's because I was just testing it out, and didn't really try to make the beach terrain look great.

http://www.orbitfiles.com/download/id1299284720

if that link doesn't work, download the waves.wmv from here:
http://www.orbitfiles.com/download/dylan_avery

edited on Mar. 14, 2007 07:16 am by med
Share |
bodyguard
General Member
Since: Jun 30, 2005
Posts: 442
Last: Dec 4, 2007
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 11:36 am
thanks mate just testing now see if it works ....

can u tell me if this gsc file is right i think at the end its got too many brackets



main()
{
// maps\mp\mp_paterson_fx::main();
// maps\mp\mp_paterson::main();
maps\mp\_load::main();

// setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
// setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
// set background ambient noise
ambientPlay("ambient_mp_paterson");


game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

// Set some cvars
setcvar("r_glowbloomintensity0","1");
setcvar("r_glowbloomintensity1","1");
setcvar("r_glowskybleedintensity0",".5");

tide()
{
water = getent("water", "targetname");

while(1)
{
wavespeed = randomint(5)+1;
wavedelay = randomint(5)+1;
water movez(10, wavespeed);
water waittill("movedone");
water movez(-10, wavespeed, wavespeed/3);
water waittill("movedone");
wait (wavedelay);
}
}




}
Share |
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 11:41 am
put the tide code after the last bracket in your .gsc, and inside the main() function, add a thread tide();

Should look something like this:

Code:

main()
{
// maps\mp\mp_paterson_fx::main();
// maps\mp\mp_paterson::main();
maps\mp\_load::main();

// setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
// setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
// set background ambient noise
ambientPlay("ambient_mp_paterson");


game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "normandy";

// Set some cvars
setcvar("r_glowbloomintensity0","1");
setcvar("r_glowbloomintensity1","1");
setcvar("r_glowskybleedintensity0",".5"); 

thread tide();
}

tide()
{
	water = getent("water", "targetname");

	water playloopsound("waves");

	while(1)
	{
		wavespeed = randomint(5)+1;
		wavedelay = randomint(5)+1;
		water movez(10, wavespeed);
		water waittill("movedone");
		water movez(-10, wavespeed, wavespeed/3);
		water waittill("movedone");
		wait (wavedelay);
	}
}

Share |
bodyguard
General Member
Since: Jun 30, 2005
Posts: 442
Last: Dec 4, 2007
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 11:56 am
hey mate its works the gsc file i mean and when i go into game i can see the water going up and down on the shore but i must of forgotten to highlight all sides of my brush as when the wave goes up i can see through the invisible brush will retry highlight all sides of brush ..not just top side ..

thanks mate for your quick help ..with gsc file

body[rocking]
Share |
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Mar. 14, 2007 07:17 pm
Sorry, I forgot about that part. Yeah, you need to make it a pretty thick brush, depending on how your water is set up. I think mine was about 64 units deep. All sides of the water, if they're player viewable, or player accessable, need to have the sloping beach, and you need to have the water brush extend well beyond the initial spot where it touches the beach. Otherwise, you have a block of water rising out of the ground.

Glad it worked for you. Can't wait to see your map with that in action. I gave up on the map I was using it on. [banghead]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»