________________________ Virtual Reality Studio Part 14 ________________________ Studio Game tutorial This tutorial for the Virtual Reality Studio covers the beginning of the Virtual Reality Studio Game. In Area 001 (the starting area) there is a collection of colored boxes. These all have the same condition associated with them. The yellow box, for example, is CUBOID 018, and has the following condition: IF SHOT? starts the IF/THEN statement, so if the box is shot... THEN INVIS (18) then make the box invisible SOUND (5) add a sound effect to coincide with the shot EXECUTE (45) executes the conditions of Object 045 ENDIF The condition of OBJECT 045 allow the revelation of the hidden doorway. It is important to note that object 045 is never visible and is used to store the following routine which can be used by all the colored cuboids in front of the hidden doorway. IF INVIS (17) these lines are asking if all the boxes have been AND INVIS (18) shot, i.e. made invisible AND INVIS (19) AND INVIS (20) AND INVIS (21) AND INVIS (22) THEN VIS (16) and if they have been then make the secret door LOOP (6) visible sets up the loop counter TOGVIS (16) this is to toggle the visibility of the door SOUND (3) waits for 1/60 of a second WAIT SOUND (1) WAIT the two wait commands count for 2/60 of a second WAIT AGAIN repeats the loop 6 times ENDIF From the LOOP (6) command to the end of the condition above, the door will have been flashed 6 times by toggling the visibility. Because the loop is executed an even number of times the door is visible when the loop has been exited. The door behind the boxes is object 016 and has, like all other doorways, the following condition: IF COLLIDED? THEN GOTO (1,12) so you go to area 12 if you go through the door ENDIF We are now at AREA 012. The entrance position has been defined using the EDIT ENTRANCE option from the top of the screen. This means that when we collide with the object 016 (the door), we enter area 12 at position 7932,5050,6699. It is possible to travel along the walkway until you get to a series of cuboids that move to and fro blocking your path. The first of these is the blue cuboid 009. This has the following condition: IF COLLIDED? THEN SOUND (5) ADDVAR (10,V11) adds 10 to variable 11 (number of times shot) This effectively causes damage to the player. ENDIF By examining the attributes on cuboid 009 we see that it is created as moveable and start its animation from a position 7580, 5120,6040. The animation for this object is as follow: INCLUDE (9) includes object 009, i.e. the blue cuboid START to start the animation LOOP (10) telling the program to do the next command 10 times MOVE (-50,0,0) moves the cuboid 50 units in X direction AGAIN repeats the loop LOOP (10) creates a new loop MOVE (50,0,0) moves the cuboid in the opposite direction AGAIN repeats the loop RESTART tells the program to start the animation again Once we get past the cuboids we see a pyramid (PYRMID 018) which travels up and down on a green elevator (CUBOID 016). The condition for PYRMID 018 is : IF ACTIVATED? if this object is activated THEN INVIS (18) then make it disappear PRINT ("YOU FIND SOME ROPE") SETVAR (25,V35) V35 is a frame counter SOUND (4) adds a sound effect SETVAR (1,V42) this sets a marker to say we have the rope ENDIF ends the IF/THEN statement The value of Variable 35 has been set at 25. The general condition number 2 will count down this variable on every frame update until it reaches 25. When V25 reaches the value of 2 (after 25 Frames) the message area is cleared. Now go back to Area 001 by using the GOTO AREA command from the pull down menus at the top of the screen. Move round to RCTNGL 015 which acts as a doorway on the outer wall. The conditions for RCTNGL 015 are: IF COLLIDED? i.e., you collide with this object THEN GOTO (1,4) then the program takes you to entrance 1 of area 4 ENDIF this ends if the statement started two lines above. So by colliding with this door (RCTNGL 015 ) then we go to Area 4. Look around this area, on the far wall you will see a red triangle and a slot. The red triangle is TRNGL 046. The conditions for this are as follows: IF ACTIVATED? THEN IF VAR=?(V45,0) v45 is set to 1 the security pass is held. THEN PRINT ("ACCESS DENIED:PASS REQUIRED") SOUND (3) SETVAR (20,V45) Primes the clear message window ELSE PRINT ("++ ACCESS GRANTED ++) SET VAR (10,V35) clears message window in ten frames this makes LOOP (6) the sound happen 6 times SOUND (4) DELAY (4) AGAIN SOUND (1) INVIS (46) remove the red triangle VIS (47) replace by a green triangle INVIS (41) removes block so you can get to the shuttle ENDIF ENDIF The next line to the triangle is 049 RCTNGL, and the condition is simply: EXECUTE (46) this executes the condition of object 046 which is the red triangle mentioned above. If we now go back to AREA 001 (the starting area) we can make our way to AREA 003. Firstly, we have to go to RCTNGL 024 which acts as another doorway by using the following condition: IF COLLIDED? THEN VIS (9,11) These following lines make visible the three VIS (10,11) pyramids and sensors so that if they have VIS (11,11) been previously shot and made invisible VIS (14,11) then they can be brought back into action VIS (15,11) VIS (16,11) GOTO (1,11) go to entrance 1 of area 11 ENDIF The GOTO statement above took us to AREA 011, a long tunnel. Along the top of the tunnel are three laser-shooting pyramids, the first of which is PYRAMID 011. This pyramid has the following conditions: IF SHOT? if the pyramid is shot THEN INVIS (11) then make it (i.e. object 11) invisible SOUND (1) adds a sound effect ADDVAR (50,V34) adds 50 to the score ENDIF ends the IF/THEN statement Once we get past the shooting pyramids then at the end of the tunnel we see another door, QUAD 004. Once again this has a simple condition to take us to another area: IF COLLIDED? if we collide with QUAD 004 THEN GOTO (1,3) then go to area 3 We are now in AREA 003, the cliffs scene. Under the palm tree is a block of gold PYRAMID 058. This has the following conditions, and shows how to control your inventory: IF ACTIVATED? THEN PRINT ("YOU FIND A GOLD BAR") SOUND (4) SETVAR (15,V35) Primes the message clear counter ADDVAR (1,V33) adds 1 to number of gold found (instrument3) ADDVAR (300,V34) adds 300 to the score INVIS (58) makes the object invisible as we have picked it up After exploring the cliffs we find a small boat floating on the sea. If we walk onto the boat (object 051) a new condition is activated: IF COLLIDED? THEN SETVAR (1,V250) SETVAR (0,V249) ENDIF Variable 250 is used later on the check if the player is on the boat, 1 is yes, 2 is no. In addition V249 is set to 1 the player is in the water or to 0 if not. The engine on the boat is PYRAMID 055. Activating this executes object 041. Object 041 is actually always invisible, it has just been used to store a set of conditions that actually get the boat moving: IF ACTIVATED? THEN IF VAR=? (V250,1) this is asking if player is on the boat PRINT ("YOU START THE OUTBOARD MOTOR") DELAY (25) SETVAR (25,V35) IF VAR75 then drown. V53 X Coordinate at the Beachhead when going to the desert island. V54 Inventory list indicator 0 - Not showing 1 - First object 2 - Second object, etc. V55 Object carried counter for inventory list V56 Inventory Request 0- Not requested 1 - Requested 2 - Currently showing V57 In Sea (Desert Island) 0 = No, 1 = Yes V58 Number of frames spent in the sea V61 Giant Nose Shot? 0 = NO, 1 = Yes V247 Speed Trap - 0 = Off, 1 = On V248 Cheat On? 0 = No, 1 = Yes V249 Used to check whether the player is in the sea or not, 0 = No, 1 = Yes V252 X Viewpoint position, used for locking out movement when animating the viewpoint in Area 003. Same for V253 and V254 V253 Y Viewpoint position V254 Z Viewpoint position *** END ***