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

Members Online

»
0 Active | 60 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: Minefield
bail
General Member
Since: May 15, 2006
Posts: 23
Last: Feb 8, 2008
[view latest posts]
Level 1
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 12:42 pm
Hi
can anyone tell me the script to spawn a minefield in a stock map plz

Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 02:46 pm
No, mainly because there is no _minefield.gsc (as far as we know) like with the other CoD games... so there might not even be minefields in CoD4...
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 02:59 pm
Content of the _minefields.gsc from CoD4.
Code:
minefields()
{
	minefields = getentarray("minefield", "targetname");
	if (minefields.size > 0)
	{
		level._effect["mine_explosion"] = loadfx ("explosions/grenadeExp_dirt");
	}
	
	for(i = 0; i < minefields.size; i++)
	{
		minefields[i] thread minefield_think();
	}	
}

minefield_think()
{
	while (1)
	{
		self waittill ("trigger",other);
		
		if(isPlayer(other))
			other thread minefield_kill(self);
	}
}

minefield_kill(trigger)
{
	if(isDefined(self.minefield))
		return;
		
	self.minefield = true;
	self playsound ("minefield_click");

	wait(.5);
	wait(randomFloat(.5));

	if(isdefined(self) && self istouching(trigger))
	{
		origin = self getorigin();
		range = 300;
		maxdamage = 2000;
		mindamage = 50;

		self playsound("explo_mine");
		playfx(level._effect["mine_explosion"], origin);
		radiusDamage(origin, range, maxdamage, mindamage);
	}
	
	self.minefield = undefined;
}

[wink]
Share |
bail
General Member
Since: May 15, 2006
Posts: 23
Last: Feb 8, 2008
[view latest posts]
Level 1
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 03:01 pm
Thx for the code
How do i place a minefield in a certain map
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD4 MP Mapping
Posted: Friday, Jan. 11, 2008 03:34 pm
Well... you'll have to spawn a trigger_brush with the targetname "minefield" basically... take a look at how it's done in CoD2, as I suggested. There are some mods which do this.
Share |
zeroy
General Member
Since: Nov 26, 2007
Posts: 1060
Last: Mar 12, 2014
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Monday, Jan. 14, 2008 01:13 pm
Here is an example, this will spwan a Flag near big Skips in mp_shipment (this file is maps/mp/mp_shipment.gsc)

Code:

main()
{
	maps\mp\mp_shipment_fx::main();
	maps\createart\mp_shipment_art::main();
	maps\mp\_load::main();
	
	maps\mp\_compass::setupMiniMap("compass_map_mp_shipment");
	
	ambientPlay("ambient_middleeast_ext");

	game["allies"] = "sas";
	game["axis"] = "russian";
	game["attackers"] = "axis";
	game["defenders"] = "allies";
	game["allies_soldiertype"] = "woodland";
	game["axis_soldiertype"] = "woodland";

	setdvar( "r_specularcolorscale", "1" );

	setdvar("r_glowbloomintensity0",".1");
	setdvar("r_glowbloomintensity1",".1");
	setdvar("r_glowskybleedintensity0",".1");
	setdvar("compassmaxrange","1400");
	
	thread DoMinefield();

}

DoMinefield()
{

level.mines = [];
level.mines[0] = spawn("trigger_radius", (482, 606, 220), 0, 120, 50);

for(i=0;i<level.mines.size;i++)
	level.mines[i].targetname = "minefield";
 
minesign = [];
minesign[0] = spawn("script_model", (482, 606, 212));
minesign[0].angles = (0, 0, 0);

for(i=0;i<minesign.size;i++)
	minesign[i] setModel("prop_flag_brit");
}

Share |
BlacKnight
General Member
Since: Jan 8, 2008
Posts: 6
Last: Jan 15, 2008
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 15, 2008 01:59 am

maps\mp\mp_shipment_fx::main();
maps\createart\mp_shipment_art::main();
maps\mp\_load::main();

maps\mp\_compass::setupMiniMap("compass_map_mp_shipment");

ambientPlay("ambient_middleeast_ext");

game["allies"] = "sas";
game["axis"] = "russian";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "woodland";
game["axis_soldiertype"] = "woodland";

setdvar( "r_specularcolorscale", "1" );

setdvar("r_glowbloomintensity0",".1");
setdvar("r_glowbloomintensity1",".1");
setdvar("r_glowskybleedintensity0",".1");
setdvar("compassmaxrange","1400");

thread DoMinefield();

}

DoMinefield()
{

level.mines = [];
level.mines[0] = spawn("trigger_radius", (482, 606, 220), 0, 120, 50);

for(i=0;i
level.mines.targetname = "minefield";

minesign = [];
minesign[0] = spawn("script_model", (482, 606, 212));
minesign[0].angles = (0, 0, 0);

for(i=0;i
minesign setModel("prop_flag_brit");
} were do we insert this script at[confused]
Share |
zeroy
General Member
Since: Nov 26, 2007
Posts: 1060
Last: Mar 12, 2014
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 15, 2008 02:24 am
i beleive you need to pack the mp_shipment and _minefields file in a .ff , so you would need the mod tools for this :(
Share |
bail
General Member
Since: May 15, 2006
Posts: 23
Last: Feb 8, 2008
[view latest posts]
Level 1
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 15, 2008 08:15 pm
Hi thx for the help
spawning the flag works great but cant seem to get a minefield to spawn and trigger
any ideas?
thx
Share |
BlacKnight
General Member
Since: Jan 8, 2008
Posts: 6
Last: Jan 15, 2008
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Tuesday, Jan. 15, 2008 11:15 pm
zeroy writes...
Quote:
i beleive you need to pack the mp_shipment and _minefields file in a .ff , so you would need the mod tools for this :(


If possible if any one can set me up with this i would gladly thankyou for it[thumbs_up]
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

»