Эффектные аварии
Первый раз я увидел такое во Flatout'е, но как-то не подумал реализовать в игре, да и скриптинг я знал
мягко говоря плохо. Затем (в 2006) я купил на соньку, а потом и на комп True Crime: New York City.
Там была такая же фишка, как во Flatout'е. И тут меня осенило: а почему бы не сделать вылет NPC водителя через лобовое стекло при
авариях? Вначале не получалось, но потом понял свои ошибки. Не буду разглашать какие - не в этом суть.
Скрипт писал сам с нуля, теперь скажу, что он из себя представляет:
Садимся в машину, хорошо разгоняемся и врезаемся в лоб встречной машины. Врезаться нужно не в бок, не в зад, а именно в лоб.
Если врезались сильно, то водитель той машины вылетит через лобовое стекло и помрёт, а нас может сильно перевернуть - зависит от случая.
А вот и сам скрипт:
:CRASH
0001: wait 0 ms
00D6: if 1
0256: player $PLAYER_CHAR defined
00DF: actor $PLAYER_ACTOR driving
004D: jump if false ЈЈCRASH
03C0: $plc = actor $PLAYER_ACTOR car
:CRASH2
0001: wait 0 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump if false ЈЈCRASH5
00D6: if 5
8137: NOT car $plc id == #BMX
8137: NOT car $plc id == #BIKE
8137: NOT car $plc id == #MTBIKE
84C8: NOT $PLAYER_ACTOR ; not samolet
84A9: NOT $PLAYER_ACTOR ; not vertolet
847A: NOT $PLAYER_ACTOR ; not moto
004D: jump if false ЈЈCRASH5
0407: create coordinate $a $b $c from car $plc offset 5.0 10.0 0.0
0407: create coordinate $x $y $z from car $plc offset -5.0 0.0 0.0
053E: $rtc = get random car with actors -1 in area $a $b $x $y
0002: jump ЈЈCRASH3
:CRASH3
0001: wait 0 ms
00D6: if 0
00DF: actor $PLAYER_ACTOR driving
004D: jump if false ЈЈCRASH5
00D6: if 0
056E: $rtc
004D: jump if false ЈЈCRASH2
046C: $rtcd = car $rtc driver
0002: jump ЈЈCRASH4
:CRASH4
0001: wait 0 ms
00D6: if 1
00DF: actor $PLAYER_ACTOR driving
056D: unknown actor $rtcd dead but valid
004D: jump if false ЈЈCRASH5
00D6: if 6
8137: NOT car $rtc id == #BMX
8137: NOT car $rtc id == #BIKE
8137: NOT car $rtc id == #MTBIKE
84C8: NOT $rtcd ; not samolet
84A9: NOT $rtcd ; not vertolet
89AE: NOT $rtcd ; not poezd
847A: NOT $rtcd ; not moto
004D: jump if false ЈЈCRASH5
02E3: $plcs = car $plc speed
00D6: if 0
0030: $plcs >= 25.0 ;; floating-point values
004D: jump if false ЈЈCRASH5
0407: create coordinate $101 $102 $103 from car $rtc offset -2.0 1.0 -3.0
0407: create coordinate $104 $105 $106 from car $rtc offset 2.0 10.0 3.0
00D6: if 0
00A4: actor $PLAYER_ACTOR 0 ()in cube $101 $102 $103 $104 $105 $106
004D: jump if false ЈЈCRASH5
015D: set gamespeed .3
0208: @11 = random float -10.0 10.0
0208: @12 = random float -10.0 10.0
0208: @13 = random float -10.0 10.0
07DB: $plc @11 @12 @13
0362: remove actor $rtcd from car and place at 0.0 0.0 0.0
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.0 1.0 unknown 3 angle 0.0 with weapon 0
0605: unknown action sequence $rtcd "FALL_FRONT" "PED" 4.0 1 0 0 0 -1 ms
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.1 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.2 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.3 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.4 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.5 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.6 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.7 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.8 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 1.9 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.0 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.1 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.2 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.3 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.4 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.5 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.6 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.7 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.8 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 2.9 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.0 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.1 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.2 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.3 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.4 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.5 1.0 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.6 0.95 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.7 0.9 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.8 0.85 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 3.9 0.8 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.0 0.75 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.1 0.7 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.2 0.65 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.3 0.6 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.4 0.55 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.5 0.5 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.6 0.45 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.7 0.4 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.8 0.35 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 4.9 0.3 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 5.0 0.25 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 5.1 0.2 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 5.2 0.15 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 5.3 0.1 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 5.4 0.05 unknown 0 angle 0.0 with weapon 0
0001: wait 10 ms
0465: remove actor $rtcd from turret mode
0464: put actor $rtcd into turret on car $rtc at car offset -0.7 5.5 0.0 unknown 0 angle 0.0 with weapon 0
0223: set actor $rtcd health to 0
0465: remove actor $rtcd from turret mode
015D: set gamespeed 1.0
0002: jump ЈЈCRASH2
:CRASH5
0001: wait 0 ms
01C3: remove references to car $plc
01C3: remove references to car $rtc
01C2: remove references to actor $rtcd
0002: jump ЈЈCRASH