3D CONSTRUCTION KIT16. EXAMPLESTo Go to another AreaAs an example we will use object 3 which is our DOOR and object 4 which is our DOORWAY. For simplicity the doorway is a black RECTANGLE which is placed close against a wall and the door is a red CUBE which has been "flattened' by the use of the EDIT tools and placed close up in front of the doorway. The DOORWAY (rectangle) should be set to INVISIBLE via the ATTRIBUTES function both on START STATUS and PRESENT STATUS. We will use the IFACTIVE command to "open" the door and reveal the doorway as follows. Enter the following condition as a LOCAL condition (create one if required first):IFACTIVE 3 THEN INVIS 3 VIS 4 ENDIFNow experiment by pressing the SPACE BAR and position the cursor on the door and press the "A" key. The door (object 3) should vanish and be replaced by the doorway (object 4). Create a new AREA via the ADD AREA option and return to the Area 1 via the GOTO AREA option. Now add the following condition commands in the same way as above and enter the following: (they can be tapped onto the end of the previous set of intructions, or placed in a newly created local condition list in the same area. IFHIT 3 THEN GOTO 1 2 ENDIFNow try walking towards the "doorway" until you collide with it. You will be transported instantly to ENTRANCE 1 in AREA 2. To Make an Object Visible or InvisibleAs can be seen by the previous example, making objects vanish and reappear is a very simple matter. If, for example, we wish an object (say object 3) to become invisible when it is shot we would enter the following condition as a LOCAL condition (create one if required).IFSHOT 3 THEN INVIS 3 ENDIFShoot object 3 and see the effect. To Make a SoundThis example will make a ping when picking up an object (object 5).IFACTIVE 5 THEN INVIS 5 SYNCSND 1 ENDIF |