When I first saw the rocket map file I was amazed at how they did the crane as you rightly say it does not poke brushes out of the top of the crane when lowering/raising the hook. Its certainly a very complex section of scripting and very very time consuming to setup.
The crane top section is made up of 2 sets of solid brush script_movers called “crane1coil” and “crane1arm”. (Please note the origin brushes are down at the same level as the fuel cage for both script_movers)
Underneath the crane is the fuel cage with an origin brush (at the top of the brushes) for linking purposes. The cage walls are also coated in “common/ai_nosight” brushes so that the AI characters cannot see the player when the crane cage is moving around.
The crane’s hook and wire is made up of 12 script_mover brushes called link1-12. They consist of a 16x16x16 (X/Y/Z) origin brush and a 2x2x32 brush for the wire.
Finally the crane hook is made up a wire brush 2x2x93 with a brush hook at the bottom and a origin brush below that. This script mover is called “crane”.
Probably worth mentioning at this point that most of the crane operation is triggered via dummy script_movers. Because the way the script system works you cannot have multiple running threads inside of one script_mover entity. You can have multiple script_mover sections of script running at the same time but not within the same routine. (eg entity states like spawn, trigger, death etc)
So with most of the SP maps, Greymatter created dummy script movers called (counter1-5 in the rocket script) which control most stuff in the map.
Counter1 - controls the starting of the crane routine via the AI script.
Counter2 - controls various level wide speaker stuff. Like rocket test and final countdown of rocket.
Counter3 - German character AI checks on states of various bits around the map.
Counter4 - Controls the way the rocket room blows up in 4 DIFFERENT ways! (talk about flexibility ) Also blows the bridge on the way back to the exit. Will also stop the crane if the mech dude is dead or has run off due to gun fire. (Also worth mentioning is that the way the script stops the crane components with the stop/resume functions. This could come in useful. )
Counter5 - Deals with the alarm system, various misc global sounds and destroying the v2 rocket. Script movers cannot destroy themselves so its done via another script_mover routine.
As you can see alot of stuff is done via these dummy script_movers in the map. They simply consist of 1 “trigger” texture brush and an 1 origin brush.
Before anything happens in the map the script has got to put all the components together. So these script sections put everything together.
Crane1 (Line 924-1131) moves to the clspot6 path_corner directly above the fuel cage. The wait before this move is so that all the map entities spawn first. Sometimes entities do not spawn in the right order in the map so its always good practice to put in a slight pause in the script before any entity movements.
This script mover controls the crane movement throught the whole sequence has various routines here to move the above script_mover components around. With the above knowledge of script_mover components this script section is self-explainatory.
Cranecoil1 (line 1133-1171) entity really just follows the crane entity around and has very little script stuff to do.
Crane1arm (line 1173-1199) entity again is mainly controlled from the crane 1 script_mover.
Fueltank1 (line 1201-1479) entity has to follow the train around the map so it has alot of stuff for movement around the track. Most of the early movement is controlled via the crane script_mover.
Link1-12 (Line 1831-2525) are the tricky bits of the map and when they start up they are all moved to the same location called “link1spot1a” (path_corner entity) Some of the links are used for picking up the fuel cage and then the rest are used over the rocket bay doors. The script movers are moved one by one to various path_corner entities like a extending a telescope and back up again afterwards. the key here is to note the speeds at which the entities are moved and to keep them consistant during the creating of the crane wire.
BTW kat welcome to the forum and I hope that helps. :razz:
Sock
3d Brush Monkey