Камера поезда v3.0 Final
Странно, но эта статейка была невидима неделю целую от неадминов... Теперь всё ок, я ещё исправил пару глюков!
======
Итак, после 8 месяцев бездействия мне всёж захотелось что нибудь сделать. Сделал. Помнится, зимой ещё я написал скриптик, чтоб у поездов была камера от последнего вагона. Это был первый в своём роде такой скрипт, ну а первый блин как положено - комом. =) Сыровато получилось...
В общем сегодня я почти с нуля переписал этот скрипт, теперь он полностью завершён и очень хорошо вписывается в игру. Теперь нажимая в поезде кнопку смены вида, камера будет переключаться от вагона к вагону с последнего и до паровоза. А после паровоза вернётся в начальное кинокамерное положение. Менять вид можно безконечно. Пользуйтесь... Написан в старом добром SAMB, ибо я к нему очень привык.
============= 004F: create_thread ££Cam
-------------------------- :Cam
0001: wait 0 ms
00D6: if 0
0256: player $PLAYER_CHAR defined
004D: jump if false ££Cam
00D6: if 21
00DD: actor $PLAYER_ACTOR driving_vehicle_type 538
00DD: actor $PLAYER_ACTOR driving_vehicle_type 537
004D: jump if false ££Cam
0001: wait 250 ms
03C0: $poezd = actor $PLAYER_ACTOR car
078A: $vag1 = create_carriage_on_train $poezd position 1
078A: $vag2 = create_carriage_on_train $poezd position 2
078A: $vag3 = create_carriage_on_train $poezd position 3
078A: $vag4 = create_carriage_on_train $poezd position 4
078A: $vag5 = create_carriage_on_train $poezd position 5
0002: jump ££C6
:C6
0001: wait 0 ms
00D6: if 0
8038: NOT $vag5 == -1 ;; integer values
004D: jump_if_false ££C5
0002: jump ££Came1
:Came1
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came1
0407: create coordinate $GQ $HQ $JQ from car $vag5 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag5 18 2
0002: jump ££Came2
:Came2
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came2
0407: create coordinate $GQ $HQ $JQ from car $vag4 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag4 18 2
0002: jump ££Came3
:Came3
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came3
0407: create coordinate $GQ $HQ $JQ from car $vag3 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag3 18 2
0002: jump ££Came4
:Came4
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came4
0407: create coordinate $GQ $HQ $JQ from car $vag2 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag2 18 2
0002: jump ££Came5
:Came5
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came5
0407: create coordinate $GQ $HQ $JQ from car $vag1 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag1 18 2
0002: jump ££Came6
:Came6
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came6
0407: create coordinate $GQ $HQ $JQ from car $poezd offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $poezd 18 2
0002: jump ££Came7
:Came7
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came7
018C: play_sound 1058 at 0.0 0.0 0.0
02EB: restore_camera_with_jumpcut
0002: jump ££Came1
:C5
0001: wait 0 ms
00D6: if 0
8038: NOT $vag4 == -1 ;; integer values
004D: jump_if_false ££C1
0002: jump ££Came8
:Came8
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came8
0407: create coordinate $GQ $HQ $JQ from car $vag4 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag4 18 2
0002: jump ££Came9
:Came9
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came9
0407: create coordinate $GQ $HQ $JQ from car $vag3 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag3 18 2
0002: jump ££Came10
:Came10
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came10
0407: create coordinate $GQ $HQ $JQ from car $vag2 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag2 18 2
0002: jump ££Came11
:Came11
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came11
0407: create coordinate $GQ $HQ $JQ from car $vag1 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag1 18 2
0002: jump ££Came12
:Came12
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came12
0407: create coordinate $GQ $HQ $JQ from car $poezd offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $poezd 18 2
0002: jump ££Came13
:Came13
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came13
018C: play_sound 1058 at 0.0 0.0 0.0
02EB: restore_camera_with_jumpcut
0002: jump ££Came8
:C1
0001: wait 0 ms
00D6: if 0
8038: NOT $vag3 == -1 ;; integer values
004D: jump_if_false ££C2
0002: jump ££Came14
:Came14
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came14
0407: create coordinate $GQ $HQ $JQ from car $vag3 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag3 18 2
0002: jump ££Came15
:Came15
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came15
0407: create coordinate $GQ $HQ $JQ from car $vag2 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag2 18 2
0002: jump ££Came16
:Came16
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came16
0407: create coordinate $GQ $HQ $JQ from car $vag1 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag1 18 2
0002: jump ££Came17
:Came17
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came17
0407: create coordinate $GQ $HQ $JQ from car $poezd offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $poezd 18 2
0002: jump ££Came18
:Came18
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came18
018C: play_sound 1058 at 0.0 0.0 0.0
02EB: restore_camera_with_jumpcut
0002: jump ££Came14
:C2
0001: wait 0 ms
00D6: if 0
8038: NOT $vag2 == -1 ;; integer values
004D: jump_if_false ££C3
0002: jump ££Came19
:Came19
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came19
0407: create coordinate $GQ $HQ $JQ from car $vag2 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag2 18 2
0002: jump ££Came20
:Came20
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came20
0407: create coordinate $GQ $HQ $JQ from car $vag1 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag1 18 2
0002: jump ££Came21
:Came21
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came21
0407: create coordinate $GQ $HQ $JQ from car $poezd offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $poezd 18 2
0002: jump ££Came22
:Came22
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came22
018C: play_sound 1058 at 0.0 0.0 0.0
02EB: restore_camera_with_jumpcut
0002: jump ££Came19
:C3
0001: wait 0 ms
00D6: if 0
8038: NOT $vag1 == -1 ;; integer values
004D: jump_if_false ££C4
0002: jump ££Came23
:Came23
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came23
0407: create coordinate $GQ $HQ $JQ from car $vag1 offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $vag1 18 2
0002: jump ££Came24
:Came24
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came24
0407: create coordinate $GQ $HQ $JQ from car $poezd offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $poezd 18 2
0002: jump ££Came25
:Came25
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came25
018C: play_sound 1058 at 0.0 0.0 0.0
02EB: restore_camera_with_jumpcut
0002: jump ££Came23
:Came26
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came26
0407: create coordinate $GQ $HQ $JQ from car $poezd offset 0.0 0.0 0.0
015F: set_camera_position $GQ $HQ $JQ 0.0 0.0 0.0
018C: play_sound 1058 at 0.0 0.0 0.0
0158: camera_on_vehicle $poezd 18 2
0002: jump ££Came27
:Came27
0001: wait 150 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££Out
00D6: if 0
00E1: key_pressed 0 13
004D: jump_if_false ££Came27
018C: play_sound 1058 at 0.0 0.0 0.0
02EB: restore_camera_with_jumpcut
0002: jump ££Came26
ut
0001: wait 0 ms
02EB: restore_camera_with_jumpcut
01C3: remove_references_to_car $poezd ;; Like turning a car into any random car
01C3: remove references to car $vag1
01C3: remove references to car $vag2
01C3: remove references to car $vag3
01C3: remove references to car $vag4
01C3: remove references to car $vag5
0002: jump ££Cam
===============
ЗЫ. Скрипт работает как часы, интересно попереключаться между вагонами после крушения кстати. Когда выйдет мод с удлинением поездов, я с радостью удлиню и этот скрипт =)
Если хочется засунуть этот скрипт в какой нибудь мод и т.п. - предупредите меня!
590 Прочтений • [Камера поезда v3.0 Final] [13.05.2012] [Комментариев: 0]