rotating a brush

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

switch

Post by tltrude »

I think it does not like the targetname because "switch" is a command word used in scripting. So, change the targetname to "rotatingbar_switch" in the map and recompile. Also, change the targetnames in the script thread.

To make the bar automattic, just take out the second trigger line and replace it with "wait 5"--five seconds is not very long. If you want the whole thing to take 11 seconds, you'll have to insert that "time" line.

The "waitmove" makes the thread stop running untill the bar has moved. If you use just "move" the bar will start moving and the thread will continue to the "waittill trigger" line--we don't want that because the player might hit use again before the bar is up all the way!

BTW, you are doing great--at least you know how to find script errors in the console!
Last edited by tltrude on Wed Feb 04, 2004 11:18 am, edited 1 time in total.
Tom Trude,

Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

The "waitmove" makes the thread stop running untill the bar has moved
i meant that the bar doesnt move it rotates,but it turns out that wasnt the problem :wink:.
i tried the rotatexupto -60 and it made a -60 from the horizontal (120 in total) so when i tried rotatexup 0 it came back 2 noramal,i guess thats y rotatexdown didnt seem 2 work cause it was rotating the bar 2 an angle of 60 which was already done by rotatexup 8-) .
I think it does not like the targetname because "switch" is a command word used in scripting. So, change the targetname to "rotatingbar_switch" in the map and recompile. Also, change the targetnames in the script thread.
the switch worked fine after renaming ,i guess u were right.but shouldnt it make any animations?cause when i click use it looks the same but the bar moves. (isnt thats y the switch is in the animation tab in mohradient?)
BTW, you are doing fine--at least you know how to find script errors in the console!
ive had some previous experience in repairing simple scripts and maps without spawn points and stuff like that ,and thats how i came 2 start mapping :wink: ,i also read alot of tuts.i can understand most of a script if i read it well,but the problem is i could make one of my one,but with ur help ive made my 1st script 4 my 1st map(yaay,hurrah,cool,great.....)
thank u alot
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

rotateXupto

Post by tltrude »

I think part of the problem is that "rotateXupto" and "rotateXup" are not the same thing.

I tried this and it worked fine:

Code: Select all

main:

	level waittill prespawn

	$rotatingbar time 3
	thread rotatingbar_mover

	level waittill spawn

end

rotatingbar_mover: 

	$rotatingbar_trigger waittill trigger
	$rotatingbar_switch anim on 
	$rotatingbar_switch playsound alarm_switch
	wait 1
	$rotatingbar rotateXup 60
	$rotatingbar waitmove
	wait 5 
	$rotatingbar rotateXdown 60 
	$rotatingbar waitmove
	wait 1
	$rotatingbar_switch anim off 
	$rotatingbar_switch playsound alarm_switch 
	goto rotatingbar_mover 

end 
Tom Trude,

Image
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

thanks alot,it works fine now,i also understand how 2 make simple scripts now.tnx again 8-) 8-) :wink:
Image
Post Reply