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

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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: I still cant make a usable door?
dkbiker3501
General Member
Since: May 5, 2009
Posts: 26
Last: Aug 25, 2010
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Thursday, May. 7, 2009 01:19 am
No matter what tutorials i follow script i copy, i just can get a usable door to work. i get errors no matter what i do. errors like the bad syntax or how it couldn't find mp_door blah ::main blah.. can somebody give me a thorough explanation on how to do this. I'm kinda a noob with scripts so if your explaining something try and make it noob compatible.. thanks [duh]
Share |
dkbiker3501
General Member
Since: May 5, 2009
Posts: 26
Last: Aug 25, 2010
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Thursday, May. 14, 2009 12:06 am
please? my map cant be finished with out these doors working :(
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Thursday, May. 14, 2009 12:46 am
==============
NORMAL DOORS
==============


In Radiant, draw your door.

Next, duplicate the door, and line up the duplicated door over the original.
Change your grid to 0.5.
Next, we need to create the hinge with this duplicated door. Resize the duplicated brush to fit only one of the sides, but make sure that this part, being the hinge, is inside the wall, but still touching the door, and the thinnest it can be in 0.5 grid. Texture it tools>origin.

Should look like this.



The reason it needs to be so thin is because this is what the door rotates from, and it will rotate from the center of this origin brush. If the origin brush is too fat, the door will rotate inside the wall and look bad.



Then select your door and your origin brush, right click 2D screen and go to script>brushmodel. Both brushes should now be Blue, in the 2D window.

Next, draw a brush for your trigger, make it at least the height of the door and a little wider if you can.



While the trigger only is selected, press "N" and give it the following values.
Key: targetname
Value: door_trig


You can also give it some hintstring values if you want.
Key: hintstring
Value: PLATFORM_HOLD_TO_USE


And/or you can give the door that little white hand that pops up.
Key: cursorhint
Value: HINT_ACTIVATE


We need to also tell this trigger which way we want the door to open. Will it open 90? or -90? or whatever.

Give the door the following value. It must be one or the other. This tells the door which way to open, towards you or away from you.
Key: count
Value: 90


So now the trigger is set up, only thing left to do is link the trigger to the door and hinge, and since the door and hinge is already one script_brushmodel family, we simply First select the trigger, then just one piece of the door, and press "W".
A blue line with an arrow pointing from the trigger to the door should now be visible. And all brushes should suddenly be selected. All parts of the door, the hinge, and the trigger.

Radiant Complete.



=========
SCRIPTING
=========


Use One of the following scripts for this door setup.


SCRIPT #1 (Door Closes after 5 seconds)

Code:
main()
{
   thread player_doors();
}

player_doors()
{
   doors = getentarray("door_trig","targetname");
   for(i=0;i< doors.size;i++)
   {
      doors[i] thread door_think();
   }
}

door_think()
{
   self.doormoving = false;
   self.doormodel = getent(self.target, "targetname");

   while(1)
   {
      self waittill("trigger", player);
      self maps\mp\_utility::triggerOff();
      if(!self.doormoving)
      self thread door_move();
   }
}

door_move()
{
   self.doormoving = true;
   self.doormodel playsound("metal_open");
   self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
   self.doormodel waittill("rotatedone");
   wait (5);
   self.doormodel playsound("metal_close");
   self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
   self.doormodel waittill("rotatedone");
   self maps\mp\_utility::triggerOn();
   self.doormoving = false;
}


SCRIPT #2 (Player Must Close Door)

Code:
main()
{
   thread player_doors();
}

player_doors()
{
   doors = getentarray("door_trig","targetname");
   for(i=0;i< doors.size;i++)
   {
      doors[i] thread door_think();
   }
}

door_think()
{
   self.doormoving = false;
   self.doormodel = getent(self.target, "targetname");

   while(1)
   {
      self waittill("trigger", player);
      self maps\mp\_utility::triggerOff();
      if(!self.doormoving)
      self thread door_move();
   }
}

door_move()
{
   self.doormoving = true;
   if(self.doorclosed)
   {
      self.doormodel playsound("metal_open");
      self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
      self.doormodel waittill("rotatedone");
      self maps\mp\_utility::triggerOn();
   }
   else
   {
      self.doormodel playsound("metal_close");
      self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
      self.doormodel waittill("rotatedone");
      self maps\mp\_utility::triggerOn();
   }
   self.doormoving = false;
}


Name the script to something as such > mp_mymapname_doors.gsc

Place it in the following path > maps\mp\mp_mymapname_doors.gsc

So that's it, don't forget to add the script to your zone file, and to pick out a sound to use for your door.

Open your mp_mymapname.gsc

Add the following line:

maps\mp\mp_mymapname_doors::main();

Which is the name of the .gsc/script!

Then in your Zone file, make sure the following line exists.

rawfile,maps/mp/mp_mymapname_doors.gsc
Share |
dkbiker3501
General Member
Since: May 5, 2009
Posts: 26
Last: Aug 25, 2010
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Thursday, May. 14, 2009 07:21 pm
DeekCiti writes...
Quote:
==============
NORMAL DOORS
==============


In Radiant, draw your door.

Next, duplicate the door, and line up the duplicated door over the original.
Change your grid to 0.5.
Next, we need to create the hinge with this duplicated door. Resize the duplicated brush to fit only one of the sides, but make sure that this part, being the hinge, is inside the wall, but still touching the door, and the thinnest it can be in 0.5 grid. Texture it tools>origin.

Should look like this.



The reason it needs to be so thin is because this is what the door rotates from, and it will rotate from the center of this origin brush. If the origin brush is too fat, the door will rotate inside the wall and look bad.



Then select your door and your origin brush, right click 2D screen and go to script>brushmodel. Both brushes should now be Blue, in the 2D window.

Next, draw a brush for your trigger, make it at least the height of the door and a little wider if you can.



While the trigger only is selected, press "N" and give it the following values.
Key: targetname
Value: door_trig


You can also give it some hintstring values if you want.
Key: hintstring
Value: PLATFORM_HOLD_TO_USE


And/or you can give the door that little white hand that pops up.
Key: cursorhint
Value: HINT_ACTIVATE


We need to also tell this trigger which way we want the door to open. Will it open 90? or -90? or whatever.

Give the door the following value. It must be one or the other. This tells the door which way to open, towards you or away from you.
Key: count
Value: 90


So now the trigger is set up, only thing left to do is link the trigger to the door and hinge, and since the door and hinge is already one script_brushmodel family, we simply First select the trigger, then just one piece of the door, and press "W".
A blue line with an arrow pointing from the trigger to the door should now be visible. And all brushes should suddenly be selected. All parts of the door, the hinge, and the trigger.

Radiant Complete.



=========
SCRIPTING
=========


Use One of the following scripts for this door setup.


SCRIPT #1 (Door Closes after 5 seconds)

Code:
main()
{
   thread player_doors();
}

player_doors()
{
   doors = getentarray("door_trig","targetname");
   for(i=0;i< doors.size;i++)
   {
      doors[i] thread door_think();
   }
}

door_think()
{
   self.doormoving = false;
   self.doormodel = getent(self.target, "targetname");

   while(1)
   {
      self waittill("trigger", player);
      self maps\mp\_utility::triggerOff();
      if(!self.doormoving)
      self thread door_move();
   }
}

door_move()
{
   self.doormoving = true;
   self.doormodel playsound("metal_open");
   self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
   self.doormodel waittill("rotatedone");
   wait (5);
   self.doormodel playsound("metal_close");
   self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
   self.doormodel waittill("rotatedone");
   self maps\mp\_utility::triggerOn();
   self.doormoving = false;
}


SCRIPT #2 (Player Must Close Door)

Code:
main()
{
   thread player_doors();
}

player_doors()
{
   doors = getentarray("door_trig","targetname");
   for(i=0;i< doors.size;i++)
   {
      doors[i] thread door_think();
   }
}

door_think()
{
   self.doormoving = false;
   self.doormodel = getent(self.target, "targetname");

   while(1)
   {
      self waittill("trigger", player);
      self maps\mp\_utility::triggerOff();
      if(!self.doormoving)
      self thread door_move();
   }
}

door_move()
{
   self.doormoving = true;
   if(self.doorclosed)
   {
      self.doormodel playsound("metal_open");
      self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
      self.doormodel waittill("rotatedone");
      self maps\mp\_utility::triggerOn();
   }
   else
   {
      self.doormodel playsound("metal_close");
      self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
      self.doormodel waittill("rotatedone");
      self maps\mp\_utility::triggerOn();
   }
   self.doormoving = false;
}


Name the script to something as such > mp_mymapname_doors.gsc

Place it in the following path > maps\mp\mp_mymapname_doors.gsc

So that's it, don't forget to add the script to your zone file, and to pick out a sound to use for your door.

Open your mp_mymapname.gsc

Add the following line:

maps\mp\mp_mymapname_doors::main();

Which is the name of the .gsc/script!

Then in your Zone file, make sure the following line exists.

rawfile,maps/mp/mp_mymapname_doors.gsc


thanks so much deekciti. i was gonna use the script where you have to close it (2nd) but that script doesnt work. i tried the first one and it worked to i went with that. but now i need to make windows using the other script but it dont work. thanks for the help so far though

edited on May. 14, 2009 03:22 pm by dkbiker3501
Share |
MHZLaze
General Member
Since: Feb 4, 2006
Posts: 46
Last: Jun 24, 2009
[view latest posts]
Level 2
Category: CoD4 MP Mapping
Posted: Monday, May. 18, 2009 09:13 pm
Avesome little post this one.. Just one thing.. You dont tell what kind of trigger your using?
Well ive tried getting this working a couple of days now[banghead]

Got this other script working, but I want the doors to close themself again after 5 secs and this one dosent.. What do I need to add in this script to get that?

main()
{
level.doorclosed = true;
level.doormoving = false;
thread scripted_door();
}
////////////////////////////////////////////
////////////////////////////////////////////

scripted_door()
{
doortrigger = getentarray("doortrig","targetname");
if ( isdefined(doortrigger) )
for (i = 0; i < doortrigger.size; i++)
doortrigger thread door_think();
}
////////////////////////////////////////////
////////////////////////////////////////////
door_think()
{
while (1)
{
self waittill ("trigger");
if (!level.doormoving)
thread door_move();
}
}
door_move()
{
doormodel = getent(self.target, "targetname");
level.doormoving = true;
if (level.doorclosed)
{
doormodel rotateyaw (-90, 1, 0.5, 0.5);
doormodel waittill ("rotatedone");
level.doorclosed = false;
}
else
{
doormodel rotateyaw ( 90, 1, 0.5, 0.5);
doormodel waittill ("rotatedone");
level.doorclosed = true;
}
level.doormoving = false;
}

Ive used the trigger_multiple for this script and it works fine.. But to close the door I need to touch the trigger again.. And its a secret door, so want it closed fast hehe [casanova] Anyone give me a Hint[biggrin]
Share |
=NB=watchdog
General Member
Since: Nov 12, 2009
Posts: 17
Last: May 28, 2011
[view latest posts]
Level 1
Category: CoD4 MP Mapping
Posted: Monday, Nov. 30, 2009 09:14 am
SCRIPT #2 (Player Must Close Door)

It turns the door 90 degrees each time you hit the trigger so you hit it once to open it, then when you hit it again it swings into the wall, then you hit it again and it swings to the other side of the wall, and once more closes it.


MHZLaze _ I couldn't get your script to work at all, just get syntax errors or the map won't even load.
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Monday, Nov. 30, 2009 07:25 pm
I don't know what is wrong with it, but I'll look it over shortly, and fix the whole Tut.

I'll test both scripts again.
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Monday, Nov. 30, 2009 09:02 pm
attachment: application(7.4Kb)
I see that it was a boolean problem in that other script.

Both scripts are now working. Use only one or the other. If you look at the source files included, you can see how they both can be used at the same time, for those new to this. Of course this is only if you want to have both kinds of doors in your map.

Door Closes After 5 Seconds (script)
Code:
main()
{
	thread self_closing_doors();
}

self_closing_doors()
{
	doors = getentarray("door_trig","targetname");
	for(i=0; i<doors.size; i++)
	{
		doors[i] thread door_think();
	}
}

door_think()
{
	self.doormoving = false;
	self.doormodel = getent(self.target, "targetname");

	while(1)
	{
		self waittill("trigger");
		if(!self.doormoving)
		{
			self thread door_move();
		}
	}
}

door_move()
{
	self maps\mp\_utility::triggerOff();
	self.doormoving = true;
	self.doormodel playsound("metal_open");
	self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
	self.doormodel waittill("rotatedone");
	wait (5);
	self.doormodel playsound("metal_close");
	self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
	self.doormodel waittill("rotatedone");
	self maps\mp\_utility::triggerOn();
	self.doormoving = false;
}




Player Must Close Door (script)
Code:
main()
{
	thread player_closing_doors();
}

player_closing_doors()
{
	doors = getentarray("door_trig","targetname");
	for(i=0; i<doors.size; i++)
	{
		doors[i] thread door_think();
	}
}

door_think()
{
   self.doormoving = false;
   self.doorclosed = true;
   self.doormodel = getent(self.target, "targetname");

	while(1)
	{
		self waittill("trigger");
		if(!self.doormoving)
		{
			self thread door_move();
		}
   }
}

door_move()
{
	self.doormoving = true;
	if(self.doorclosed)
	{
		self maps\mp\_utility::triggerOff();
		self.doormodel playsound("metal_open");
		self.doormodel rotateyaw(self.count, 2, 0.5, 0.5);
		self.doormodel waittill("rotatedone");
		self maps\mp\_utility::triggerOn();
		self.doorclosed = false;
	}
	else
	{
		self maps\mp\_utility::triggerOff();
		self.doormodel playsound("metal_close");
		self.doormodel rotateyaw((self.count * -1), 2, 0.5, 0.5);
		self.doormodel waittill("rotatedone");
		self maps\mp\_utility::triggerOn();
		self.doorclosed = true;
	}
	self.doormoving = false;
}



For those interested, I've attached some files for help.
The testmap, with working doors. You'll have to compile the map though. I've included all the Source Files.
Share |
RAMIDUS
General Member
Since: Aug 24, 2006
Posts: 91
Last: Nov 17, 2011
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Wednesday, Apr. 7, 2010 08:45 pm
Is WaW scripting really the same as CoD4's?
Share |
RAMIDUS
General Member
Since: Aug 24, 2006
Posts: 91
Last: Nov 17, 2011
[view latest posts]
Level 3
Category: CoD4 MP Mapping
Posted: Wednesday, Apr. 7, 2010 08:52 pm
Hi, I'm working on WaW map, but everyone say it's 100% the same as in CoD4, and the issues are the same, too, so I have a same problem as dkbiker3501:
I did it as you said :
Quote:
Name the script to something as such > mp_mymapname_doors.gsc Place it in the following path > maps\mp\mp_mymapname_doors.gsc So that's it, don't forget to add the script to your zone file, and to pick out a sound to use for your door. Open your mp_mymapname.gsc Add the following line: maps\mp\mp_mymapname_doors::main(); Which is the name of the .gsc/script! Then in your Zone file, make sure the following line exists. rawfile,maps/mp/mp_mymapname_doors.gsc


1) I have a map called test (testing scripts),
2) I have a test.gsc in raw/maps/test.gsc, which looks like this:
Quote:
#include maps\_utility;
#include common_scripts\utility;
#using_animtree( "generic_human" );
main()
{
// Don't give the player the default loadout, we want to specify it for our custom made map
level.dodgeloadout = true;
// Sets up all of the FX in the level
maps\test_fx::main();
// _load, sets up all of the basic entity behaviors
maps\_load::main();
// Sets the player's weapon loadout... This line should be right after _load::main(), and no waits/delays before it.
set_loadout();
// Sets up ambient sounds
maps\test_amb::main();
// Sets up "canned" animations
maps\test_anim::main();
// now the only change:
maps\test_sc::main();


}
// Sets the custom weapon loadout
set_loadout()
{
// Precache's / sets the list of weapons to give to the player when he spawns in
maps\_loadout::add_weapon( "colt");
maps\_loadout::add_weapon( "m1garand" );
maps\_loadout::add_weapon( "fraggrenade" );
maps\_loadout::add_weapon( "m8_white_smoke" );
// Sets the player's offhand throw weapon (aka smoke/flash)
maps\_loadout::set_secondary_offhand( "smoke" );
// Sets the player's default (if he does not have a pistol) laststand pistol.
maps\_loadout::set_laststand_pistol( "colt" );

// Sets the player's viewarms
maps\_loadout::set_player_viewmodel( "viewmodel_usa_marine_arms");
// Sets the player's viewarms when attacked by an enemy in a melee sequence or if a canned animation calls for them
maps\_loadout::set_player_interactive_hands( "viewmodel_usa_marine_player" );
// Switches the player's weapon once he spawns in
maps\_loadout::set_switch_weapon( "m1garand_bayonet" );
// Sets the campaign, which is used for battlechatter and other various scripts
level.campaign = "american";
// Precaches the 3rd person model (for when playing coop)
mptype\player_usa_marine::precache();
}


3) then I have a file with moving syntax:
raw/maps/test_sc.gsc

4) By the tips, found around here, I also edited the zone file at zone_source/test.csv:

Quote:
// NOTE: If you add a comment, put a space after the double forward slash or you will get issues
ignore,code_post_gfx
ignore,common
// map specific files
col_map_sp,maps/test.d3dbsp
gfx_map,maps/test.d3dbsp
rawfile,maps/test.gsc
rawfile,maps/test_amb.gsc
rawfile,maps/test_anim.gsc
rawfile,maps/test_fx.gsc
// now the only change:
rawfile,maps/test_sc.gsc
// Weapons
weapon,sp/m1garand
weapon,sp/colt
weapon,sp/fraggrenade
weapon,sp/m8_white_smoke
// Viewarms
xmodel,viewmodel_usa_marine_arms
xmodel,viewmodel_usa_marine_player
// 3rd person model
include,common_player_us


5) after dozen of load fails, I changed the name of test_script.gsc to test_sc.gsc to prevent misspells, (cause I'm quite tired right now) I'm sure I changed the refference in both main gsc and csv file, but the question is, why it keeps on issuing "couldn't find script maps/test_script" in the game, although the file with this name stopped existing half an hour ago? I don't get it... if you do, please help [sad] good night till then (11 p.m. in Czech Republic now)

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

»