Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$CLEO .cs}
- const
- // not only does constants for vars in SB make it easier to remember vars we can also change the
- // vars at any time for better var management (very useful if you forgot to leave space for a string)
- stage = 0@
- door = 1@
- open_door = 2@
- player = $PLAYER_CHAR
- scplayer = $PLAYER_ACTOR
- // #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.
- KMB_LOCKEDDOOR = 2949
- // And here we save 4 variables
- doorPosX = 191.141
- doorPosY = 1870.04
- doorPosZ = 18.4766
- doorTarX = 181.141 // x coord door will slide to
- end
- stage = 0
- :mainloop
- wait 0
- // there's still always room for low-construct where it doesn't really make a difference :P
- 0256: player player defined
- else_goto @mainloop
- if stage == 0
- then
- if
- 00FE: actor scplayer sphere 0 in_sphere 191.141 1870.04 18.4766 radius 80.5 80.5 80.5
- then
- doorPosX = 191.141
- doorPosY = 1870.04
- doorPosZ = 18.4766
- doorTarX = 181.141
- 0247: load_model KMB_LOCKEDDOOR
- while 8248: not model KMB_LOCKEDDOOR available // better than repeat..until, since we have a chance to avoid WAIT altogether
- wait 0
- end
- 0107: door = create_object KMB_LOCKEDDOOR at doorPosX doorPosY doorPosZ
- 0177: set_object door Z_angle_to 90.0
- open_door = 0
- stage = 1
- end
- end
- if
- stage == 1
- then
- if
- 00FE: actor scplayer sphere 0 in_sphere doorPosX doorPosY doorPosZ radius 90.5 90.5 90.5
- then
- if
- 00FE: actor scplayer sphere 1 in_sphere doorPosX doorPosY doorPosZ radius 10.5 10.5 10.5
- then
- if
- open_door == 0
- then
- 034E: move_object door to doorTarX doorPosY doorPosZ speed 0.1 0.1 0 collision_check 0
- if 04E5: object door near_point doorTarX doorPosY radius 1.0 1.0 sphere 0
- then open_door = 1
- end
- else
- 034E: move_object door to doorPosX doorPosY doorPosZ speed 0.1 0.1 0 collision_check 0
- if 04E5: object door near_point doorPosX doorPosY radius 1.0 1.0 sphere 0
- then open_door = 0
- end
- end
- end
- else
- 0108: destroy_object door // why set a flag to make the streamer remove it when we can remove it? :)
- 0249: release_model KMB_LOCKEDDOOR
- end
- end
- goto @mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement