Advertisement
Deji

I have mixed feelings about SCM

Jan 23rd, 2012
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.86 KB | None | 0 0
  1. {$CLEO .cs}
  2.  
  3. const
  4.     // not only does constants for vars in SB make it easier to remember vars we can also change the
  5.     // vars at any time for better var management (very useful if you forgot to leave space for a string)
  6.     stage                       = 0@
  7.     door                        = 1@
  8.     open_door                   = 2@
  9.    
  10.     player                      = $PLAYER_CHAR
  11.     scplayer                    = $PLAYER_ACTOR
  12.    
  13.     // #KMB_LOCKEDDOOR is not allowed. Doesn't mean we have to stick with a number and later be clueless as to which model is which.
  14.     KMB_LOCKEDDOOR              = 2949
  15.    
  16.     // And here we save 4 variables
  17.     doorPosX                    = 191.141
  18.     doorPosY                    = 1870.04
  19.     doorPosZ                    = 18.4766
  20.     doorTarX                    = 181.141       // x coord door will slide to
  21. end
  22.  
  23. stage = 0
  24.  
  25. :mainloop
  26. wait 0
  27.  
  28. // there's still always room for low-construct where it doesn't really make a difference :P
  29. 0256:   player player defined
  30. else_goto @mainloop
  31.  
  32. if stage == 0
  33. then
  34.     if
  35.         00FE:   actor scplayer sphere 0 in_sphere 191.141 1870.04 18.4766 radius 80.5 80.5 80.5
  36.     then
  37.         doorPosX = 191.141
  38.         doorPosY = 1870.04
  39.         doorPosZ = 18.4766
  40.         doorTarX = 181.141
  41.         0247: load_model KMB_LOCKEDDOOR
  42.        
  43.         while 8248:   not model KMB_LOCKEDDOOR available  // better than repeat..until, since we have a chance to avoid WAIT altogether
  44.             wait 0
  45.         end
  46.    
  47.         0107: door = create_object KMB_LOCKEDDOOR at doorPosX doorPosY doorPosZ
  48.         0177: set_object door Z_angle_to 90.0
  49.         open_door = 0
  50.         stage = 1
  51.     end
  52. end
  53.  
  54. if
  55.     stage == 1
  56. then
  57.     if
  58.         00FE:   actor scplayer sphere 0 in_sphere doorPosX doorPosY doorPosZ radius 90.5 90.5 90.5
  59.     then
  60.         if
  61.             00FE:   actor scplayer sphere 1 in_sphere doorPosX doorPosY doorPosZ radius 10.5 10.5 10.5
  62.         then
  63.             if
  64.                 open_door == 0
  65.             then
  66.            
  67.                 034E: move_object door to doorTarX doorPosY doorPosZ speed 0.1 0.1 0 collision_check 0
  68.                
  69.                 if 04E5:   object door near_point doorTarX doorPosY radius 1.0 1.0 sphere 0
  70.                 then open_door = 1
  71.                 end
  72.                
  73.             else
  74.            
  75.                034E: move_object door to doorPosX doorPosY doorPosZ speed 0.1 0.1 0 collision_check 0
  76.                
  77.                if 04E5:   object door near_point doorPosX doorPosY radius 1.0 1.0 sphere 0
  78.                then open_door = 0
  79.                end
  80.                                
  81.             end
  82.         end
  83.     else
  84.         0108: destroy_object door       // why set a flag to make the streamer remove it when we can remove it? :)
  85.         0249: release_model KMB_LOCKEDDOOR
  86.     end
  87. end
  88. goto @mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement