Page 1 of 1

Moving brushes

Posted: February 18th, 2012, 9:35 am
by inzerke
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.

Re: Moving brushes

Posted: February 18th, 2012, 2:47 pm
by inzerke
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.

Re: Moving brushes

Posted: February 18th, 2012, 4:08 pm
by megazor

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);
}

Re: Moving brushes

Posted: February 18th, 2012, 4:28 pm
by inzerke
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...

Re: Moving brushes

Posted: February 18th, 2012, 10:18 pm
by iCYsoldier
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.

Re: Moving brushes

Posted: February 19th, 2012, 4:55 pm
by inzerke
Thank you iCYsoldier :)

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

Re: Moving brushes

Posted: February 19th, 2012, 8:23 pm
by Pedsdude
We always leave the topics open in case someone else has a similar problem and would rather not make a new topic :)