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

Members Online

»
0 Active | 89 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 Map + Mod Releases
Release announcements of custom maps and mods and other content related to Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: Mod like this
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Map + Mod Releases
Posted: Thursday, Jul. 15, 2010 08:31 pm
1337MattY writes...
Quote:
BraX writes...
Quote:
1337MattY writes...
Quote:
For ROTU, the mod in that video, most of the work was already done for them, as they used the basic scripting framework from the Before the Dawn zombie mod. They just added simple TESTCLIENTS to the script origins, and basicly edited there animations. If you want this in cod2, you will have to ask the creator of the Before the Dawn mod.


We haven't used Before The Dawn Mod - Reign Of The Undead uses some parts of code from PezBot, Bipo wrote zombie AI and classes and i made rest such as admin menu, turret and models so in 100% RotU isn't based and dont have anything to do with BTD.


Yeah, but Before the Dawn uses most of PezBot code also, I was just going higher up the hierarchy


Well, BTD is based on PezBot and uses more PezBot scripts than RotU, i got the source files from RotU because i am developing that mod with Bipo so i see just path finding fuctions from PezBot, well if you noticed Zombies in RotU are smart and they will be triggered only if you shot one of them or make too much noise, they are destroying baricades and defence turrets and now in RotU 2.0 which is under development we are making campaing game mode with objectives so zombies are now trying to stop you - they can ambush you, hide somewhere and wait for your move, rush you or do something diferent.
Share |
cod2fun
General Member
Since: Aug 26, 2009
Posts: 75
Last: Sep 13, 2010
[view latest posts]
Level 3
Category: CoD2 Map + Mod Releases
Posted: Thursday, Jul. 15, 2010 09:31 pm
so it is posible to make somthing like this in cod2? if it is ..so what are we waiting for? lets go to business [rocking][machine_gun]

seriously guys if someone of you think he can make this and have will to do it...send me pm ...i can help making maps..[cool]


Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Map + Mod Releases
Posted: Friday, Jul. 16, 2010 07:27 am
cod2fun writes...
Quote:
so it is posible to make somthing like this in cod2? if it is ..so what are we waiting for? lets go to business [rocking][machine_gun]

seriously guys if someone of you think he can make this and have will to do it...send me pm ...i can help making maps..[cool]


There is too many thiefs... you can make mod but Hungarians will steal your work.
Share |
Mitch*
General Member
Since: Jan 23, 2007
Posts: 24
Last: Nov 10, 2012
[view latest posts]
Level 1
Category: CoD2 Map + Mod Releases
Posted: Friday, Jul. 16, 2010 07:50 am
BraX writes...
Quote:
Mitch* writes...
Quote:
Recreating BTD in cod2 is almost impossible, because the function setcandamage is not supported in MP (only in SP).

you need setcandamage to get the damage that you do when you shoot at him. If someone knows how to do this, then it would be possible to recreate it in cod2. (or get a modified version of cod2 mp with this function :))

http://www.zeroy.com/script/damage/setcandamage.htm (it is supported in cod4 mp)


It is easy to recreate setCanDamage() function in CoD2 with bulletTrace(), here is what i've used in CoD2 to do damageable entities:
Code:
setCanDamage( flag )
{
	if( !isDefined( self.bashradius ) )
		self.bashradius = 32;

	if( !flag )
	{
		self notify("kill_damagemonitor");
		return;
	}
	else
		self thread setCanDamage2();
}


setCanDamage2()
{
	self endon("kill_damagemonitor");

	trace = undefined;

	while( 1 )
	{

		players = getEntArray( "player", "classname" );
		for( i = 0; i < players.size; i++ )
		{
			p = players[i];

			if( !isDefined( p.bash_delay ) )
				p.bash_delay = false;

			forward = vectorscale( anglesToForward(p getPlayerAngles()), 10000 );
			startOrigin = p getEye() + (0,0,20);
			endOrigin = startOrigin + forward;

			trace = bulletTrace( startOrigin, endOrigin, true, p );
			distance = distance ( self.origin, p.origin ) ;

			wait 0.05;

			if( isDefined( trace["entity"] ) && trace["entity"] == self )
			{
				if( p attackButtonPressed() && isWeapon( p getCurrentWeapon() ) && p getWeaponSlotClipAmmo(p getCurrentSlot()) > 0)
				{
					weap = p getCurrentWeapon();
					dmg = getDamage( weap );
					who = p;
					point = trace["position"];
					mod = damageMod( weap );

					self notify("dmg", dmg, who, weap, point, mod);
				}
				if ( p meleeButtonPressed() && !p.bash_delay && distance( p.origin, self.origin ) < self.bashradius )
				{
					p thread bash_delay( 0.6 );
					weap = p getCurrentWeapon();
					dmg = getDamage( weap );
					who = p;
					point = trace["position"];
					mod = "MOD_MELEE";

					self notify("dmg", dmg, who, weap, point, mod);
				}

			}

		}
		wait 0.05;
	}
}
[b][..................][/b]


what kind of entities do you use then? I tested your script on a script_model and the trace can't the entity.
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Map + Mod Releases
Posted: Friday, Jul. 16, 2010 08:20 am
The script isn't tracking projectiles and grenades but its easy to put grenades and projectiles in array and check distance to damageable model.

Full source code of CoD2's setCanDamage():
Code:
damageModel()
{
	bullet = spawn( "script_model", self.origin );
	bullet setModel( "xmodel/tombstone1" );
	bullet.angles = ( 0, 0, 0 );

	bullet setCanDamage(1); // turn damage monitor on
	bullet setContents(1); // bullet will collide with model
	bullet.health = 1000;

	while( bullet.health > 0 )
	{
		// wait for damage...
		bullet waittill("dmg", dmg, who, weap, point, mod);
		bullet.health -= dmg;

		iPrintln("dmg:" + dmg + "; who:" + who.name + "; mod:" + mod);
	}
}

setCanDamage( flag )
{
	if( !isDefined( self.bashradius ) )
		self.bashradius = 32;

	if( !flag )
	{
		self notify("kill_damagemonitor");
		return;
	}
	else
		self thread setCanDamage2();
}


setCanDamage2()
{
	self endon("kill_damagemonitor");

	trace = undefined;

	while( 1 )
	{

		players = getEntArray( "player", "classname" );
		for( i = 0; i < players.size; i++ )
		{
			p = players[i];

			if( !isDefined( p.bash_delay ) )
				p.bash_delay = false;

			forward = vectorscale( anglesToForward(p getPlayerAngles()), 10000 );
			startOrigin = p getEye() + (0,0,20);
			endOrigin = startOrigin + forward;

			trace = bulletTrace( startOrigin, endOrigin, true, p );
			distance = distance ( self.origin, p.origin ) ;

			wait 0.05;

			if( isDefined( trace["entity"] ) && trace["entity"] == self )
			{
				if( p attackButtonPressed() && isWeapon( p getCurrentWeapon() ) && p getWeaponSlotClipAmmo(p getCurrentSlot()) > 0)
				{
					weap = p getCurrentWeapon();
					dmg = getDamage( weap );
					who = p;
					point = trace["position"];
					mod = damageMod( weap );

					self notify("dmg", dmg, who, weap, point, mod);
				}
				if ( p meleeButtonPressed() && !p.bash_delay && distance( p.origin, self.origin ) < self.bashradius )
				{
					p thread bash_delay( 0.6 );
					weap = p getCurrentWeapon();
					dmg = getDamage( weap );
					who = p;
					point = trace["position"];
					mod = "MOD_MELEE";

					self notify("dmg", dmg, who, weap, point, mod);
				}

			}

		}
		wait 0.05;
	}
}

bash_delay( time )
{
	self endon("disconnected");
	self.bash_delay = true;
	wait time;
	self.bash_delay = false;
}

getDamage(weapon)
{
	switch(weapon)
	{
	case "springfield_mp":
		return 50;
	case "enfield_scope_mp":
		return 50;
	case "mosin_nagant_sniper_mp":
		return 50;
	case "kar98k_sniper_mp":
		return 50;
	case "mosin_nagant_mp":
		return 50;
	case "kar98k_mp":
		return 50;
	case "m1carbine_mp":
		return 38;
	case "m1garand_mp":
		return 38;
	case "enfield_mp":
		return 50;
	case "SVT40_mp":
		return 38;
	case "g43_mp":
		return 38;
	case "bar_mp":
		return 40;
	case "bren_mp":
		return 40;
	case "mp44_mp":
		return 40;
	case "thompson_mp":
		return 35;
	case "sten_mp":
		return 33;
	case "greasegun_mp":
		return 34;
	case "mp40_mp":
		return 36;
	case "ppsh_mp":
		return 30;
	case "PPS42_mp":
		return 40;
	case "shotgun_mp":
		return 40;
	case "panzerschreck_mp":
		return 400;
	case "TT30_mp":
		return 20;
	case "webley_mp":
		return 20;
	case "colt_mp":
		return 20;
	case "luger_mp":
		return 20;
	default:
		return 70;
	}
}

damageMod(weapon)
{
	switch(weapon)
	{
	case "springfield_mp":
	case "enfield_scope_mp":
	case "mosin_nagant_sniper_mp":
	case "kar98k_sniper_mp":
	case "mosin_nagant_mp":
	case "kar98k_mp":
	case "enfield_mp":
		return "MOD_RIFLE_BULLET";

	case "m1carbine_mp":
	case "m1garand_mp":
	case "SVT40_mp":
	case "g43_mp":
	case "bar_mp":
	case "bren_mp":
	case "mp44_mp":
	case "thompson_mp":
	case "sten_mp":
	case "greasegun_mp":
	case "mp40_mp":
	case "ppsh_mp":
	case "PPS42_mp":
	case "shotgun_mp":
		return "MOD_RIFLE_BULLET";

	case "TT30_mp":
	case "webley_mp":
	case "colt_mp":
	case "luger_mp":
		return "MOD_PISTOL_BULLET";

	case "panzerschreck_mp":
	case "panzerfaust_mp":
		return"MOD_PROJECTILE";

	default:
		return "MOD_UNKNOWN";
	}
}



edited on Jul. 16, 2010 04:34 am by BraX
Share |
Mitch*
General Member
Since: Jan 23, 2007
Posts: 24
Last: Nov 10, 2012
[view latest posts]
Level 1
Category: CoD2 Map + Mod Releases
Posted: Friday, Jul. 16, 2010 09:03 am
BraX writes...
Quote:
The script isn't tracking projectiles and grenades but its easy to put grenades and projectiles in array and check distance to damageable model.

Full source code of CoD2's setCanDamage():
Code:
damageModel()
{
	bullet = spawn( "script_model", self.origin );
	bullet setModel( "xmodel/tombstone1" );
	bullet.angles = ( 0, 0, 0 );

	bullet setCanDamage(1); // turn damage monitor on
	bullet setContents(1); // bullet will collide with model
	bullet.health = 1000;

	while( bullet.health > 0 )
	{
		// wait for damage...
		bullet waittill("dmg", dmg, who, weap, point, mod);
		bullet.health -= dmg;

		iPrintln("dmg:" + dmg + "; who:" + who.name + "; mod:" + mod);
	}
}

setCanDamage( flag )
{
	if( !isDefined( self.bashradius ) )
		self.bashradius = 32;

	if( !flag )
	{
		self notify("kill_damagemonitor");
		return;
	}
	else
		self thread setCanDamage2();
}


setCanDamage2()
{
	self endon("kill_damagemonitor");

	trace = undefined;

	while( 1 )
	{

		players = getEntArray( "player", "classname" );
		for( i = 0; i < players.size; i++ )
		{
			p = players[i];

			if( !isDefined( p.bash_delay ) )
				p.bash_delay = false;

			forward = vectorscale( anglesToForward(p getPlayerAngles()), 10000 );
			startOrigin = p getEye() + (0,0,20);
			endOrigin = startOrigin + forward;

			trace = bulletTrace( startOrigin, endOrigin, true, p );
			distance = distance ( self.origin, p.origin ) ;

			wait 0.05;

			if( isDefined( trace["entity"] ) && trace["entity"] == self )
			{
				if( p attackButtonPressed() && isWeapon( p getCurrentWeapon() ) && p getWeaponSlotClipAmmo(p getCurrentSlot()) > 0)
				{
					weap = p getCurrentWeapon();
					dmg = getDamage( weap );
					who = p;
					point = trace["position"];
					mod = damageMod( weap );

					self notify("dmg", dmg, who, weap, point, mod);
				}
				if ( p meleeButtonPressed() && !p.bash_delay && distance( p.origin, self.origin ) < self.bashradius )
				{
					p thread bash_delay( 0.6 );
					weap = p getCurrentWeapon();
					dmg = getDamage( weap );
					who = p;
					point = trace["position"];
					mod = "MOD_MELEE";

					self notify("dmg", dmg, who, weap, point, mod);
				}

			}

		}
		wait 0.05;
	}
}

bash_delay( time )
{
	self endon("disconnected");
	self.bash_delay = true;
	wait time;
	self.bash_delay = false;
}

getDamage(weapon)
{
	switch(weapon)
	{
	case "springfield_mp":
		return 50;
	case "enfield_scope_mp":
		return 50;
	case "mosin_nagant_sniper_mp":
		return 50;
	case "kar98k_sniper_mp":
		return 50;
	case "mosin_nagant_mp":
		return 50;
	case "kar98k_mp":
		return 50;
	case "m1carbine_mp":
		return 38;
	case "m1garand_mp":
		return 38;
	case "enfield_mp":
		return 50;
	case "SVT40_mp":
		return 38;
	case "g43_mp":
		return 38;
	case "bar_mp":
		return 40;
	case "bren_mp":
		return 40;
	case "mp44_mp":
		return 40;
	case "thompson_mp":
		return 35;
	case "sten_mp":
		return 33;
	case "greasegun_mp":
		return 34;
	case "mp40_mp":
		return 36;
	case "ppsh_mp":
		return 30;
	case "PPS42_mp":
		return 40;
	case "shotgun_mp":
		return 40;
	case "panzerschreck_mp":
		return 400;
	case "TT30_mp":
		return 20;
	case "webley_mp":
		return 20;
	case "colt_mp":
		return 20;
	case "luger_mp":
		return 20;
	default:
		return 70;
	}
}

damageMod(weapon)
{
	switch(weapon)
	{
	case "springfield_mp":
	case "enfield_scope_mp":
	case "mosin_nagant_sniper_mp":
	case "kar98k_sniper_mp":
	case "mosin_nagant_mp":
	case "kar98k_mp":
	case "enfield_mp":
		return "MOD_RIFLE_BULLET";

	case "m1carbine_mp":
	case "m1garand_mp":
	case "SVT40_mp":
	case "g43_mp":
	case "bar_mp":
	case "bren_mp":
	case "mp44_mp":
	case "thompson_mp":
	case "sten_mp":
	case "greasegun_mp":
	case "mp40_mp":
	case "ppsh_mp":
	case "PPS42_mp":
	case "shotgun_mp":
		return "MOD_RIFLE_BULLET";

	case "TT30_mp":
	case "webley_mp":
	case "colt_mp":
	case "luger_mp":
		return "MOD_PISTOL_BULLET";

	case "panzerschreck_mp":
	case "panzerfaust_mp":
		return"MOD_PROJECTILE";

	default:
		return "MOD_UNKNOWN";
	}
}



edited on Jul. 16, 2010 04:34 am by BraX


Ok, my problem with the trace was the model. It didn't had a collision model. Your script works very good :)
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Map + Mod Releases
Posted: Tuesday, Jun. 14, 2011 09:52 am
Sorry for the bump, but i get an error
Code:
if( p attackButtonPressed() && isWeapon( p getCurrentWeapon() ) && p getWeaponSlotClipAmmo(p getCurrentSlot()) > 0)

but i dont see whats wrong?!
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Map + Mod Releases
Posted: Tuesday, Jun. 14, 2011 11:27 am
nwestenberg writes...
Quote:
Sorry for the bump, but i get an error
Code:
if( p attackButtonPressed() && isWeapon( p getCurrentWeapon() ) && p getWeaponSlotClipAmmo(p getCurrentSlot()) > 0)

but i dont see whats wrong?!


I dont see whats wrong either, because you didnt post the error.

Could be anything, ranging from undefined is not an ent to syntax error, to "yo mom is too fat"
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Map + Mod Releases
Posted: Tuesday, Jun. 14, 2011 12:10 pm
yeah sorry, forgot it.
It says unknown function and i use the script above from Brax.

Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Map + Mod Releases

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

»