Alright I built a windmill and there is a picture of it below. Now I made the round rod a script object and gave it the targetname of fan1. Then I selected each brush of each of the blades and made those sript objects with targetnames of blade1, blade2, blade3, and blade4. Here is a picture of it:
Now I used the tutorial on this site to scrip here is what is in my script:
level waittill spawn
thread fan1
end
Then down further is this:
fan1:
$blade1 bind $fan1
$blade2 bind $fan1
$blade3 bind $fan1
$blade4 bind $fan1
$fan1 rotatez 325 // the number indicates the speed of the fans rotation.
end
I changed rotatey to both rotatex and rotatez but nothing at all happens. What did I do incorrectly???
Although I don't know why u do no make the whole "wheel" including blades just one big script_object, the script looks fine to me. The script must have the same name as ur bsp and be in the same folder, like mohaa/main/maps/dm/mymap.bsp and mohaa/main/maps/dm/mymap.scr but u surely did so?!
$blade1 bind $fan1
$blade2 bind $fan1
$blade3 bind $fan1
$blade4 bind $fan1
$fan1 rotatez 325 // the number indicates the speed of the fans rotation.
$fan1 move
end
But, if your windmill rotates all the time, you can just put this in the entity window (make the hub, the blades, and the origin brush all one script object ).
Key: rotateZ
Value: 325
That way you don't need anything in the script--except for (possibly) binding sound speakers (script_origins) to the end of the blades.
There is my entire script before I read the post. Does anyone see anything wrong with it? One thing...all four of the random explosions were working before I put in the fan script...now niether work.
// STORM ON REVIN
// ARCHITECTURE: WD_Echo_Rancid
// SCRIPTING: WD_Echo_Rancid
$blade1 bind $fan
$blade2 bind $fan
$blade3 bind $fan
$blade4 bind $fan
$fan1 rotatex 200 // the number indicates the speed of the fans rotation.
end
I originally had fan as fan1 but i notice that the targetname in radient was fan, so being lazy and not wanting to compile agian I just changed it to fan. Also I was messing around with the rotatex and z just to see what would happen.
I bet that thread fan has to go down with the other in the script...Ill try that and see...
tom, what does the $fan1 move do and is it required?...I didnt see that in the .map tutorial that was why i was wondering. Also There needs to be an orgin brush...or is that just the fan1?
Alright Thanks Tom, I bet that is the problem...well obviously it is the problem...that would explain the random explosions not working to...I was going to change that first thing but decided to change some other things first...Ill let you know if it works. Thanks again.
I don't know if $fan move is needed or not but you forgot to rename the fan in the last line.
$blade4 bind $fan $fan rotatex 200
Because the blades are seperate objects, you could have them play a "whooshing" sound so the players hear them go by. Also if your hub and blades are not centered perfectly it will wobble when it rotates. Adding an origin brush to the hub object will move the center point, if needed.
Alright I got the windmill working. The blades are moving smoothly. Now the only problem is rotatex and rotatez are not right, both turn incorrectly, they go throught the windmill and its not right. IS there a way to script a certain angle or certain way to rotate or is there just x,y,and z. Has anyone ever got a windmill turning in moh before?
Can you post, or send, a prefab of the windmill? In the screenshot, it looks like it has been turned 45 degrees. It will probably have to be rotated on two axis at the same time.
Last edited by tltrude on Sun Apr 11, 2004 4:55 am, edited 1 time in total.
Prefabs are easy, just highlight all the parts of it and go to File > Save to prefab. You can also make a new folder to put your .pfb files in (in MOHAATools for example) if you like.
The path where prefabs are stored is set in Edit > Preferences.
Yeah I got it working, you saved the day again Tom, thanks. Now the only thing that will not work is the sound. I put the 3 lines that you posted in my script. The first with the other random exploding sounds. The other two are down with the fan script.