Homepage PM Gender: Male Posts: 119 Ureg example « Thread started on: 09/07/2004 at 08:02:31 » This is an example of how to use a ureg to trigger an event , lets say your way is blocked by a mine that is tripped if the player touches it thus killing the player , above it there is a crate suspended on a crane so to safely trigger the mine you want to drop the crate on it . You will need three animations , one for the crate , one for the mine and one for the switch , for this example I will use UREG 5. The crate animation is set so that the sym objects for the frames are overriden by a crate MD2 0 symobj crate.vgr skip if UReg=Value ureg# 5 uvalue 1 1 symobj crate.vgr goto 0 2 symobj crate.vgr delete myself frames 0 and 1 keep it in a loop until UREG 5 = 1 . The mine animation is of an animated MD2 that overrides a sym object and cycles through 2 skins that make a light flash to show that it is armed . 0 Sym obj mine.vgr jump if close frame 3 1 Sym obj mine.vgr Skip if UReg=value 5 uvalue 1 2 Sym obj mine.vgr goto 0 3 Sym obj mine.vgr Make blast with sound radius 600 4 Sym obj mine.vgr Univreg Add Ureg 187 100 5 Sym obj mine.vgr Univreg Add Ureg 175 50 6 Sym obj mine.vgr Set Univ Reg ureg 228 4 7 Sym obj bcrate.vgr goto8 8 Sym obj bcrate.vgr goto7 frames 0 to 2 hold the animation in a loop until either the player gets close or UReg 5 = 1 , frame 3 makes the blast and plays the explosion sound , frames 4,5 and 6 take care of the particle explosion and the ground shake , frames 7 and 8 replace the mine MD2 with an MD2 of a broken crate with a scorched skin and hold it in a loop The switch animation is an MD2 of a switch which is actually 2 MD2's , one that is off and one that is on . 0 SHP WALL SwtOff.vgr Skip if close/See plyr 100cm 1 SHP WALL SwtOff.vgr goto 0 2 SHP WALL SwtOn.vgr Play Sound 15 3 SHP WALL SwtOn.vgr Display TextMessage 10 4 SHP WALL SwtOn.vgr Set Univ Reg 5 1 5 SHP WALL SwtOn.vgr goto 6 6 SHP WALL SwtOn.vgr goto 5 Frame 0 and 1 keep the switch in a loop until the player touches the switch , when touched frame 0 jumps to frame 2 which triggers a sound , a text message and sets the ureg which removes the mine and the crate , frames 5 and 6 keep the animation in a loop that displayes the swich in its activated state . Note:- when making animations that are overriden with MD2's mark them as no draw so only the MD2 is visible and not the .vgr , also if you are making a switch that needs the player to touch it mark it as no bump or the player might not be able to get close enough to trigger the animation .