Moving brushes

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Moving brushes

Post by inzerke » February 18th, 2012, 9:35 am

Hi,

I've searched around and read about scripting, but I still can't figure out how to make a brush move on the X or Y.
I know part of the script that needs to be used for it.
My question now is, if you could help me making the next script to do just a simple X or Y move and the trigger and brush reset after each round. It's like a door who needs to be opened each round again.

This is what I've tried, but it doesn't seem to work. Since I don't know how to make a reseting trigger + brush, I hope someone can put that in the script or atleast give the commands needed for.

Code: Select all

main() 
{ 
	thread Spawndoor_slider (); 
} 
 
Spawndoor_slider() 
{ 
	slidedoor = getent( "Spawndoor", "targetname" ); 
	trig      = getent( "Spawndoortrigger", "targetname" ); 
 
	while(true) 
	{ 
		trig waittill ("trigger"); 
		//wait 1;
		slidedoor movex ( 448, 0, 0, 0.5);
		slidedoor waittill ("movedone"); 
	} 
}
So if someone could help me it would please me!
I'm sorry for my english, hope you can udnerstand me.

inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Re: Moving brushes

Post by inzerke » February 18th, 2012, 2:47 pm

I've just surfed through all those tutorials.
But with WHILE you make a constant loop.
I only want one single movement and that it doesn't move back afterwards.
So i though you shouldn't use WHILE for it...
However you cant show me how to get it done?
And how to get it reset every single round?

Atleast thanks for the reply, hope you can answer my questions.

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Moving brushes

Post by megazor » February 18th, 2012, 4:08 pm

Code: Select all

main() 
{ 
   thread Spawndoor_slider (); 
} 

Spawndoor_slider() 
{ 
   slidedoor = getent( "Spawndoor", "targetname" ); 
   trig      = getent( "Spawndoortrigger", "targetname" ); 

      trig waittill ("trigger"); 
      slidedoor movex ( 448, 0, 0, 0.5);
}

inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Re: Moving brushes

Post by inzerke » February 18th, 2012, 4:28 pm

After I tested it out, it tells me when I use the trigger ingame:
Total time must be positive.

Any solutions for it?

Already thanks for the help.

I figured out, but can anyone tell me the next:

movex ( a, b, c, d)
a = number of movement on x axis
b =
c =
d = speed from movement

What b and c stands for...

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: Moving brushes

Post by iCYsoldier » February 18th, 2012, 10:18 pm

MoveX( <xvalue>, <time>, <acceleration time>, <deceleration time> )

For future reference, use http://www.zeroy.com/script/. It has a list of functions and their arguments.

inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Re: Moving brushes

Post by inzerke » February 19th, 2012, 4:55 pm

Thank you iCYsoldier :)

It can be closed since I'm figured it out now

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: Moving brushes

Post by Pedsdude » February 19th, 2012, 8:23 pm

We always leave the topics open in case someone else has a similar problem and would rather not make a new topic :)
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests