CleoOptimizer - это программа для преобразования старых миссий, написанных для мейна в Cleo-миссии. Программа заменяет глобальные переменные на локальные.
Программа учитывает такие факторы, как:
+ Не преобразовывает в локальные предопределённые в CustomVariables.ini глобальные переменные, такие как $ONMISSION и $Player_Actor.
+ Учитывает, что 32@ и 33@ - таймеры и их нельзя использовать для хранения.
+ Учитывает, что переменные могут занимать по несколько "слотов" (например, 0@v занимает 0@,1@,2@,3@)
+ Учитывает, что некоторые локальные "слоты" могут быть заняты использованными в миссии локальными переменными
+ Учитывает размеры глобальных и локальных массивов
+ Не преобразовывает закомментированные переменные и внутри строк
+ Учитывает, что в опкодах статус-текстов и таймеров требуются глобальные переменные
+ Автоматически определяет тип потока (обычный или миссия)
+ Преобразовывает опкоды end_thread, create_thread, create_thread_wb, start_mission.
+ Учитывает, что SannyBuilder НИКАК не умеет работать с именованными константами - массивами.
+ Дополнительныя опция - дефрагментация локальных переменных - используется, если не хватает места.
Инструкция по преобразовыванию пакета миссий:
1) Разделите код на отдельные потоки (миссии и их стартеры)
2) Вставить код ОДНОГО потока в левое многострочное текстовое поле.
3) Нажать кнопку Преобразовать
4) Ответить на вопросы
5) Сконвентированный код появится в правом поле.
6) Проделать это для каждого потока.
В основном, выходной код не нуждается в дополнительном редактировании, или таких моментов очень мало, в большинстве случаев некритичный обмен переменными между стартером и миссией и решаемый опкодами [c]0AB3[/c] и [c]0AB4[/c].
Конечно, не все миссии поддаются быстрому конвентированию в Cleo-формат, т.к. миссия может обмениваться данными с параллейным потоком мейна с помощью глобальных переменных (например, миссия "Блокбастер «Смерть полицейского»" от Nikitos). К счастью, таких моментов обычно мало. Такую миссию и параллейный поток после преобразования нужно вручную подредактировать с использованием Cleo-опкодов [c]0AB3[/c] и [c]0AB4[/c] (глобальные Cleo-переменные). Также миссия может использовать "номерные" глобальные переменные из кода оригинального мейна (например, отключать парковку т. д.). В таком случае можно вручную исправить.
Пример работы CleoOptimize:
Код миссии Дрифт v2.0 от Flash для мейна:
{В .fxt файл (CLEO_TEXT плагин) необходимо добавить следующее:
DRIFT Drift
DRIFTHI Need to win:
DRIFYOU Your score:
DRIFBON Bonus:
DRIFBNN x~1~}
//This script was created by 'GTA: San Andreas Race Mission Creator v1.0'
:Lap_Example
$Lap_Example_XCoord = 2480.55
$Lap_Example_YCoord = -1666.06
$Lap_Example_ZCoord = 13.34
$Lap_Example_Marker = Marker.CreateIconAndSphere(53, $Lap_Example_XCoord, $Lap_Example_YCoord, $Lap_Example_ZCoord)
:Lap_Example_1349
wait 25 ms
Player.Defined($PLAYER_CHAR)
jf @Lap_Example_1349
0101: actor $PLAYER_ACTOR stopped_near_point $Lap_Example_XCoord $Lap_Example_YCoord $Lap_Example_ZCoord radius 3.0 3.0 3.0 sphere 0
jf @Lap_Example_1349
Player.Controllable($PLAYER_CHAR)
jf @Lap_Example_1349
$ONMISSION == 0 // integer values
jf @Lap_Example_1349
Marker.Disable($11192)
054C: use_GXT_table 'RACETOR'
00BA: text_styled 'RACES_0' 1500 ms 2
0169: set_fade_color 0 0 0
fade 0 (in) 2500 ms
:Lap_Example_1492
wait 0 ms
not fading
jf @Lap_Example_1492
Marker.Disable($11192)
00BE: text_clear_all
03E6: remove_text_box
if $DRIFT_MISSION_PASSED == 0//
then $hiscore = 150// Начальное кол-во очков, необходимых для победы //
end//
start_mission 0
end_thread
//-------------Mission 0---------------
:Lap_Example_000
thread 'EXAMPL1'
gosub @Lap_Example_47
wasted_or_busted
jf @Lap_Example_38
gosub @Lap_Example_2497
:Lap_Example_38
gosub @Lap_Example_2762
end_thread
:Lap_Example_47
increment_mission_attempts
$ONMISSION = 1
Player.ClearWantedLevel($PLAYER_CHAR)
00BE: text_clear_all
{Мои переменные и константы}
const//
PLAYER_CAR = $car[1]//
TEMP_SCORE = 8@//
BONUS = 9@//
DRIFT_ANGLE = 15.0//
CAR_HEALTH = 10@//
CAR_SPEED = 7@//
SPEED_LIMIT = 10.0//
DRIFTING_ANGLE = 15@//
end//
var//
1@:float//
2@:float//
3@:float//
4@:float//
5@:float//
6@:float//
7@:float//
8@:int//
9@:int//
10@:int//
11@:int//
12@:int//
13@:int//
14@:int//
15@:int//
$score:int//
end//
var
$nar : Integer
$tar : Integer
$time : Integer = 1000
$dist : Float
$dist2 : Float
$pos : Integer = 1
$pos2 : Integer = 1
$stage : Array 5 of Integer
$car : Array 5 of Car
$model : Array 5 of Model
$act : Array 5 of Actor
$mark : Array 5 of Marker
$carx : Array 5 of Float
$cary : Array 5 of Float
$carz : Array 5 of Float
$angle : Array 5 of Float
$paintjob : Array 5 of Integer
$pointx : Array 17 of Float
$pointy : Array 17 of Float
$pointz : Array 17 of Float
$speed : Array 17 of Float
$type : Array 17 of Integer
$components : Array 9 of Model
$component1 : Array 9 of Model
$component2 : Array 9 of Model
$component3 : Array 9 of Model
$component4 : Array 9 of Model
$component5 : Array 9 of Model
$component6 : Array 9 of Model
$component7 : Array 9 of Model
$component8 : Array 9 of Model
$component9 : Array 9 of Model
$component10 : Array 9 of Model
end
for $par = 1 to 1
$stage[$par] = 1
end
$pointx[1] = 2372.91
$pointy[1] = -1658.93
$pointz[1] = 13.38
$speed[1] = 100.0
$type[1] = 3
$pointx[2] = 2342.61
$pointy[2] = -1580.44
$pointz[2] = 23.76
$speed[2] = 50.0
$type[2] = 3
$pointx[3] = 2342.81
$pointy[3] = -1538.50
$pointz[3] = 23.84
$speed[3] = 100.0
$type[3] = 3
$pointx[4] = 2228.25
$pointy[4] = -1484.19
$pointz[4] = 23.23
$speed[4] = 100.0
$type[4] = 3
$pointx[5] = 2212.02
$pointy[5] = -1398.15
$pointz[5] = 23.34
$speed[5] = 100.0
$type[5] = 3
$pointx[6] = 2068.81
$pointy[6] = -1278.58
$pointz[6] = 23.34
$speed[6] = 100.0
$type[6] = 3
$pointx[7] = 1792.85
$pointy[7] = -1273.45
$pointz[7] = 12.98
$speed[7] = 100.0
$type[7] = 3
$pointx[8] = 1792.85
$pointy[8] = -1273.45
$pointz[8] = 12.98
$speed[8] = 50.0
$type[8] = 3
$pointx[9] = 1715.13
$pointy[9] = -1417.16
$pointz[9] = 12.90
$speed[9] = 100.0
$type[9] = 3
$carx[1] = 2457.08
$cary[1] = -1656.42
$carz[1] = 13.30
$angle[1] = 90.0
$paintjob[1] = 0
$model[1] = #ELEGY
$components[1] = 7
$component1[1] = #WG_L_A_L
$component2[1] = #EXH_C_L
$component3[1] = #RF_C_L
$component4[1] = #SPL_C_L_B
$component5[1] = #RBMP_C_L
$component6[1] = #FBMP_C_L
$component7[1] = #WG_L_C_L
for $par = 1 to 1
$model[$par].Load
end
06E9: request_car_component $component1[1]
06E9: request_car_component $component2[1]
06E9: request_car_component $component3[1]
06E9: request_car_component $component4[1]
06E9: request_car_component $component5[1]
06E9: request_car_component $component6[1]
06E9: request_car_component $component7[1]
wait 1000 ms
:Lap_Example_111
wait 0 ms
for $par = 1 to 1
$model[$par].Available
jf @Lap_Example_111
end
if and
06EA: car_component $component1[1] available
06EA: car_component $component2[1] available
06EA: car_component $component3[1] available
06EA: car_component $component4[1] available
06EA: car_component $component5[1] available
06EA: car_component $component6[1] available
06EA: car_component $component7[1] available
jf @Lap_Example_111
01EB: set_traffic_density_to 0.0
0395: clear_area 1 at $carx[1] $cary[1] $carz[1] range 300.0
for $par = 1 to 1
$car[$par] = Car.Create($model[$par], $carx[$par], $cary[$par], $carz[$par])
Car.Angle($car[$par]) = $angle[$par]
// Car.SetImmunities($car[$par], 1, 1, 1, 1, 1)
07EE: car $car[$par] enable_tire_marks 1
Car.DoorStatus($car[$par]) = 2
if $components[$par] >= 1
then
06E7: $cmpnent = add_car_component $component1[$par] to_car $car[$par]
if $components[$par] >= 2
then
06E7: $cmpnent2 = add_car_component $component2[$par] to_car $car[$par]
if $components[$par] >= 3
then
06E7: $cmpnent3 = add_car_component $component3[$par] to_car $car[$par]
if $components[$par] >= 4
then
06E7: $cmpnent4 = add_car_component $component4[$par] to_car $car[$par]
if $components[$par] >= 5
then
06E7: $cmpnent5 = add_car_component $component5[$par] to_car $car[$par]
if $components[$par] >= 6
then
06E7: $cmpnent6 = add_car_component $component6[$par] to_car $car[$par]
if $components[$par] >= 7
then
06E7: $cmpnent7 = add_car_component $component7[$par] to_car $car[$par]
if $components[$par] >= 8
then
06E7: $cmpnent8 = add_car_component $component8[$par] to_car $car[$par]
if $components[$par] >= 9
then
06E7: $cmpnent9 = add_car_component $component9[$par] to_car $car[$par]
if $components[$par] >= 10
then
06E7: $cmpnent10 = add_car_component $component10[$par] to_car $car[$par]
end
end
end
end
end
end
end
end
end
end
if $paintjob[$par] <> -1
then
06ED: set_car $car[$par] paintjob $paintjob[$par]
end
end
036A: put_actor $PLAYER_ACTOR in_vehicle $car[1]
0407: create_coordinate $camx $camy $camz from_car $car[1] offset 0.0 -23.7 14.1
Camera.SetPosition($camx, $camy, $camz, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
Player.CanMove($PLAYER_CHAR) = False
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
03F4: set_all_vehicles_apply_damage_rules 0
wait 2500 ms
fade 1 (out) 1000 ms
wait 1000 ms
00BA: text_styled 'RACES_4' 1100 ms 4 // 3
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate $camx2 $camy2 $camz2 from_car $car[1] offset 0.0 -13.7 7.1
Camera.SetPosition($camx2, $camy2, $camz2, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_5' 1100 ms 4 // 2
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate $camx3 $camy3 $camz3 from_car $car[1] offset 0.0 -6.7 3.1
Camera.SetPosition($camx3, $camy3, $camz3, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_6' 1100 ms 4 // 1
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
00BA: text_styled 'RACES_7' 800 ms 4 // GO!
097A: at 0.0 0.0 0.0 play_sound 1057
01BD: 11@ = current_time_in_ms
Player.CanMove($PLAYER_CHAR) = True
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
03F4: set_all_vehicles_apply_damage_rules 1
01EB: set_traffic_density_to 0.0
Camera.SetBehindPlayer
Camera.Restore
//03C3: set_timer_with_text_to $time type 1 text 'TIMER' // TIME
14@ = car.Health(PLAYER_CAR)//
for $kar = 1 to 9
$nar = $kar // integer values
$nar += 1 // integer values
018A: $chekp = create_checkpoint_at $pointx[$kar] $pointy[$kar] $pointz[$kar]
0168: show_on_radar $chekp 4
if
$kar == 9 // integer values
then
1@ = 1
Marker.SetColor($chekp, 0)
end
06D5: $rchekp = create_racing_checkpoint_at $pointx[$kar] $pointy[$kar] $pointz[$kar] point_to $pointx[$nar] $pointy[$nar] $pointz[$nar] type 1@ radius 6.0
while 8100: not actor $PLAYER_ACTOR near_point_in_vehicle $pointx[$kar] $pointy[$kar] $pointz[$kar] radius 12.0 12.0 12.0 sphere 0
// if
// $time <= 0
// then
// jump @Lap_Example_2497
// end
gosub @drift//
03F0: toggle_text_draw 1//
033F: set_text_draw_letter_size 0.7 0.933//
0340: set_text_draw_RGBA 255 255 255 255//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 2//
060D: draw_text_shadow 1 color_RGBA 0 0 0 255//
045A: draw_text_1number 130.0 415.0 GXT 'NUMBER' number DRIFTING_ANGLE//
08DA: remove_panel 16@//
08D4: 16@ = create_panel_with_title 'DRIFT' position 29.0 30.0 width 35.0 columns 2 interactive 0 background 1 alignment 1//
09DB: set_panel 16@ column 0 width 120//
08DB: set_panel 16@ column 0 header 'DUMMY' data 'DRIFTHI' 'DRIFYOU' 'DUMMY' 'DRIFBON' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08DB: set_panel 16@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08EE: set_panel 16@ column 1 row 0 text_1number GXT 'NUMBER' number $hiscore//
08EE: set_panel 16@ column 1 row 1 text_1number GXT 'NUMBER' number $score//
08EE: set_panel 16@ column 1 row 3 text_1number GXT 'DRIFBNN' number BONUS//
if TEMP_SCORE > 0//
then//
033F: set_text_draw_letter_size 1.3 1.7//
0340: set_text_draw_RGBA 217 222 12 150//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 3//
060D: draw_text_shadow 0 color_RGBA 0 0 0 125//
0912: unknown_text_draw_flag 1 height 355 width 370//
0342: toggle_text_draw_centered 1//
045A: draw_text_1number 280.0 100.0 GXT 'NUMBER' number TEMP_SCORE//
end//
if and
$pos = 1 // integer values
not Actor.InCar($PLAYER_ACTOR, $car[1])
then
jump @Lap_Example_2497
end
if or
Car.Wrecked($car[1])
02BF: car $car[1] sunk
then
jump @Lap_Example_2497
end
// wait 0 ms
end
Marker.Disable($chekp)
06D6: delete_racing_checkpoint $rchekp
097A: at 0.0 0.0 0.0 play_sound 1058
end
jump @Lap_Example_2491
:Lap_Example_2491
gosub @Lap_Example_REMOVE
if
// $pos2 == 1
002c: $score >= $hiscore//
then
$DRIFT_MISSION_PASSED = 1//
0084: $hiscore = $score//
$score = 0//
00BA: text_styled 'RACES18' 3000 ms 1 // Winner!
wait 3000 ms
01E3: text_1number_styled 'M_PASS' 3000 4000 ms 1 // MISSION PASSED!~n~~w~$~1~
Player.Money($PLAYER_CHAR) += 3000
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
0394: play_music 1
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
else
01E3: text_1number_styled 'RACES_8' 200 5000 ms 1 // Loser!
create_thread @Lap_Example
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
end
0318: set_latest_mission_passed_to 'RACES_0'
Player.ClearWantedLevel($PLAYER_CHAR)
create_thread @Lap_Example
gosub @Lap_Example_38
return
:Lap_Example_2497
gosub @Lap_Example_REMOVE
00BA: text_styled 'RACES_8' 5000 ms 1 // Loser!
create_thread @Lap_Example
return
:Lap_Example_REMOVE
01EB: set_traffic_density_to 1.0
Car.DoorStatus($car[1]) = 0
for $par = 1 to 1
if
$car[$par] <> -1
then
Car.SetImmunities($car[$par], 0, 0, 0, 0, 0)
Model.Destroy($model[$par])
Car.RemoveReferences($car[$par])
if
$par <> 1
then
Marker.Disable($mark[$par])
Actor.RemoveReferences($act[$par])
end
end
end
06EB: release_car_component $component1[1]
06EB: release_car_component $component2[1]
06EB: release_car_component $component3[1]
06EB: release_car_component $component4[1]
06EB: release_car_component $component5[1]
06EB: release_car_component $component6[1]
06EB: release_car_component $component7[1]
Marker.Disable($chekp)
06D6: delete_racing_checkpoint $rchekp
03F0: toggle_text_draw 0
014F: delete_timer $time
01B7: release_weather
00BE: text_clear_all//
$score += TEMP_SCORE//
08DA: remove_panel 16@//
return
:Lap_Example_2762
$ONMISSION = 0 // integer values
mission_cleanup
return
{Все последующие строки - мой код.
Их тоже необходимо вставлять в файл.}
:drift
//wait 0
11@ = TEMP_SCORE
gosub @drifted
if
TEMP_SCORE > 11@
then
12@ = 0
13@ = 0
else
if 12@ == 0
then
01BD: 12@ = current_time_in_ms
end
if
13@ <= 2000
then
01BD: 13@ = current_time_in_ms
13@ -= 12@
else
$score += TEMP_SCORE
TEMP_SCORE = 0
12@ = 0
13@ = 0
end
end
CAR_HEALTH = car.Health(PLAYER_CAR)
if
CAR_HEALTH < 14@
then
TEMP_SCORE = 0
12@ = 0
13@ = 0
14@ = CAR_HEALTH
//0A30: repair_car PLAYER_CAR //раскомментируйте эти строки, если необходимо установить на авто иммунитеты //
//14@ = car.Health(PLAYER_CAR) //
00BE: text_clear_all
wait 2000
end
return
:drifted
car.StorePos(PLAYER_CAR,1@,2@,3@)
wait 0
car.StorePos(PLAYER_CAR,3@,4@,5@)
3@ -= 1@
4@ -= 2@
02F8: get_car PLAYER_CAR Z_angle_cosine_to 5@
02F9: get_car PLAYER_CAR Z_angle_sine_to 6@
05A4: get_angle_between_vectors_origin_to 5@ 6@ and_origin_to 3@ 4@ store_to 5@
0087: DRIFTING_ANGLE = 5@
0092: DRIFTING_ANGLE = float DRIFTING_ANGLE to_integer
02E3: CAR_SPEED = car PLAYER_CAR speed
if and
CAR_SPEED >= SPEED_LIMIT
81F4: not car PLAYER_CAR flipped
8119: not car PLAYER_CAR wrecked
82BF: not car PLAYER_CAR sunk
81F3: not car PLAYER_CAR in_air
then
BONUS = 1
if CAR_SPEED >= 19.0
then
BONUS = 2
end
if CAR_SPEED >= 31.0
then
BONUS = 3
end
if CAR_SPEED >= 46.0
then
BONUS = 4
end
if CAR_SPEED >= 63.0
then
BONUS = 5
end
if and
TEMP_SCORE >=50
TEMP_SCORE <150
then
BONUS *= 2
end
if and
TEMP_SCORE >=150
TEMP_SCORE <500
then
BONUS *= 3
end
if and
TEMP_SCORE >=500
TEMP_SCORE <1000
then
BONUS *= 4
end
if TEMP_SCORE >=1000
then
BONUS *= 5
end
if and
5@ >= DRIFT_ANGLE
5@ <= 90.0
then inc(TEMP_SCORE,BONUS)
end
end
return
DRIFT Drift
DRIFTHI Need to win:
DRIFYOU Your score:
DRIFBON Bonus:
DRIFBNN x~1~}
//This script was created by 'GTA: San Andreas Race Mission Creator v1.0'
:Lap_Example
$Lap_Example_XCoord = 2480.55
$Lap_Example_YCoord = -1666.06
$Lap_Example_ZCoord = 13.34
$Lap_Example_Marker = Marker.CreateIconAndSphere(53, $Lap_Example_XCoord, $Lap_Example_YCoord, $Lap_Example_ZCoord)
:Lap_Example_1349
wait 25 ms
Player.Defined($PLAYER_CHAR)
jf @Lap_Example_1349
0101: actor $PLAYER_ACTOR stopped_near_point $Lap_Example_XCoord $Lap_Example_YCoord $Lap_Example_ZCoord radius 3.0 3.0 3.0 sphere 0
jf @Lap_Example_1349
Player.Controllable($PLAYER_CHAR)
jf @Lap_Example_1349
$ONMISSION == 0 // integer values
jf @Lap_Example_1349
Marker.Disable($11192)
054C: use_GXT_table 'RACETOR'
00BA: text_styled 'RACES_0' 1500 ms 2
0169: set_fade_color 0 0 0
fade 0 (in) 2500 ms
:Lap_Example_1492
wait 0 ms
not fading
jf @Lap_Example_1492
Marker.Disable($11192)
00BE: text_clear_all
03E6: remove_text_box
if $DRIFT_MISSION_PASSED == 0//
then $hiscore = 150// Начальное кол-во очков, необходимых для победы //
end//
start_mission 0
end_thread
//-------------Mission 0---------------
:Lap_Example_000
thread 'EXAMPL1'
gosub @Lap_Example_47
wasted_or_busted
jf @Lap_Example_38
gosub @Lap_Example_2497
:Lap_Example_38
gosub @Lap_Example_2762
end_thread
:Lap_Example_47
increment_mission_attempts
$ONMISSION = 1
Player.ClearWantedLevel($PLAYER_CHAR)
00BE: text_clear_all
{Мои переменные и константы}
const//
PLAYER_CAR = $car[1]//
TEMP_SCORE = 8@//
BONUS = 9@//
DRIFT_ANGLE = 15.0//
CAR_HEALTH = 10@//
CAR_SPEED = 7@//
SPEED_LIMIT = 10.0//
DRIFTING_ANGLE = 15@//
end//
var//
1@:float//
2@:float//
3@:float//
4@:float//
5@:float//
6@:float//
7@:float//
8@:int//
9@:int//
10@:int//
11@:int//
12@:int//
13@:int//
14@:int//
15@:int//
$score:int//
end//
var
$nar : Integer
$tar : Integer
$time : Integer = 1000
$dist : Float
$dist2 : Float
$pos : Integer = 1
$pos2 : Integer = 1
$stage : Array 5 of Integer
$car : Array 5 of Car
$model : Array 5 of Model
$act : Array 5 of Actor
$mark : Array 5 of Marker
$carx : Array 5 of Float
$cary : Array 5 of Float
$carz : Array 5 of Float
$angle : Array 5 of Float
$paintjob : Array 5 of Integer
$pointx : Array 17 of Float
$pointy : Array 17 of Float
$pointz : Array 17 of Float
$speed : Array 17 of Float
$type : Array 17 of Integer
$components : Array 9 of Model
$component1 : Array 9 of Model
$component2 : Array 9 of Model
$component3 : Array 9 of Model
$component4 : Array 9 of Model
$component5 : Array 9 of Model
$component6 : Array 9 of Model
$component7 : Array 9 of Model
$component8 : Array 9 of Model
$component9 : Array 9 of Model
$component10 : Array 9 of Model
end
for $par = 1 to 1
$stage[$par] = 1
end
$pointx[1] = 2372.91
$pointy[1] = -1658.93
$pointz[1] = 13.38
$speed[1] = 100.0
$type[1] = 3
$pointx[2] = 2342.61
$pointy[2] = -1580.44
$pointz[2] = 23.76
$speed[2] = 50.0
$type[2] = 3
$pointx[3] = 2342.81
$pointy[3] = -1538.50
$pointz[3] = 23.84
$speed[3] = 100.0
$type[3] = 3
$pointx[4] = 2228.25
$pointy[4] = -1484.19
$pointz[4] = 23.23
$speed[4] = 100.0
$type[4] = 3
$pointx[5] = 2212.02
$pointy[5] = -1398.15
$pointz[5] = 23.34
$speed[5] = 100.0
$type[5] = 3
$pointx[6] = 2068.81
$pointy[6] = -1278.58
$pointz[6] = 23.34
$speed[6] = 100.0
$type[6] = 3
$pointx[7] = 1792.85
$pointy[7] = -1273.45
$pointz[7] = 12.98
$speed[7] = 100.0
$type[7] = 3
$pointx[8] = 1792.85
$pointy[8] = -1273.45
$pointz[8] = 12.98
$speed[8] = 50.0
$type[8] = 3
$pointx[9] = 1715.13
$pointy[9] = -1417.16
$pointz[9] = 12.90
$speed[9] = 100.0
$type[9] = 3
$carx[1] = 2457.08
$cary[1] = -1656.42
$carz[1] = 13.30
$angle[1] = 90.0
$paintjob[1] = 0
$model[1] = #ELEGY
$components[1] = 7
$component1[1] = #WG_L_A_L
$component2[1] = #EXH_C_L
$component3[1] = #RF_C_L
$component4[1] = #SPL_C_L_B
$component5[1] = #RBMP_C_L
$component6[1] = #FBMP_C_L
$component7[1] = #WG_L_C_L
for $par = 1 to 1
$model[$par].Load
end
06E9: request_car_component $component1[1]
06E9: request_car_component $component2[1]
06E9: request_car_component $component3[1]
06E9: request_car_component $component4[1]
06E9: request_car_component $component5[1]
06E9: request_car_component $component6[1]
06E9: request_car_component $component7[1]
wait 1000 ms
:Lap_Example_111
wait 0 ms
for $par = 1 to 1
$model[$par].Available
jf @Lap_Example_111
end
if and
06EA: car_component $component1[1] available
06EA: car_component $component2[1] available
06EA: car_component $component3[1] available
06EA: car_component $component4[1] available
06EA: car_component $component5[1] available
06EA: car_component $component6[1] available
06EA: car_component $component7[1] available
jf @Lap_Example_111
01EB: set_traffic_density_to 0.0
0395: clear_area 1 at $carx[1] $cary[1] $carz[1] range 300.0
for $par = 1 to 1
$car[$par] = Car.Create($model[$par], $carx[$par], $cary[$par], $carz[$par])
Car.Angle($car[$par]) = $angle[$par]
// Car.SetImmunities($car[$par], 1, 1, 1, 1, 1)
07EE: car $car[$par] enable_tire_marks 1
Car.DoorStatus($car[$par]) = 2
if $components[$par] >= 1
then
06E7: $cmpnent = add_car_component $component1[$par] to_car $car[$par]
if $components[$par] >= 2
then
06E7: $cmpnent2 = add_car_component $component2[$par] to_car $car[$par]
if $components[$par] >= 3
then
06E7: $cmpnent3 = add_car_component $component3[$par] to_car $car[$par]
if $components[$par] >= 4
then
06E7: $cmpnent4 = add_car_component $component4[$par] to_car $car[$par]
if $components[$par] >= 5
then
06E7: $cmpnent5 = add_car_component $component5[$par] to_car $car[$par]
if $components[$par] >= 6
then
06E7: $cmpnent6 = add_car_component $component6[$par] to_car $car[$par]
if $components[$par] >= 7
then
06E7: $cmpnent7 = add_car_component $component7[$par] to_car $car[$par]
if $components[$par] >= 8
then
06E7: $cmpnent8 = add_car_component $component8[$par] to_car $car[$par]
if $components[$par] >= 9
then
06E7: $cmpnent9 = add_car_component $component9[$par] to_car $car[$par]
if $components[$par] >= 10
then
06E7: $cmpnent10 = add_car_component $component10[$par] to_car $car[$par]
end
end
end
end
end
end
end
end
end
end
if $paintjob[$par] <> -1
then
06ED: set_car $car[$par] paintjob $paintjob[$par]
end
end
036A: put_actor $PLAYER_ACTOR in_vehicle $car[1]
0407: create_coordinate $camx $camy $camz from_car $car[1] offset 0.0 -23.7 14.1
Camera.SetPosition($camx, $camy, $camz, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
Player.CanMove($PLAYER_CHAR) = False
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
03F4: set_all_vehicles_apply_damage_rules 0
wait 2500 ms
fade 1 (out) 1000 ms
wait 1000 ms
00BA: text_styled 'RACES_4' 1100 ms 4 // 3
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate $camx2 $camy2 $camz2 from_car $car[1] offset 0.0 -13.7 7.1
Camera.SetPosition($camx2, $camy2, $camz2, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_5' 1100 ms 4 // 2
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate $camx3 $camy3 $camz3 from_car $car[1] offset 0.0 -6.7 3.1
Camera.SetPosition($camx3, $camy3, $camz3, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_6' 1100 ms 4 // 1
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
00BA: text_styled 'RACES_7' 800 ms 4 // GO!
097A: at 0.0 0.0 0.0 play_sound 1057
01BD: 11@ = current_time_in_ms
Player.CanMove($PLAYER_CHAR) = True
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
03F4: set_all_vehicles_apply_damage_rules 1
01EB: set_traffic_density_to 0.0
Camera.SetBehindPlayer
Camera.Restore
//03C3: set_timer_with_text_to $time type 1 text 'TIMER' // TIME
14@ = car.Health(PLAYER_CAR)//
for $kar = 1 to 9
$nar = $kar // integer values
$nar += 1 // integer values
018A: $chekp = create_checkpoint_at $pointx[$kar] $pointy[$kar] $pointz[$kar]
0168: show_on_radar $chekp 4
if
$kar == 9 // integer values
then
1@ = 1
Marker.SetColor($chekp, 0)
end
06D5: $rchekp = create_racing_checkpoint_at $pointx[$kar] $pointy[$kar] $pointz[$kar] point_to $pointx[$nar] $pointy[$nar] $pointz[$nar] type 1@ radius 6.0
while 8100: not actor $PLAYER_ACTOR near_point_in_vehicle $pointx[$kar] $pointy[$kar] $pointz[$kar] radius 12.0 12.0 12.0 sphere 0
// if
// $time <= 0
// then
// jump @Lap_Example_2497
// end
gosub @drift//
03F0: toggle_text_draw 1//
033F: set_text_draw_letter_size 0.7 0.933//
0340: set_text_draw_RGBA 255 255 255 255//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 2//
060D: draw_text_shadow 1 color_RGBA 0 0 0 255//
045A: draw_text_1number 130.0 415.0 GXT 'NUMBER' number DRIFTING_ANGLE//
08DA: remove_panel 16@//
08D4: 16@ = create_panel_with_title 'DRIFT' position 29.0 30.0 width 35.0 columns 2 interactive 0 background 1 alignment 1//
09DB: set_panel 16@ column 0 width 120//
08DB: set_panel 16@ column 0 header 'DUMMY' data 'DRIFTHI' 'DRIFYOU' 'DUMMY' 'DRIFBON' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08DB: set_panel 16@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08EE: set_panel 16@ column 1 row 0 text_1number GXT 'NUMBER' number $hiscore//
08EE: set_panel 16@ column 1 row 1 text_1number GXT 'NUMBER' number $score//
08EE: set_panel 16@ column 1 row 3 text_1number GXT 'DRIFBNN' number BONUS//
if TEMP_SCORE > 0//
then//
033F: set_text_draw_letter_size 1.3 1.7//
0340: set_text_draw_RGBA 217 222 12 150//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 3//
060D: draw_text_shadow 0 color_RGBA 0 0 0 125//
0912: unknown_text_draw_flag 1 height 355 width 370//
0342: toggle_text_draw_centered 1//
045A: draw_text_1number 280.0 100.0 GXT 'NUMBER' number TEMP_SCORE//
end//
if and
$pos = 1 // integer values
not Actor.InCar($PLAYER_ACTOR, $car[1])
then
jump @Lap_Example_2497
end
if or
Car.Wrecked($car[1])
02BF: car $car[1] sunk
then
jump @Lap_Example_2497
end
// wait 0 ms
end
Marker.Disable($chekp)
06D6: delete_racing_checkpoint $rchekp
097A: at 0.0 0.0 0.0 play_sound 1058
end
jump @Lap_Example_2491
:Lap_Example_2491
gosub @Lap_Example_REMOVE
if
// $pos2 == 1
002c: $score >= $hiscore//
then
$DRIFT_MISSION_PASSED = 1//
0084: $hiscore = $score//
$score = 0//
00BA: text_styled 'RACES18' 3000 ms 1 // Winner!
wait 3000 ms
01E3: text_1number_styled 'M_PASS' 3000 4000 ms 1 // MISSION PASSED!~n~~w~$~1~
Player.Money($PLAYER_CHAR) += 3000
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
0394: play_music 1
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
else
01E3: text_1number_styled 'RACES_8' 200 5000 ms 1 // Loser!
create_thread @Lap_Example
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
end
0318: set_latest_mission_passed_to 'RACES_0'
Player.ClearWantedLevel($PLAYER_CHAR)
create_thread @Lap_Example
gosub @Lap_Example_38
return
:Lap_Example_2497
gosub @Lap_Example_REMOVE
00BA: text_styled 'RACES_8' 5000 ms 1 // Loser!
create_thread @Lap_Example
return
:Lap_Example_REMOVE
01EB: set_traffic_density_to 1.0
Car.DoorStatus($car[1]) = 0
for $par = 1 to 1
if
$car[$par] <> -1
then
Car.SetImmunities($car[$par], 0, 0, 0, 0, 0)
Model.Destroy($model[$par])
Car.RemoveReferences($car[$par])
if
$par <> 1
then
Marker.Disable($mark[$par])
Actor.RemoveReferences($act[$par])
end
end
end
06EB: release_car_component $component1[1]
06EB: release_car_component $component2[1]
06EB: release_car_component $component3[1]
06EB: release_car_component $component4[1]
06EB: release_car_component $component5[1]
06EB: release_car_component $component6[1]
06EB: release_car_component $component7[1]
Marker.Disable($chekp)
06D6: delete_racing_checkpoint $rchekp
03F0: toggle_text_draw 0
014F: delete_timer $time
01B7: release_weather
00BE: text_clear_all//
$score += TEMP_SCORE//
08DA: remove_panel 16@//
return
:Lap_Example_2762
$ONMISSION = 0 // integer values
mission_cleanup
return
{Все последующие строки - мой код.
Их тоже необходимо вставлять в файл.}
:drift
//wait 0
11@ = TEMP_SCORE
gosub @drifted
if
TEMP_SCORE > 11@
then
12@ = 0
13@ = 0
else
if 12@ == 0
then
01BD: 12@ = current_time_in_ms
end
if
13@ <= 2000
then
01BD: 13@ = current_time_in_ms
13@ -= 12@
else
$score += TEMP_SCORE
TEMP_SCORE = 0
12@ = 0
13@ = 0
end
end
CAR_HEALTH = car.Health(PLAYER_CAR)
if
CAR_HEALTH < 14@
then
TEMP_SCORE = 0
12@ = 0
13@ = 0
14@ = CAR_HEALTH
//0A30: repair_car PLAYER_CAR //раскомментируйте эти строки, если необходимо установить на авто иммунитеты //
//14@ = car.Health(PLAYER_CAR) //
00BE: text_clear_all
wait 2000
end
return
:drifted
car.StorePos(PLAYER_CAR,1@,2@,3@)
wait 0
car.StorePos(PLAYER_CAR,3@,4@,5@)
3@ -= 1@
4@ -= 2@
02F8: get_car PLAYER_CAR Z_angle_cosine_to 5@
02F9: get_car PLAYER_CAR Z_angle_sine_to 6@
05A4: get_angle_between_vectors_origin_to 5@ 6@ and_origin_to 3@ 4@ store_to 5@
0087: DRIFTING_ANGLE = 5@
0092: DRIFTING_ANGLE = float DRIFTING_ANGLE to_integer
02E3: CAR_SPEED = car PLAYER_CAR speed
if and
CAR_SPEED >= SPEED_LIMIT
81F4: not car PLAYER_CAR flipped
8119: not car PLAYER_CAR wrecked
82BF: not car PLAYER_CAR sunk
81F3: not car PLAYER_CAR in_air
then
BONUS = 1
if CAR_SPEED >= 19.0
then
BONUS = 2
end
if CAR_SPEED >= 31.0
then
BONUS = 3
end
if CAR_SPEED >= 46.0
then
BONUS = 4
end
if CAR_SPEED >= 63.0
then
BONUS = 5
end
if and
TEMP_SCORE >=50
TEMP_SCORE <150
then
BONUS *= 2
end
if and
TEMP_SCORE >=150
TEMP_SCORE <500
then
BONUS *= 3
end
if and
TEMP_SCORE >=500
TEMP_SCORE <1000
then
BONUS *= 4
end
if TEMP_SCORE >=1000
then
BONUS *= 5
end
if and
5@ >= DRIFT_ANGLE
5@ <= 90.0
then inc(TEMP_SCORE,BONUS)
end
end
return
А вот сконвентированный код:
Миссия:
{$CLEO .cm}
const
_car = 17@
_score = 0@
_nar = 22@
_tar = 23@
_time = $1797
_dist = 25@
_dist2 = 26@
_pos = 27@
_pos2 = 28@
_stage = 34@
_model = 39@
_act = 44@
_mark = 49@
_carx = 54@
_cary = 59@
_carz = 64@
_angle = 69@
_paintjob = 74@
_pointx = 79@
_pointy = 96@
_pointz = 113@
_speed = 130@
_type = 147@
_components = 164@
_component1 = 173@
_component2 = 182@
_component3 = 191@
_component4 = 200@
_component5 = 209@
_component6 = 218@
_component7 = 227@
_component8 = 236@
_component9 = 245@
_component10 = 254@
_par = 29@
_cmpnent = 30@
_cmpnent2 = 31@
_cmpnent3 = 263@
_cmpnent4 = 264@
_cmpnent5 = 265@
_cmpnent6 = 266@
_cmpnent7 = 267@
_cmpnent8 = 268@
_cmpnent9 = 269@
_cmpnent10 = 270@
_camx = 271@
_camy = 272@
_camz = 273@
_camx2 = 274@
_camy2 = 275@
_camz2 = 276@
_camx3 = 277@
_camy3 = 278@
_camz3 = 279@
_kar = 280@
_chekp = 281@
_rchekp = 282@
_hiscore = 283@
_DRIFT_MISSION_PASSED = 284@
end
//-------------Mission 0---------------
:Lap_Example_000
thread 'EXAMPL1'
gosub @Lap_Example_47
wasted_or_busted
jf @Lap_Example_38
gosub @Lap_Example_2497
:Lap_Example_38
gosub @Lap_Example_2762
end_thread
:Lap_Example_47
increment_mission_attempts
$ONMISSION = 1
Player.ClearWantedLevel($PLAYER_CHAR)
00BE: text_clear_all
{Мои переменные и константы}
const//
PLAYER_CAR = {_car[1]}18@//
TEMP_SCORE = 8@//
BONUS = 9@//
DRIFT_ANGLE = 15.0//
CAR_HEALTH = 10@//
CAR_SPEED = 7@//
SPEED_LIMIT = 10.0//
DRIFTING_ANGLE = 15@//
end//
var//
1@:float//
2@:float//
3@:float//
4@:float//
5@:float//
6@:float//
7@:float//
8@:int//
9@:int//
10@:int//
11@:int//
12@:int//
13@:int//
14@:int//
15@:int//
_score:int//
end//
var
_nar : Integer
_tar : Integer
_time : Integer = 1000
_dist : Float
_dist2 : Float
_pos : Integer = 1
_pos2 : Integer = 1
_stage : Array 5 of Integer
_car : Array 5 of Car
_model : Array 5 of Model
_act : Array 5 of Actor
_mark : Array 5 of Marker
_carx : Array 5 of Float
_cary : Array 5 of Float
_carz : Array 5 of Float
_angle : Array 5 of Float
_paintjob : Array 5 of Integer
_pointx : Array 17 of Float
_pointy : Array 17 of Float
_pointz : Array 17 of Float
_speed : Array 17 of Float
_type : Array 17 of Integer
_components : Array 9 of Model
_component1 : Array 9 of Model
_component2 : Array 9 of Model
_component3 : Array 9 of Model
_component4 : Array 9 of Model
_component5 : Array 9 of Model
_component6 : Array 9 of Model
_component7 : Array 9 of Model
_component8 : Array 9 of Model
_component9 : Array 9 of Model
_component10 : Array 9 of Model
end
for _par = 1 to 1
{_stage}34@[_par] = 1
end
{_pointx[1]}80@ = 2372.91
{_pointy[1]}97@ = -1658.93
{_pointz[1]}114@ = 13.38
{_speed[1]}131@ = 100.0
{_type[1]}148@ = 3
{_pointx[2]}81@ = 2342.61
{_pointy[2]}98@ = -1580.44
{_pointz[2]}115@ = 23.76
{_speed[2]}132@ = 50.0
{_type[2]}149@ = 3
{_pointx[3]}82@ = 2342.81
{_pointy[3]}99@ = -1538.50
{_pointz[3]}116@ = 23.84
{_speed[3]}133@ = 100.0
{_type[3]}150@ = 3
{_pointx[4]}83@ = 2228.25
{_pointy[4]}100@ = -1484.19
{_pointz[4]}117@ = 23.23
{_speed[4]}134@ = 100.0
{_type[4]}151@ = 3
{_pointx[5]}84@ = 2212.02
{_pointy[5]}101@ = -1398.15
{_pointz[5]}118@ = 23.34
{_speed[5]}135@ = 100.0
{_type[5]}152@ = 3
{_pointx[6]}85@ = 2068.81
{_pointy[6]}102@ = -1278.58
{_pointz[6]}119@ = 23.34
{_speed[6]}136@ = 100.0
{_type[6]}153@ = 3
{_pointx[7]}86@ = 1792.85
{_pointy[7]}103@ = -1273.45
{_pointz[7]}120@ = 12.98
{_speed[7]}137@ = 100.0
{_type[7]}154@ = 3
{_pointx[8]}87@ = 1792.85
{_pointy[8]}104@ = -1273.45
{_pointz[8]}121@ = 12.98
{_speed[8]}138@ = 50.0
{_type[8]}155@ = 3
{_pointx[9]}88@ = 1715.13
{_pointy[9]}105@ = -1417.16
{_pointz[9]}122@ = 12.90
{_speed[9]}139@ = 100.0
{_type[9]}156@ = 3
{_carx[1]}55@ = 2457.08
{_cary[1]}60@ = -1656.42
{_carz[1]}65@ = 13.30
{_angle[1]}70@ = 90.0
{_paintjob[1]}75@ = 0
{_model[1]}40@ = #ELEGY
{_components[1]}165@ = 7
{_component1[1]}174@ = #WG_L_A_L
{_component2[1]}183@ = #EXH_C_L
{_component3[1]}192@ = #RF_C_L
{_component4[1]}201@ = #SPL_C_L_B
{_component5[1]}210@ = #RBMP_C_L
{_component6[1]}219@ = #FBMP_C_L
{_component7[1]}228@ = #WG_L_C_L
for _par = 1 to 1
{_model}39@[_par].Load
end
06E9: request_car_component {_component1[1]}174@
06E9: request_car_component {_component2[1]}183@
06E9: request_car_component {_component3[1]}192@
06E9: request_car_component {_component4[1]}201@
06E9: request_car_component {_component5[1]}210@
06E9: request_car_component {_component6[1]}219@
06E9: request_car_component {_component7[1]}228@
wait 1000 ms
:Lap_Example_111
wait 0 ms
for _par = 1 to 1
{_model}39@[_par].Available
jf @Lap_Example_111
end
if and
06EA: car_component {_component1[1]}174@ available
06EA: car_component {_component2[1]}183@ available
06EA: car_component {_component3[1]}192@ available
06EA: car_component {_component4[1]}201@ available
06EA: car_component {_component5[1]}210@ available
06EA: car_component {_component6[1]}219@ available
06EA: car_component {_component7[1]}228@ available
jf @Lap_Example_111
01EB: set_traffic_density_to 0.0
0395: clear_area 1 at {_carx[1]}55@ {_cary[1]}60@ {_carz[1]}65@ range 300.0
for _par = 1 to 1
{_car}17@[_par] = Car.Create({_model}39@[_par], {_carx}54@[_par], {_cary}59@[_par], {_carz}64@[_par])
Car.Angle({_car}17@[_par]) = {_angle}69@[_par]
// Car.SetImmunities($car[$par], 1, 1, 1, 1, 1)
07EE: car {_car}17@[_par] enable_tire_marks 1
Car.DoorStatus({_car}17@[_par]) = 2
if {_components}164@[_par] >= 1
then
06E7: _cmpnent = add_car_component {_component1}173@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 2
then
06E7: _cmpnent2 = add_car_component {_component2}182@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 3
then
06E7: _cmpnent3 = add_car_component {_component3}191@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 4
then
06E7: _cmpnent4 = add_car_component {_component4}200@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 5
then
06E7: _cmpnent5 = add_car_component {_component5}209@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 6
then
06E7: _cmpnent6 = add_car_component {_component6}218@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 7
then
06E7: _cmpnent7 = add_car_component {_component7}227@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 8
then
06E7: _cmpnent8 = add_car_component {_component8}236@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 9
then
06E7: _cmpnent9 = add_car_component {_component9}245@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 10
then
06E7: _cmpnent10 = add_car_component {_component10}254@[_par] to_car {_car}17@[_par]
end
end
end
end
end
end
end
end
end
end
if {_paintjob}74@[_par] <> -1
then
06ED: set_car {_car}17@[_par] paintjob {_paintjob}74@[_par]
end
end
036A: put_actor $PLAYER_ACTOR in_vehicle {_car[1]}18@
0407: create_coordinate _camx _camy _camz from_car {_car[1]}18@ offset 0.0 -23.7 14.1
Camera.SetPosition(_camx, _camy, _camz, 0.0, 0.0, 0.0)
Camera.OnVehicle({_car[1]}18@, 15, 1)
Player.CanMove($PLAYER_CHAR) = False
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
03F4: set_all_vehicles_apply_damage_rules 0
wait 2500 ms
fade 1 (out) 1000 ms
wait 1000 ms
00BA: text_styled 'RACES_4' 1100 ms 4 // 3
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate _camx2 _camy2 _camz2 from_car {_car[1]}18@ offset 0.0 -13.7 7.1
Camera.SetPosition(_camx2, _camy2, _camz2, 0.0, 0.0, 0.0)
Camera.OnVehicle({_car[1]}18@, 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_5' 1100 ms 4 // 2
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate _camx3 _camy3 _camz3 from_car {_car[1]}18@ offset 0.0 -6.7 3.1
Camera.SetPosition(_camx3, _camy3, _camz3, 0.0, 0.0, 0.0)
Camera.OnVehicle({_car[1]}18@, 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_6' 1100 ms 4 // 1
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
00BA: text_styled 'RACES_7' 800 ms 4 // GO!
097A: at 0.0 0.0 0.0 play_sound 1057
01BD: 11@ = current_time_in_ms
Player.CanMove($PLAYER_CHAR) = True
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
03F4: set_all_vehicles_apply_damage_rules 1
01EB: set_traffic_density_to 0.0
Camera.SetBehindPlayer
Camera.Restore
//03C3: set_timer_with_text_to $time type 1 text 'TIMER' // TIME
14@ = car.Health(PLAYER_CAR)//
for _kar = 1 to 9
_nar = _kar // integer values
_nar += 1 // integer values
018A: _chekp = create_checkpoint_at {_pointx}79@[_kar] {_pointy}96@[_kar] {_pointz}113@[_kar]
0168: show_on_radar _chekp 4
if
_kar == 9 // integer values
then
1@ = 1
Marker.SetColor(_chekp, 0)
end
06D5: _rchekp = create_racing_checkpoint_at {_pointx}79@[_kar] {_pointy}96@[_kar] {_pointz}113@[_kar] point_to {_pointx}79@[_nar] {_pointy}96@[_nar] {_pointz}113@[_nar] type 1@ radius 6.0
while 8100: not actor $PLAYER_ACTOR near_point_in_vehicle {_pointx}79@[_kar] {_pointy}96@[_kar] {_pointz}113@[_kar] radius 12.0 12.0 12.0 sphere 0
// if
// $time <= 0
// then
// jump @Lap_Example_2497
// end
gosub @drift//
03F0: toggle_text_draw 1//
033F: set_text_draw_letter_size 0.7 0.933//
0340: set_text_draw_RGBA 255 255 255 255//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 2//
060D: draw_text_shadow 1 color_RGBA 0 0 0 255//
045A: draw_text_1number 130.0 415.0 GXT 'NUMBER' number DRIFTING_ANGLE//
08DA: remove_panel 16@//
08D4: 16@ = create_panel_with_title 'DRIFT' position 29.0 30.0 width 35.0 columns 2 interactive 0 background 1 alignment 1//
09DB: set_panel 16@ column 0 width 120//
08DB: set_panel 16@ column 0 header 'DUMMY' data 'DRIFTHI' 'DRIFYOU' 'DUMMY' 'DRIFBON' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08DB: set_panel 16@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08EE: set_panel 16@ column 1 row 0 text_1number GXT 'NUMBER' number _hiscore//
08EE: set_panel 16@ column 1 row 1 text_1number GXT 'NUMBER' number _score//
08EE: set_panel 16@ column 1 row 3 text_1number GXT 'DRIFBNN' number BONUS//
if TEMP_SCORE > 0//
then//
033F: set_text_draw_letter_size 1.3 1.7//
0340: set_text_draw_RGBA 217 222 12 150//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 3//
060D: draw_text_shadow 0 color_RGBA 0 0 0 125//
0912: unknown_text_draw_flag 1 height 355 width 370//
0342: toggle_text_draw_centered 1//
045A: draw_text_1number 280.0 100.0 GXT 'NUMBER' number TEMP_SCORE//
end//
if and
_pos = 1 // integer values
not Actor.InCar($PLAYER_ACTOR, {_car[1]}18@)
then
jump @Lap_Example_2497
end
if or
Car.Wrecked({_car[1]}18@)
02BF: car {_car[1]}18@ sunk
then
jump @Lap_Example_2497
end
// wait 0 ms
end
Marker.Disable(_chekp)
06D6: delete_racing_checkpoint _rchekp
097A: at 0.0 0.0 0.0 play_sound 1058
end
jump @Lap_Example_2491
:Lap_Example_2491
gosub @Lap_Example_REMOVE
if
// $pos2 == 1
002c: _score >= _hiscore//
then
_DRIFT_MISSION_PASSED = 1//
0084: _hiscore = _score//
_score = 0//
00BA: text_styled 'RACES18' 3000 ms 1 // Winner!
wait 3000 ms
01E3: text_1number_styled 'M_PASS' 3000 4000 ms 1 // MISSION PASSED!~n~~w~$~1~
Player.Money($PLAYER_CHAR) += 3000
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
0394: play_music 1
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
else
01E3: text_1number_styled 'RACES_8' 200 5000 ms 1 // Loser!
0A92: create_custom_thread "DriftStarter.cs"
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
end
0318: set_latest_mission_passed_to 'RACES_0'
Player.ClearWantedLevel($PLAYER_CHAR)
0A92: create_custom_thread "DriftStarter.cs"
gosub @Lap_Example_38
return
:Lap_Example_2497
gosub @Lap_Example_REMOVE
00BA: text_styled 'RACES_8' 5000 ms 1 // Loser!
0A92: create_custom_thread "DriftStarter.cs"
return
:Lap_Example_REMOVE
01EB: set_traffic_density_to 1.0
Car.DoorStatus({_car[1]}18@) = 0
for _par = 1 to 1
if
{_car}17@[_par] <> -1
then
Car.SetImmunities({_car}17@[_par], 0, 0, 0, 0, 0)
Model.Destroy({_model}39@[_par])
Car.RemoveReferences({_car}17@[_par])
if
_par <> 1
then
Marker.Disable({_mark}49@[_par])
Actor.RemoveReferences({_act}44@[_par])
end
end
end
06EB: release_car_component {_component1[1]}174@
06EB: release_car_component {_component2[1]}183@
06EB: release_car_component {_component3[1]}192@
06EB: release_car_component {_component4[1]}201@
06EB: release_car_component {_component5[1]}210@
06EB: release_car_component {_component6[1]}219@
06EB: release_car_component {_component7[1]}228@
Marker.Disable(_chekp)
06D6: delete_racing_checkpoint _rchekp
03F0: toggle_text_draw 0
014F: delete_timer _time
01B7: release_weather
00BE: text_clear_all//
_score += TEMP_SCORE//
08DA: remove_panel 16@//
return
:Lap_Example_2762
$ONMISSION = 0 // integer values
mission_cleanup
return
{Все последующие строки - мой код.
Их тоже необходимо вставлять в файл.}
:drift
//wait 0
11@ = TEMP_SCORE
gosub @drifted
if
TEMP_SCORE > 11@
then
12@ = 0
13@ = 0
else
if 12@ == 0
then
01BD: 12@ = current_time_in_ms
end
if
13@ <= 2000
then
01BD: 13@ = current_time_in_ms
13@ -= 12@
else
_score += TEMP_SCORE
TEMP_SCORE = 0
12@ = 0
13@ = 0
end
end
CAR_HEALTH = car.Health(PLAYER_CAR)
if
CAR_HEALTH < 14@
then
TEMP_SCORE = 0
12@ = 0
13@ = 0
14@ = CAR_HEALTH
//0A30: repair_car PLAYER_CAR //раскомментируйте эти строки, если необходимо установить на авто иммунитеты //
//14@ = car.Health(PLAYER_CAR) //
00BE: text_clear_all
wait 2000
end
return
:drifted
car.StorePos(PLAYER_CAR,1@,2@,3@)
wait 0
car.StorePos(PLAYER_CAR,3@,4@,5@)
3@ -= 1@
4@ -= 2@
02F8: get_car PLAYER_CAR Z_angle_cosine_to 5@
02F9: get_car PLAYER_CAR Z_angle_sine_to 6@
05A4: get_angle_between_vectors_origin_to 5@ 6@ and_origin_to 3@ 4@ store_to 5@
0087: DRIFTING_ANGLE = 5@
0092: DRIFTING_ANGLE = float DRIFTING_ANGLE to_integer
02E3: CAR_SPEED = car PLAYER_CAR speed
if and
CAR_SPEED >= SPEED_LIMIT
81F4: not car PLAYER_CAR flipped
8119: not car PLAYER_CAR wrecked
82BF: not car PLAYER_CAR sunk
81F3: not car PLAYER_CAR in_air
then
BONUS = 1
if CAR_SPEED >= 19.0
then
BONUS = 2
end
if CAR_SPEED >= 31.0
then
BONUS = 3
end
if CAR_SPEED >= 46.0
then
BONUS = 4
end
if CAR_SPEED >= 63.0
then
BONUS = 5
end
if and
TEMP_SCORE >=50
TEMP_SCORE <150
then
BONUS *= 2
end
if and
TEMP_SCORE >=150
TEMP_SCORE <500
then
BONUS *= 3
end
if and
TEMP_SCORE >=500
TEMP_SCORE <1000
then
BONUS *= 4
end
if TEMP_SCORE >=1000
then
BONUS *= 5
end
if and
5@ >= DRIFT_ANGLE
5@ <= 90.0
then inc(TEMP_SCORE,BONUS)
end
end
return
Стартер:const
_car = 17@
_score = 0@
_nar = 22@
_tar = 23@
_time = $1797
_dist = 25@
_dist2 = 26@
_pos = 27@
_pos2 = 28@
_stage = 34@
_model = 39@
_act = 44@
_mark = 49@
_carx = 54@
_cary = 59@
_carz = 64@
_angle = 69@
_paintjob = 74@
_pointx = 79@
_pointy = 96@
_pointz = 113@
_speed = 130@
_type = 147@
_components = 164@
_component1 = 173@
_component2 = 182@
_component3 = 191@
_component4 = 200@
_component5 = 209@
_component6 = 218@
_component7 = 227@
_component8 = 236@
_component9 = 245@
_component10 = 254@
_par = 29@
_cmpnent = 30@
_cmpnent2 = 31@
_cmpnent3 = 263@
_cmpnent4 = 264@
_cmpnent5 = 265@
_cmpnent6 = 266@
_cmpnent7 = 267@
_cmpnent8 = 268@
_cmpnent9 = 269@
_cmpnent10 = 270@
_camx = 271@
_camy = 272@
_camz = 273@
_camx2 = 274@
_camy2 = 275@
_camz2 = 276@
_camx3 = 277@
_camy3 = 278@
_camz3 = 279@
_kar = 280@
_chekp = 281@
_rchekp = 282@
_hiscore = 283@
_DRIFT_MISSION_PASSED = 284@
end
//-------------Mission 0---------------
:Lap_Example_000
thread 'EXAMPL1'
gosub @Lap_Example_47
wasted_or_busted
jf @Lap_Example_38
gosub @Lap_Example_2497
:Lap_Example_38
gosub @Lap_Example_2762
end_thread
:Lap_Example_47
increment_mission_attempts
$ONMISSION = 1
Player.ClearWantedLevel($PLAYER_CHAR)
00BE: text_clear_all
{Мои переменные и константы}
const//
PLAYER_CAR = {_car[1]}18@//
TEMP_SCORE = 8@//
BONUS = 9@//
DRIFT_ANGLE = 15.0//
CAR_HEALTH = 10@//
CAR_SPEED = 7@//
SPEED_LIMIT = 10.0//
DRIFTING_ANGLE = 15@//
end//
var//
1@:float//
2@:float//
3@:float//
4@:float//
5@:float//
6@:float//
7@:float//
8@:int//
9@:int//
10@:int//
11@:int//
12@:int//
13@:int//
14@:int//
15@:int//
_score:int//
end//
var
_nar : Integer
_tar : Integer
_time : Integer = 1000
_dist : Float
_dist2 : Float
_pos : Integer = 1
_pos2 : Integer = 1
_stage : Array 5 of Integer
_car : Array 5 of Car
_model : Array 5 of Model
_act : Array 5 of Actor
_mark : Array 5 of Marker
_carx : Array 5 of Float
_cary : Array 5 of Float
_carz : Array 5 of Float
_angle : Array 5 of Float
_paintjob : Array 5 of Integer
_pointx : Array 17 of Float
_pointy : Array 17 of Float
_pointz : Array 17 of Float
_speed : Array 17 of Float
_type : Array 17 of Integer
_components : Array 9 of Model
_component1 : Array 9 of Model
_component2 : Array 9 of Model
_component3 : Array 9 of Model
_component4 : Array 9 of Model
_component5 : Array 9 of Model
_component6 : Array 9 of Model
_component7 : Array 9 of Model
_component8 : Array 9 of Model
_component9 : Array 9 of Model
_component10 : Array 9 of Model
end
for _par = 1 to 1
{_stage}34@[_par] = 1
end
{_pointx[1]}80@ = 2372.91
{_pointy[1]}97@ = -1658.93
{_pointz[1]}114@ = 13.38
{_speed[1]}131@ = 100.0
{_type[1]}148@ = 3
{_pointx[2]}81@ = 2342.61
{_pointy[2]}98@ = -1580.44
{_pointz[2]}115@ = 23.76
{_speed[2]}132@ = 50.0
{_type[2]}149@ = 3
{_pointx[3]}82@ = 2342.81
{_pointy[3]}99@ = -1538.50
{_pointz[3]}116@ = 23.84
{_speed[3]}133@ = 100.0
{_type[3]}150@ = 3
{_pointx[4]}83@ = 2228.25
{_pointy[4]}100@ = -1484.19
{_pointz[4]}117@ = 23.23
{_speed[4]}134@ = 100.0
{_type[4]}151@ = 3
{_pointx[5]}84@ = 2212.02
{_pointy[5]}101@ = -1398.15
{_pointz[5]}118@ = 23.34
{_speed[5]}135@ = 100.0
{_type[5]}152@ = 3
{_pointx[6]}85@ = 2068.81
{_pointy[6]}102@ = -1278.58
{_pointz[6]}119@ = 23.34
{_speed[6]}136@ = 100.0
{_type[6]}153@ = 3
{_pointx[7]}86@ = 1792.85
{_pointy[7]}103@ = -1273.45
{_pointz[7]}120@ = 12.98
{_speed[7]}137@ = 100.0
{_type[7]}154@ = 3
{_pointx[8]}87@ = 1792.85
{_pointy[8]}104@ = -1273.45
{_pointz[8]}121@ = 12.98
{_speed[8]}138@ = 50.0
{_type[8]}155@ = 3
{_pointx[9]}88@ = 1715.13
{_pointy[9]}105@ = -1417.16
{_pointz[9]}122@ = 12.90
{_speed[9]}139@ = 100.0
{_type[9]}156@ = 3
{_carx[1]}55@ = 2457.08
{_cary[1]}60@ = -1656.42
{_carz[1]}65@ = 13.30
{_angle[1]}70@ = 90.0
{_paintjob[1]}75@ = 0
{_model[1]}40@ = #ELEGY
{_components[1]}165@ = 7
{_component1[1]}174@ = #WG_L_A_L
{_component2[1]}183@ = #EXH_C_L
{_component3[1]}192@ = #RF_C_L
{_component4[1]}201@ = #SPL_C_L_B
{_component5[1]}210@ = #RBMP_C_L
{_component6[1]}219@ = #FBMP_C_L
{_component7[1]}228@ = #WG_L_C_L
for _par = 1 to 1
{_model}39@[_par].Load
end
06E9: request_car_component {_component1[1]}174@
06E9: request_car_component {_component2[1]}183@
06E9: request_car_component {_component3[1]}192@
06E9: request_car_component {_component4[1]}201@
06E9: request_car_component {_component5[1]}210@
06E9: request_car_component {_component6[1]}219@
06E9: request_car_component {_component7[1]}228@
wait 1000 ms
:Lap_Example_111
wait 0 ms
for _par = 1 to 1
{_model}39@[_par].Available
jf @Lap_Example_111
end
if and
06EA: car_component {_component1[1]}174@ available
06EA: car_component {_component2[1]}183@ available
06EA: car_component {_component3[1]}192@ available
06EA: car_component {_component4[1]}201@ available
06EA: car_component {_component5[1]}210@ available
06EA: car_component {_component6[1]}219@ available
06EA: car_component {_component7[1]}228@ available
jf @Lap_Example_111
01EB: set_traffic_density_to 0.0
0395: clear_area 1 at {_carx[1]}55@ {_cary[1]}60@ {_carz[1]}65@ range 300.0
for _par = 1 to 1
{_car}17@[_par] = Car.Create({_model}39@[_par], {_carx}54@[_par], {_cary}59@[_par], {_carz}64@[_par])
Car.Angle({_car}17@[_par]) = {_angle}69@[_par]
// Car.SetImmunities($car[$par], 1, 1, 1, 1, 1)
07EE: car {_car}17@[_par] enable_tire_marks 1
Car.DoorStatus({_car}17@[_par]) = 2
if {_components}164@[_par] >= 1
then
06E7: _cmpnent = add_car_component {_component1}173@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 2
then
06E7: _cmpnent2 = add_car_component {_component2}182@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 3
then
06E7: _cmpnent3 = add_car_component {_component3}191@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 4
then
06E7: _cmpnent4 = add_car_component {_component4}200@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 5
then
06E7: _cmpnent5 = add_car_component {_component5}209@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 6
then
06E7: _cmpnent6 = add_car_component {_component6}218@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 7
then
06E7: _cmpnent7 = add_car_component {_component7}227@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 8
then
06E7: _cmpnent8 = add_car_component {_component8}236@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 9
then
06E7: _cmpnent9 = add_car_component {_component9}245@[_par] to_car {_car}17@[_par]
if {_components}164@[_par] >= 10
then
06E7: _cmpnent10 = add_car_component {_component10}254@[_par] to_car {_car}17@[_par]
end
end
end
end
end
end
end
end
end
end
if {_paintjob}74@[_par] <> -1
then
06ED: set_car {_car}17@[_par] paintjob {_paintjob}74@[_par]
end
end
036A: put_actor $PLAYER_ACTOR in_vehicle {_car[1]}18@
0407: create_coordinate _camx _camy _camz from_car {_car[1]}18@ offset 0.0 -23.7 14.1
Camera.SetPosition(_camx, _camy, _camz, 0.0, 0.0, 0.0)
Camera.OnVehicle({_car[1]}18@, 15, 1)
Player.CanMove($PLAYER_CHAR) = False
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
03F4: set_all_vehicles_apply_damage_rules 0
wait 2500 ms
fade 1 (out) 1000 ms
wait 1000 ms
00BA: text_styled 'RACES_4' 1100 ms 4 // 3
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate _camx2 _camy2 _camz2 from_car {_car[1]}18@ offset 0.0 -13.7 7.1
Camera.SetPosition(_camx2, _camy2, _camz2, 0.0, 0.0, 0.0)
Camera.OnVehicle({_car[1]}18@, 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_5' 1100 ms 4 // 2
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate _camx3 _camy3 _camz3 from_car {_car[1]}18@ offset 0.0 -6.7 3.1
Camera.SetPosition(_camx3, _camy3, _camz3, 0.0, 0.0, 0.0)
Camera.OnVehicle({_car[1]}18@, 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_6' 1100 ms 4 // 1
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
00BA: text_styled 'RACES_7' 800 ms 4 // GO!
097A: at 0.0 0.0 0.0 play_sound 1057
01BD: 11@ = current_time_in_ms
Player.CanMove($PLAYER_CHAR) = True
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
03F4: set_all_vehicles_apply_damage_rules 1
01EB: set_traffic_density_to 0.0
Camera.SetBehindPlayer
Camera.Restore
//03C3: set_timer_with_text_to $time type 1 text 'TIMER' // TIME
14@ = car.Health(PLAYER_CAR)//
for _kar = 1 to 9
_nar = _kar // integer values
_nar += 1 // integer values
018A: _chekp = create_checkpoint_at {_pointx}79@[_kar] {_pointy}96@[_kar] {_pointz}113@[_kar]
0168: show_on_radar _chekp 4
if
_kar == 9 // integer values
then
1@ = 1
Marker.SetColor(_chekp, 0)
end
06D5: _rchekp = create_racing_checkpoint_at {_pointx}79@[_kar] {_pointy}96@[_kar] {_pointz}113@[_kar] point_to {_pointx}79@[_nar] {_pointy}96@[_nar] {_pointz}113@[_nar] type 1@ radius 6.0
while 8100: not actor $PLAYER_ACTOR near_point_in_vehicle {_pointx}79@[_kar] {_pointy}96@[_kar] {_pointz}113@[_kar] radius 12.0 12.0 12.0 sphere 0
// if
// $time <= 0
// then
// jump @Lap_Example_2497
// end
gosub @drift//
03F0: toggle_text_draw 1//
033F: set_text_draw_letter_size 0.7 0.933//
0340: set_text_draw_RGBA 255 255 255 255//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 2//
060D: draw_text_shadow 1 color_RGBA 0 0 0 255//
045A: draw_text_1number 130.0 415.0 GXT 'NUMBER' number DRIFTING_ANGLE//
08DA: remove_panel 16@//
08D4: 16@ = create_panel_with_title 'DRIFT' position 29.0 30.0 width 35.0 columns 2 interactive 0 background 1 alignment 1//
09DB: set_panel 16@ column 0 width 120//
08DB: set_panel 16@ column 0 header 'DUMMY' data 'DRIFTHI' 'DRIFYOU' 'DUMMY' 'DRIFBON' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08DB: set_panel 16@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08EE: set_panel 16@ column 1 row 0 text_1number GXT 'NUMBER' number _hiscore//
08EE: set_panel 16@ column 1 row 1 text_1number GXT 'NUMBER' number _score//
08EE: set_panel 16@ column 1 row 3 text_1number GXT 'DRIFBNN' number BONUS//
if TEMP_SCORE > 0//
then//
033F: set_text_draw_letter_size 1.3 1.7//
0340: set_text_draw_RGBA 217 222 12 150//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 3//
060D: draw_text_shadow 0 color_RGBA 0 0 0 125//
0912: unknown_text_draw_flag 1 height 355 width 370//
0342: toggle_text_draw_centered 1//
045A: draw_text_1number 280.0 100.0 GXT 'NUMBER' number TEMP_SCORE//
end//
if and
_pos = 1 // integer values
not Actor.InCar($PLAYER_ACTOR, {_car[1]}18@)
then
jump @Lap_Example_2497
end
if or
Car.Wrecked({_car[1]}18@)
02BF: car {_car[1]}18@ sunk
then
jump @Lap_Example_2497
end
// wait 0 ms
end
Marker.Disable(_chekp)
06D6: delete_racing_checkpoint _rchekp
097A: at 0.0 0.0 0.0 play_sound 1058
end
jump @Lap_Example_2491
:Lap_Example_2491
gosub @Lap_Example_REMOVE
if
// $pos2 == 1
002c: _score >= _hiscore//
then
_DRIFT_MISSION_PASSED = 1//
0084: _hiscore = _score//
_score = 0//
00BA: text_styled 'RACES18' 3000 ms 1 // Winner!
wait 3000 ms
01E3: text_1number_styled 'M_PASS' 3000 4000 ms 1 // MISSION PASSED!~n~~w~$~1~
Player.Money($PLAYER_CHAR) += 3000
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
0394: play_music 1
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
else
01E3: text_1number_styled 'RACES_8' 200 5000 ms 1 // Loser!
0A92: create_custom_thread "DriftStarter.cs"
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
end
0318: set_latest_mission_passed_to 'RACES_0'
Player.ClearWantedLevel($PLAYER_CHAR)
0A92: create_custom_thread "DriftStarter.cs"
gosub @Lap_Example_38
return
:Lap_Example_2497
gosub @Lap_Example_REMOVE
00BA: text_styled 'RACES_8' 5000 ms 1 // Loser!
0A92: create_custom_thread "DriftStarter.cs"
return
:Lap_Example_REMOVE
01EB: set_traffic_density_to 1.0
Car.DoorStatus({_car[1]}18@) = 0
for _par = 1 to 1
if
{_car}17@[_par] <> -1
then
Car.SetImmunities({_car}17@[_par], 0, 0, 0, 0, 0)
Model.Destroy({_model}39@[_par])
Car.RemoveReferences({_car}17@[_par])
if
_par <> 1
then
Marker.Disable({_mark}49@[_par])
Actor.RemoveReferences({_act}44@[_par])
end
end
end
06EB: release_car_component {_component1[1]}174@
06EB: release_car_component {_component2[1]}183@
06EB: release_car_component {_component3[1]}192@
06EB: release_car_component {_component4[1]}201@
06EB: release_car_component {_component5[1]}210@
06EB: release_car_component {_component6[1]}219@
06EB: release_car_component {_component7[1]}228@
Marker.Disable(_chekp)
06D6: delete_racing_checkpoint _rchekp
03F0: toggle_text_draw 0
014F: delete_timer _time
01B7: release_weather
00BE: text_clear_all//
_score += TEMP_SCORE//
08DA: remove_panel 16@//
return
:Lap_Example_2762
$ONMISSION = 0 // integer values
mission_cleanup
return
{Все последующие строки - мой код.
Их тоже необходимо вставлять в файл.}
:drift
//wait 0
11@ = TEMP_SCORE
gosub @drifted
if
TEMP_SCORE > 11@
then
12@ = 0
13@ = 0
else
if 12@ == 0
then
01BD: 12@ = current_time_in_ms
end
if
13@ <= 2000
then
01BD: 13@ = current_time_in_ms
13@ -= 12@
else
_score += TEMP_SCORE
TEMP_SCORE = 0
12@ = 0
13@ = 0
end
end
CAR_HEALTH = car.Health(PLAYER_CAR)
if
CAR_HEALTH < 14@
then
TEMP_SCORE = 0
12@ = 0
13@ = 0
14@ = CAR_HEALTH
//0A30: repair_car PLAYER_CAR //раскомментируйте эти строки, если необходимо установить на авто иммунитеты //
//14@ = car.Health(PLAYER_CAR) //
00BE: text_clear_all
wait 2000
end
return
:drifted
car.StorePos(PLAYER_CAR,1@,2@,3@)
wait 0
car.StorePos(PLAYER_CAR,3@,4@,5@)
3@ -= 1@
4@ -= 2@
02F8: get_car PLAYER_CAR Z_angle_cosine_to 5@
02F9: get_car PLAYER_CAR Z_angle_sine_to 6@
05A4: get_angle_between_vectors_origin_to 5@ 6@ and_origin_to 3@ 4@ store_to 5@
0087: DRIFTING_ANGLE = 5@
0092: DRIFTING_ANGLE = float DRIFTING_ANGLE to_integer
02E3: CAR_SPEED = car PLAYER_CAR speed
if and
CAR_SPEED >= SPEED_LIMIT
81F4: not car PLAYER_CAR flipped
8119: not car PLAYER_CAR wrecked
82BF: not car PLAYER_CAR sunk
81F3: not car PLAYER_CAR in_air
then
BONUS = 1
if CAR_SPEED >= 19.0
then
BONUS = 2
end
if CAR_SPEED >= 31.0
then
BONUS = 3
end
if CAR_SPEED >= 46.0
then
BONUS = 4
end
if CAR_SPEED >= 63.0
then
BONUS = 5
end
if and
TEMP_SCORE >=50
TEMP_SCORE <150
then
BONUS *= 2
end
if and
TEMP_SCORE >=150
TEMP_SCORE <500
then
BONUS *= 3
end
if and
TEMP_SCORE >=500
TEMP_SCORE <1000
then
BONUS *= 4
end
if TEMP_SCORE >=1000
then
BONUS *= 5
end
if and
5@ >= DRIFT_ANGLE
5@ <= 90.0
then inc(TEMP_SCORE,BONUS)
end
end
return
{$CLEO}
const
_Lap_Example_XCoord = 0@
_Lap_Example_YCoord = 1@
_Lap_Example_ZCoord = 2@
_Lap_Example_Marker = 3@
_11192 = 4@
_DRIFT_MISSION_PASSED = 5@
_hiscore = 6@
end
:Lap_Example
_Lap_Example_XCoord = 2480.55
_Lap_Example_YCoord = -1666.06
_Lap_Example_ZCoord = 13.34
_Lap_Example_Marker = Marker.CreateIconAndSphere(53, _Lap_Example_XCoord, _Lap_Example_YCoord, _Lap_Example_ZCoord)
:Lap_Example_1349
wait 25 ms
Player.Defined($PLAYER_CHAR)
jf @Lap_Example_1349
0101: actor $PLAYER_ACTOR stopped_near_point _Lap_Example_XCoord _Lap_Example_YCoord _Lap_Example_ZCoord radius 3.0 3.0 3.0 sphere 0
jf @Lap_Example_1349
Player.Controllable($PLAYER_CHAR)
jf @Lap_Example_1349
$ONMISSION == 0 // integer values
jf @Lap_Example_1349
Marker.Disable(_11192)
054C: use_GXT_table 'RACETOR'
00BA: text_styled 'RACES_0' 1500 ms 2
0169: set_fade_color 0 0 0
fade 0 (in) 2500 ms
:Lap_Example_1492
wait 0 ms
not fading
jf @Lap_Example_1492
Marker.Disable(_11192)
00BE: text_clear_all
03E6: remove_text_box
if _DRIFT_MISSION_PASSED == 0//
then _hiscore = 150// Начальное кол-во очков, необходимых для победы //
end//
0A94: start_custom_mission "DriftMission"
0A93: end_custom_thread
А главное, всё работает! Миссия запускается, проходится. Правда, не сохраняется максимальные очки, но это решается вставкой пары строк (opcs [c]0AB3[/c] и [c]0AB4[/c]).const
_Lap_Example_XCoord = 0@
_Lap_Example_YCoord = 1@
_Lap_Example_ZCoord = 2@
_Lap_Example_Marker = 3@
_11192 = 4@
_DRIFT_MISSION_PASSED = 5@
_hiscore = 6@
end
:Lap_Example
_Lap_Example_XCoord = 2480.55
_Lap_Example_YCoord = -1666.06
_Lap_Example_ZCoord = 13.34
_Lap_Example_Marker = Marker.CreateIconAndSphere(53, _Lap_Example_XCoord, _Lap_Example_YCoord, _Lap_Example_ZCoord)
:Lap_Example_1349
wait 25 ms
Player.Defined($PLAYER_CHAR)
jf @Lap_Example_1349
0101: actor $PLAYER_ACTOR stopped_near_point _Lap_Example_XCoord _Lap_Example_YCoord _Lap_Example_ZCoord radius 3.0 3.0 3.0 sphere 0
jf @Lap_Example_1349
Player.Controllable($PLAYER_CHAR)
jf @Lap_Example_1349
$ONMISSION == 0 // integer values
jf @Lap_Example_1349
Marker.Disable(_11192)
054C: use_GXT_table 'RACETOR'
00BA: text_styled 'RACES_0' 1500 ms 2
0169: set_fade_color 0 0 0
fade 0 (in) 2500 ms
:Lap_Example_1492
wait 0 ms
not fading
jf @Lap_Example_1492
Marker.Disable(_11192)
00BE: text_clear_all
03E6: remove_text_box
if _DRIFT_MISSION_PASSED == 0//
then _hiscore = 150// Начальное кол-во очков, необходимых для победы //
end//
0A94: start_custom_mission "DriftMission"
0A93: end_custom_thread
[---]
>>> Скачать программу <<<