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

Members Online

»
0 Active | 99 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 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Moving a brush.
jelvischan
General Member
Since: Jun 22, 2012
Posts: 48
Last: Feb 15, 2014
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Friday, Jul. 6, 2012 05:20 pm
I have this code, but there seems to be a problem, can someone take a look at it and see if anything is wrong?

The problem is that when I trigger trig_Secret1, nothing happens... the brush doesn't move.

Code:
secret()
{
plat=getent("secret","targetname");
trig=getent("trig_secret1","targetname");
esc1=getent("openup","targetname");


while(1)
{
trig waittill ("trigger");
esc1 notsolid();

plat movex (300,3,2,2);
plat waittill ("movedone");
wait(2);

plat movey (1792,3,2,2);
plat waittill ("movedone");
wait(2);

plat movex (-2500,3,2,2);
plat waittill ("movedone");
wait(2);

plat movez (1368,3,2,2);
plat waittill ("movedone");
wait(2);

esc1 solid();

}
}
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 MP Mapping
Posted: Friday, Jul. 6, 2012 05:57 pm
jelvischan writes...
Quote:
I have this code, but there seems to be a problem, can someone take a look at it and see if anything is wrong?

The problem is that when I trigger trig_Secret1, nothing happens... the brush doesn't move.

Code:
secret()
{
plat=getent("secret","targetname");
trig=getent("trig_secret1","targetname");
esc1=getent("openup","targetname");


while(1)
{
trig waittill ("trigger");
esc1 notsolid();

plat movex (300,3,2,2);
plat waittill ("movedone");
wait(2);

plat movey (1792,3,2,2);
plat waittill ("movedone");
wait(2);

plat movex (-2500,3,2,2);
plat waittill ("movedone");
wait(2);

plat movez (1368,3,2,2);
plat waittill ("movedone");
wait(2);

esc1 solid();

}
}


The reason why trig_secret1 doesn't move is because you aren't telling it to. Other than having the trigtrig_secret1 wait for a player to trigger it, there is nothing in that piece of code to handle trigtrig_secret1.
Share |
jelvischan
General Member
Since: Jun 22, 2012
Posts: 48
Last: Feb 15, 2014
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Friday, Jul. 6, 2012 06:03 pm
Tally writes...
Quote:
jelvischan writes...
Quote:
I have this code, but there seems to be a problem, can someone take a look at it and see if anything is wrong?

The problem is that when I trigger trig_Secret1, nothing happens... the brush doesn't move.

Code:
secret()
{
plat=getent("secret","targetname");
trig=getent("trig_secret1","targetname");
esc1=getent("openup","targetname");


while(1)
{
trig waittill ("trigger");
esc1 notsolid();

plat movex (300,3,2,2);
plat waittill ("movedone");
wait(2);

plat movey (1792,3,2,2);
plat waittill ("movedone");
wait(2);

plat movex (-2500,3,2,2);
plat waittill ("movedone");
wait(2);

plat movez (1368,3,2,2);
plat waittill ("movedone");
wait(2);

esc1 solid();

}
}


The reason why trig_secret1 doesn't move is because you aren't telling it to. Other than having the trigtrig_secret1 wait for a player to trigger it, there is nothing in that piece of code to handle trigtrig_secret1.




No no, I don't want trig_Secret1 to move. I want secret to move after I trigger trig_secret1, but in-game I do just that and nothing happens.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 MP Mapping
Posted: Friday, Jul. 6, 2012 08:56 pm
Try this:

Code:
init()
{
	plat = getent( "secret","targetname" );
	trig = getent( "trig_secret1","targetname" );
	esc1 = getent( "openup","targetname" );
	
	trig thread secret( plat, esc1 );
}

secret( plat, esc1 )
{
	level endon( "intermission" );
	
	for( ;; )
	{
		self waittill( "trigger", player );
		
		if( isPlayer( player ) && player isTouching( self ) )
		{
			esc1 notsolid();

			plat movex (300,3,2,2);
			plat waittill ("movedone");
			wait(2);

			plat movey (1792,3,2,2);
			plat waittill ("movedone");
			wait(2);

			plat movex (-2500,3,2,2);
			plat waittill ("movedone");
			wait(2);

			plat movez (1368,3,2,2);
			plat waittill ("movedone");
			wait(2);

			esc1 solid();		
		}
	}
}


completely untested, but should do what you want to do.
Share |
jelvischan
General Member
Since: Jun 22, 2012
Posts: 48
Last: Feb 15, 2014
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Friday, Jul. 6, 2012 09:45 pm
Jeez, seems so advanced. Do you have xfire?
Share |
jelvischan
General Member
Since: Jun 22, 2012
Posts: 48
Last: Feb 15, 2014
[view latest posts]
Level 2
Category: CoD2 MP Mapping
Posted: Friday, Jul. 6, 2012 09:55 pm
Tally writes...
Quote:
Try this:

Code:
init()
{
	plat = getent( "secret","targetname" );
	trig = getent( "trig_secret1","targetname" );
	esc1 = getent( "openup","targetname" );
	
	trig thread secret( plat, esc1 );
}

secret( plat, esc1 )
{
	level endon( "intermission" );
	
	for( ;; )
	{
		self waittill( "trigger", player );
		
		if( isPlayer( player ) && player isTouching( self ) )
		{
			esc1 notsolid();

			plat movex (300,3,2,2);
			plat waittill ("movedone");
			wait(2);

			plat movey (1792,3,2,2);
			plat waittill ("movedone");
			wait(2);

			plat movex (-2500,3,2,2);
			plat waittill ("movedone");
			wait(2);

			plat movez (1368,3,2,2);
			plat waittill ("movedone");
			wait(2);

			esc1 solid();		
		}
	}
}


completely untested, but should do what you want to do.



Just tested with code, and nothing happens. I checked to make sure all the entity names matched, and they did. I don't have to thread anything do I at the top in mymapname.gsc?
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»