Перейти к содержанию

Synthwave85

Members
  • Постов

    213
  • Зарегистрирован

  • Посещение

  • Победитель дней

    2

Весь контент Synthwave85

  1. Вот такие 4 последние ошибки вылезли. Вылетает чаще всего в Лос-Сантосе, в остальных районах работает стабильнее, хотя всякое бывает. Vehfuncs 1.4.1 beta, IVF 2.1.1. Архив gta3.img разделен на 3 части и чуть ли не половина машин, в том числе с IVF и VehFuncs, в дополнительном архиве (без AddSpecialCars работает стабильно). Что интересно, из оперативного транспорта с IVF только copcarlv, ranger, fbirancher (с мигалками ivf), barracks, swat, patriot. Ну и towtruck и 3 такси. Т.е. copbike и copcarla без IVF, правда они тоже в дополнительном архиве. Пробовал на "чистой" игре (весь транспорт и объекты ландшафта оригинальные, но скрипты и плагины есть), там работает с IVF и Vehfuncs. А вот когда на ту же чистую игру поставил остальные имеющиеся плагины, тоже вылетает.
  2. До сих пор имеются конфликты с IVF и VehFuncs. Убираешь оба этих плагина, AddSpecialCars работает нормально без вылетов. Стоит установить также или IVF 2.1.1, или Vehfuncs (а если оба - то тем более), вылет происходит даже при начале новой игры от силы через пару минут. Даже если просто ехать на велосипеде, Карл обычно даже до своего дома доехать не может. Заменено 90% транспорта, из дополнительного установлены 2 такси, 1 полицейская машина и с десяток ЖД-вагонов.
  3. Заметил, что в SA, с установленным SilentPatch, значение 4fff означает обязательное появление 1 из 6, а не из 5 экстр. Но если экстр меньше 6, то будет появляться и "безэкстренный" вариант машины.
  4. Вопрос на тему возможного дополнения. Реально ли, чтобы на парковках полицейских участков также были припаркованы дополнительные полицейские машины, а если в SpecialCars.dat в каком-либо городе дефолтный ID исключен, а прописаны только дополнительные, то и припаркованы соответственно были только дополнительные? Аналогично хотелось бы и с припаркованными скорыми и пожарками возле больниц и пожарных частей.
  5. Про такси: 1. Можно ли сделать, чтобы при выключении миссии таксиста желтый фонарик на крыше выключался? 2. Можно ли сделать, чтобы у такси в трафике фонарик был включен, если в машине кроме водителя есть пассажиры? Возможно, при отсутствии пассажиров чтобы также попадались и с включенными (типа свободен, в поиске заказа), и с выключенными (например, едет в гараж). Ну и наверное это не к этому скрипту, но была когда-то тема про оживление оранжевых маячков у towtruck, sweeper и т.д. как в трафике, так и с возможностью включения/выключения их игроком. Реально? Только там остальной транспорт не должен уступать им дорогу, они просто сигнальные.
  6. А никак не получится разделить область применения полицейского внедорожника Ranger на собственно сельскую местность и шоссе? Просто очень напрашивается полицейская машина Highway Patrol, но непонятно куда ее лучше прописывать.
  7. А сделать, чтобы было как в оригинальной игре, когда просто приходишь на автобазу RS-Haul, становишься пешком в маркер и тебе выдают машину (а вот ID тягачей и прицепов и их комбинаций прописать в конфиге), нереально?
  8. Уже проверил по всякому, оказывается конфликт с последними версиями Vehfuncs, которые 1.4 и 1.4.1. Без них работает с любыми модами, в том числе с разделенными архивами .img. Кто еще тестировал на разных ОС, как у кого с совместимостью с Vehfuncs? И еще вопрос на счет будущих версий, нельзя сделать возможность, чтобы в миссиях дальнобойщика могли выдавать тягачи с прицепами на дополнительных ID? А то тягачей интересных намного больше 3-х, а прицепов намного больше 4-х! Просто добавить их в трафик можно, но в миссиях дальнобойщика не выдают :(
  9. Только дошли руки попробовать... Просто поместил в папку игры файлы SA_AddSpecialCars.asi и SpecialCars.dat без никаких прописываний дополнительного транспорта и при попытке загрузить игру сразу вылет. Правда, Windows XP... Это нормальное явление?
  10. Сейчас уже есть немало моделей, адаптированных под Vehfuncs, у которых может быть люк на крыше в разных положениях, а также в качестве экстры присутствовать или отсутствовать крыша (например, Mercedes R129). Есть ли возможность, чтобы во время дождя они все спаунились с закрытыми люками и с крышей? Флаги в vehicles.ide тут бесполезны?
  11. Одно дело, когда машины 1992 и 1994 года (или даже 1995+) в одном кузове и отличаются совсем мелочами (как с Buick Roadmaster), другое дело, когда в 1994 был совсем другой новый кузов, которого на дорогах не могло быть даже в декабре 1992 как 1993 модельный год... Первое в принципе допустимо, второе - ну не знаю...
  12. Какая красота! Жалко, что для San Andreas, где под 1992 год они все были бы в тему, из этих машин сконвертировано меньше половины. А голубой Suburban на 0:22 - 0:24 - просто доработанная стандартная модель из игры?
  13. Удалось даже заставить Карла садиться в спальный вагон и ресторан, которые конвертировал Driver: Но поскольку там нет dummy для пассажирских мест, он просто висит в воздухе между этажами. И двери тоже открываются некрасиво. Поэтому, если Driver сам захочет, или кто-то еще сумеет (я не умею, пробовал открыть их в zmodeler и добавить дамми, но когда сохранил, то в игре получилась полная лажа - окна стали непрозрачные и цвет самого вагона темнее), было бы неплохо добавить для этих вагонов дамми пассажиров и адаптировать их двери под скрипт для степвэна. Кстати, немного изменил handling для Driver'овских локомотивов и вагонов, чтобы колеса на рельсах реалистичнее смотрелись, с оригинальными настройками немного в землю проваливались. Ну и чтобы Карл мог заходить в доп. пассажирские вагоны, у которых handling от грузовых. Впрочем, эти настройки рекомендую только со скриптом "новый алгоритм движения поездов", иначе Карл сможет по нажатию клавиши садиться в грузовую платформу. [spoiler=handling]FREIGHT 5500.0 65000.0 3.0 0.0 0.0 0.0 90 0.58 0.8 0.5 4 110.0 20.0 20.0 R D 03.17 0.40 0 30.0 1.4 0.06 0.0 0.45 0.20 0.55 0.0 0.45 0.20 5000 8 200 0 1 2 STREAK 5500.0 65000.0 3.0 0.0 0.0 0.0 90 0.58 0.8 0.5 4 110.0 20.0 20.0 R D 03.17 0.40 0 30.0 1.4 0.06 0.0 0.45 0.10 0.55 0.0 0.65 0.20 5000 8 200 0 1 2 FREIFLAT 5500.0 33187.9 1.0 0.0 0.0 0.0 90 0.58 0.8 0.5 4 110.0 20.0 20.0 R D 03.17 0.40 0 30.0 1.4 0.06 0.0 0.45 0.20 0.55 0.0 0.65 0.20 5000 8 200 0 1 21 CSTREAK 5500.0 33187.9 1.0 0.0 0.0 0.0 90 0.58 0.8 0.5 4 110.0 20.0 20.0 R D 03.17 0.40 0 30.0 1.4 0.06 0.0 0.45 0.10 0.55 0.0 0.65 0.20 5000 8 200 0 1 21
  14. Увы, этого сделать не удалось и не знаю как :( Еще, зайти в вагон и выйти из него можно только с правой по ходу движения стороны, слева Карл не хочет заходить и выходить :). Причем почему-то само так получилось, я специально не пытался. Но так даже лучше, зачем выходить на рельсы? [spoiler=код]// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013 {$CLEO .cs} //-------------MAIN--------------- thread "PASSASHIR" :PASSASHIR_1 wait 0 if Player.Defined($PLAYER_CHAR) else_jump @PASSASHIR_1 :PASSASHIR_2 0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected] wait 0 if and 056E: car [email protected] defined not actor.InCar($PLAYER_ACTOR,[email protected]) 0AB0: key_pressed 13 else_jump @PASSASHIR_2 wait 0 if Car.Model([email protected]) == #STREAKC else_jump @PASSASHIR_2 wait 0 if or 0431: car [email protected] passenger_seat_free 0 0431: car [email protected] passenger_seat_free 1 0431: car [email protected] passenger_seat_free 2 else_jump @PASSASHIR_2 05CA: AS_actor $PLAYER_ACTOR enter_car [email protected] passenger_seat -1 time 10000 jump @PASSASHIR_2 Если есть дополнительные вагоны на дополнительных ID, то после строчки Car.Model([email protected]) == #STREAKC пишем такую же, только вместо #STREAKC номер ID дополнительного вагона, а строчкой выше после if пишем or
  15. Также на основе некоторых имевшихся скриптов сделал еще два: для езды пассажиром в вагонах поезда при новом алгоритме (раньше при этом скрипте в вагоны сесть нельзя было) и для случайного выбора вагонов грузового поезда, но там довольно примитивно все.
  16. Доработал скрипт "новый алгоритм движения поездов" от Den_Spb. Что сделано: 1. На станции Йеллоубелл и участке от Йеллоубелл до Линден теперь может появляться как внутренний, так и внешний поезд (раньше внешний поезд там вообще никогда не появлялся). Причем когда игрок на самой станции, могут появляться оба поезда одновременно (когда между станциями - только по очереди). 2. Светофор внутреннего пути на станции Йеллоубелл, светофоры возле туннеля и светофор внешнего пути на станции Линден теперь включаются красным также при появлении встречных поездов и обратно зеленым (или желтым) при их проезде мимо или заезде на 2-путный участок. Впрочем, на станции Линден на практике почти не актуально, но пусть будет. Если ехать на поезде машинистом или пассажиром и проезжать мимо тех светофоров, тоже все правильно будут светить. 3. Поезда появляются и исчезают за 700 метров, 600 при хорошей дальности прорисовки было маловато. И ездят со скоростью 120 км/ч, тормозят на станциях в правильном месте (глюк был замечен только 1 раз, когда Карл был в таком месте, что поезд появился перед самой станцией и остановился чуть дальше, чем надо было). 4. Когда внутренний поезд собирается отправляться с Йеллоубелл, а встречный поезд уже появился и горит красный светофор, внутренний поезд будет его ждать и поедет уже на зеленый светофор, когда внешний уедет на 2-путку. На станции Линден для встречного поезда аналогично, но на практике обычно ждать не приходится. Минусы: 1. Если в случае, описанном в пункте 4, угнать поезд и поехать на красный, поезда проедут друг через друга, но такое было и в оригинальном скрипте, если поехать на однопутку задним ходом. Как в таких случаях вызывать сход обоих поездов с рельсов, я не знаю. 2. При миссии машиниста на внутреннем кольце, если придется ждать на Йеллоубелл зеленого светофора, не знаю, реально ли будет потом успеть по расписанию. Но ждать там поезду обычно долго не приходится. В остальном, глюков больше не замечал, тестировал практически по всей территории возле однопутных участков. Делал главным образом для себя, так что не знаю как быть с авторскими правами. Навыки программирования у меня никакие, но очень хотелось добавить еще больше реализма по ЖД [spoiler=код]// //-----------------------------ГТА СА: НОВЫЙ АЛГОРИТМ ДВИЖЕНИЯ ПОЕЗДОВ, ВЕРСИЯ 5--------(by Den_spb)------------------------------------------- //--- доработка Andrew_synthwave85 --- // // -----------------------------------------------------------------------------------------------------------------------Назначение переменных { [email protected] - одноразовое дробное число (значение используется в пределах одной операции или последовательной группы операций) [email protected] - одноразовое дробное число [email protected] - одноразовое дробное число [email protected] - одноразовое дробное число [email protected] - одноразовое дробное число [email protected] - указатель на маркер внутреннего поезда [email protected] - одноразовое дробное число [email protected] - одноразовое целое число [email protected] - указатель на внутренний поезд [email protected] - указатель на внешний поезд [email protected] - указатель на маркер внешнего поезда [email protected] - минимальное расстояние внутреннего поезда до точки остановки, при котором может включиться торможение [email protected] - максимальное расстояние внутреннего поезда до точки остановки, при котором может включиться торможение [email protected] - минимальное расстояние внешнего поезда до точки остановки, при котором может включиться торможение [email protected] - максимальное расстояние внешнего поезда до точки остановки, при котором может включиться торможение [email protected] - запись значения производится из адреса памяти при проверке траффика поездов (вкл или откл) [email protected] - значение, с которым сравнивается значение таймера событий внутреннего поезда (ожидание перед созданием поезда, стоянка на станции) [email protected] - значение, с которым сравнивается значение таймера событий внешнего поезда (ожидание перед созданием поезда, стоянка на станции) [email protected] - статус внутреннего поезда. Значения статусов 0 - поезд не существует. Время, по истечении которого может быть создан поезд, не отсчитывается 1 - поезд не существует. Время, по истечении которого может быть создан поезд, отсчитывается или уже истекло 2 - поезд существует 3 - поезд тормозит на станции 4 - поезд стоит на станции [email protected] - статус внешнего поезда. Значения те же. [email protected] - одноразовое целое число [email protected] - одноразовое целое число [email protected] - одноразовое целое число [email protected] - одноразовое целое число [email protected] - одноразовое целое число [email protected] - одноразовое целое число [email protected] - указатель на внутренний мачтовый светофор [email protected] - указатель на внешний мачтовый светофор [email protected] - одноразовое дробное число [email protected] - одноразовое дробное число [email protected] - флаг автоведения внутреннего поезда. Значения 0 - в кабине поезда CJ либо поезд не существует - автоведение отключено 1 - в кабине поезда бот - автоведение включено [email protected] - флаг автоведения внешнего поезда. Значения те же. [email protected] - таймер 1. Используется в событиях внутреннего поезда [email protected] - таймер 2. Используется в событиях внешнего поезда [email protected] [email protected] [email protected] [email protected] } //------------------------------------------------------------------------------------------------------------------------------Начало скрипта {$CLEO .cs} 0A95: enable_thread_saving // чтобы объекты (светофоры), созданные скриптом, не оставались на карте после сохранения игры var // идентификация типа переменных [email protected] : Integer [email protected] : Integer [email protected] : Integer [email protected] : Integer [email protected] : Integer [email protected] : Integer end [email protected] = 0 [email protected] = 0 [email protected] = 0 [email protected] = 0 [email protected] = 0 [email protected] = 0 while true //------------------------------------------------------------------------------------------------------------Главный цикл скрипта wait 0 if //--------------------------------------------------------------------------Операции для внутреннего поезда (поезд пока не существует) 856E: not car [email protected] defined then if [email protected] <> 1 then [email protected] = 1 0209: [email protected] = random_int_in_ranges 31 61 //15 21 // min и max время в секундах, по истечении которого может быть создан внутренний поезд [email protected] *= 1000 [email protected] = 0 else 0A8D: [email protected] = read_memory 0xC38010 size 1 virtual_protect 0 // читаем адрес памяти, чтобы узнать, вкл или откл траффик поездов if and [email protected] == 0 // траффик включен, следовательно ж д миссии не запущены. Можем продолжать 001D: [email protected] > [email protected] // (int) then actor.StorePos($PLAYER_ACTOR,[email protected],[email protected],[email protected]) if 056E: car [email protected] defined then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if or [email protected] < 2520.0 [email protected] < 1330.0 // если внешний поезд стоит на станции Линден или только отправился с нее, внутренний не будет создан then if or [email protected] < 1500.0 [email protected] < 1360.0 856E: not car [email protected] defined // если игрок в однопутной зоне и существует внешний поезд, то внутренний поезд создан не будет then // вся плоскость игровой карты делится на части. Минимум - на 2, в этом скрипте - на 4 (карта делится осями Y и X) // в каждой части карты должны проходить ж д пути, иначе деление нецелесообразно if [email protected] >= 0.0 // игрок в правой половине карты then if [email protected] >= 0.0 then [email protected] = 1 // номер квадранта else [email protected] = 2 end else if [email protected] >= 0.0 then [email protected] = 4 else [email protected] = 3 end end // Файл tracks2.dat делится на наборы в соответствии с делением плоскости карты. После того, как определено, // в какой части карты находится игрок, выбирается соответствующий набор точек. // Далее производится последовательная проверка расстояния игрока до точек набора. // Проверка осуществляется от дальних точек к ближним, по ходу движения поезда. // Расстояние между точками около 300 м (менее 300 м). Первая точка набора берётся не у границы части карты (квадранта), // а на 600 м раньше - на случай, если игрок находится вблизи границы квадрантов (частей карты). // Проверяются два набора точек - тот, который соответствует части карты и следующий, по ходу движения поезда. // Если расстояние между игроком и точкой меньше 600 м, то осуществляется переход на код создания поезда. // Иначе, после проверки двух наборов выполнение данной части кода прекращается. // Понятно, что поезд может быть создан на расстоянии 300 - 600 м от игрока. // Для внешнего поезда эта часть кода аналогична, только наборы будут проверяться в обратном порядке, // тоже по ходу движения поезда. Файл маршрута для внешнего поезда - tracks4.dat if [email protected] == 1 then jump @kvad_1t1 end if [email protected] == 2 then jump @kvad_2t1 end if [email protected] == 3 then jump @kvad_3t1 end if [email protected] == 4 then jump @kvad_4t1 end :kvad_1t1 //------------------------------------------------------------------------------Внутренний поезд. Набор точек 1 [email protected] = -598.09 // данная часть кода была написана pas-программой автоматически [email protected] = 1188.22 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] // расстояние между игроком и точкой [email protected] > 700.0 // если расстояние меньше 700 м, то перейти на код создания поезда jf @create1 // метка, где начинается код создания поезда [email protected] = -325.94 [email protected] = 1248.88 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -35.79 [email protected] = 1293.15 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 241.37 [email protected] = 1229.34 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 536.14 [email protected] = 1247.17 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 739.12 [email protected] = 1461.33 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 742.99 [email protected] = 1697.59 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 742.51 [email protected] = 1787.34 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 740.75 [email protected] = 2026.49 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 726.84 [email protected] = 2321.07 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 801.16 [email protected] = 2609.48 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1072.24 [email protected] = 2722.62 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1236.12 [email protected] = 2632.27 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1481.99 [email protected] = 2632.34 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1774.87 [email protected] = 2675.03 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2021.92 [email protected] = 2694.18 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2229.69 [email protected] = 2690.17 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2519.59 [email protected] = 2639.43 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2552.81 [email protected] = 2344.89 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2735.05 [email protected] = 2111.73 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2781.06 [email protected] = 1816.16 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2856.25 [email protected] = 1531.03 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2864.77 [email protected] = 1239.22 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2764.76 [email protected] = 983.25 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2764.79 [email protected] = 743.27 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 if [email protected] == 4 // если игрок находится в 4 квадранте, то заканчиваем проверку then jump @_5 // метка, расположенная после кода создания поезда end :kvad_2t1 //---------------------------------------------------------------------------Внутренний поезд. Набор точек 2 [email protected] = 2765.28 [email protected] = 528.72 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2781.32 [email protected] = 239.50 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2827.61 [email protected] = 36.33 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2763.10 [email protected] = -250.25 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2467.57 [email protected] = -275.00 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2192.47 // point 1 [email protected] = -357.99 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2122.11 // point 2 [email protected] = -647.61 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2284.98 [email protected] = -897.82 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2284.99 [email protected] = -1186.05 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2273.19 [email protected] = -1484.06 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 2198.65 [email protected] = -1760.34 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1989.68 [email protected] = -1953.75 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1696.98 [email protected] = -1953.73 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1398.43 [email protected] = -1948.14 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1197.64 [email protected] = -1779.76 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 1002.70 [email protected] = -1556.24 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 815.00 [email protected] = -1366.51 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 778.25 [email protected] = -1333.63 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 if [email protected] == 1 then jump @_5 end :kvad_3t1 //-------------------------------------------------------------------------Внутренний поезд. Набор точек 3 [email protected] = 589.52 [email protected] = -1187.75 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 335.44 [email protected] = -1061.40 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = 49.59 [email protected] = -1018.00 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -237.89 [email protected] = -1069.90 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -470.71 [email protected] = -1253.47 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -742.62 [email protected] = -1133.88 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -847.02 [email protected] = -1404.64 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1113.11 [email protected] = -1514.30 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1392.21 [email protected] = -1509.24 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1676.36 [email protected] = -1465.42 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1876.64 [email protected] = -1258.10 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1976.75 [email protected] = -995.47 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1978.81 [email protected] = -717.47 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 if [email protected] == 2 then jump @_5 end :kvad_4t1 //--------------------------------------------------------------------------Внутренний поезд. Набор точек 4 [email protected] = -1980.12 [email protected] = -592.06 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1960.09 [email protected] = -296.04 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1944.42 [email protected] = -11.95 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1942.72 [email protected] = 171.88 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1756.16 [email protected] = 399.26 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1523.12 [email protected] = 568.50 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1290.21 [email protected] = 737.81 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -1082.96 [email protected] = 888.28 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -992.44 [email protected] = 954.08 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 [email protected] = -760.64 [email protected] = 1122.39 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create1 if [email protected] == 3 then jump @_5 end jump @kvad_1t1 :create1 //---------------------------------------------------------------------------------Создание внутреннего поезда 0A8D: [email protected] = read_memory 0xC38010 size 1 virtual_protect 0 if [email protected] == 0 // траффик поездов включен (ж д миссии не запущены) then while true wait 0 0209: [email protected] = random_int_in_ranges 0 16 // выбираем тип поезда (1-15) if and [email protected] <> 8 [email protected] <> 9 [email protected] <> 10 [email protected] <> 11 [email protected] <> 12 // если тип поезда не трамвайный (8, 9, 14) [email protected] <> 13 // и не зарезервированный для миссий (10 - 13), то выбор сделан [email protected] <> 14 // 15-й тип оставил, там локомотив без вагонов then break // выход из цикла end end [email protected] = -382234 // начало блока адресов памяти, в которых записаны ИД модели вагонов всех поездов [email protected] *= 16 // номер типа * максимальное количество вагонов в типе 005A: [email protected] += [email protected] // (int) - находим начало выбранного типа поезда 0016: [email protected] /= 16 [email protected] = 6.643 // зависимость тормозного пути от кол-ва вагонов на скорости 60 км/ч определяется формулой // Тп = 6,643 + 6,357 * количество вагонов; на скорости 120 км/ч цифру 6,357 умножаем на 4 while &0([email protected],1i) <> 0 // пока ИД вагона ненулевой Model.Load(&0([email protected],1i)) // загружаем необходимые модели [email protected] += 25.428 // и одновременно считаем минимальный тормозной путь [email protected] += 1 end 0087: [email protected] = [email protected] // (float) [email protected] += 80.0 // при скорости 60 км/ч разница между мин. и макс. тормозными путями 20 м; при скорости 120 км/ч - 80 м [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 while &0([email protected],1i) <> 0 // последовательно проверяем, загружены ли модели repeat wait 0 until Model.Available(&0([email protected],1i)) [email protected] += 1 end [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 [email protected] += 14 // адрес модели 14 вагона выбранного типа if and // можно сделать поезд 19 вагонным, но только если выполнены условия &0([email protected],1i) <> 0 // в поезде будет существовать 14 вагон [email protected] < 7 // тип поезда 0-6 (остальные типы - это трамваи и поезда, используемые в миссиях) then [email protected] = &0([email protected],1i) // ИД 14 вагона [email protected] += 1 &0([email protected],1i) = [email protected] // ИД вагона 15 (0) заменена на 14 [email protected] += 1 [email protected] = &0([email protected],1i) // сохраняем в памяти ИД вагона 16 (первый вагон следующего за выбранным типа) &0([email protected],1i) = [email protected] // назначаем ИД 16 вагона такой же, как у 14 [email protected] += 1 [email protected] = &0([email protected],1i) // ИД 17 вагона &0([email protected],1i) = [email protected] [email protected] += 1 [email protected] = &0([email protected],1i) // ИД 18 вагона &0([email protected],1i) = [email protected] [email protected] += 1 [email protected] = &0([email protected],1i) // ИД 19 вагона (последнего) &0([email protected],1i) = 0 end // в файле маршрутов стандартной игры есть 2 особые точки // внутренний путь в тех местах располагается выше, чем соседний путь. // Поэтому поезд создается на пути противоположного направления. // Чтобы этого избежать, задаем высоту создания поезда для этих точек отдельно. if and [email protected] == 2192.47 // особая точка 1 [email protected] == -357.99 then 06D8: [email protected] = create_train_at [email protected] [email protected] 60.0 type [email protected] direction 1 else if and [email protected] == 2122.11 // особая точка 2 [email protected] == -647.61 then 06D8: [email protected] = create_train_at [email protected] [email protected] 70.0 type [email protected] direction 1 else // выбрана какая-то другая точка 06D8: [email protected] = create_train_at [email protected] [email protected] 0.0 type [email protected] direction 1 end // высоту для всех остальных точек можно брать одинаковую - 0.0 end [email protected] = 2 [email protected] = 1 06DC: set_train [email protected] acc 33.33 // назначаемая поезду скорость - 06DD: set_train [email protected] speed 33.33 // 120 км/ч {if $ONMISSION == 0 // во время миссии маркер будет мешать then [email protected] = Marker.CreateAboveCar([email protected]) Marker.SetColor([email protected], 0x807000FF) // 0 018B: set_marker [email protected] radar_mode 2 end} [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 [email protected] += 14 if and // если были прицеплены дополнительные вагоны, то восстанавливаем значения ИД &0([email protected],1i) <> 0 [email protected] < 7 then [email protected] += 1 // 15 &0([email protected],1i) = 0 [email protected] += 1 // 16 &0([email protected],1i) = [email protected] [email protected] += 1 // 17 &0([email protected],1i) = [email protected] [email protected] += 1 // 18 &0([email protected],1i) = [email protected] [email protected] += 1 // 19 &0([email protected],1i) = [email protected] end [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 while &0([email protected],1i) <> 0 // удаляем модели вагонов из памяти Model.Destroy(&0([email protected],1i)) [email protected] += 1 end end end end end end end :_5 if //---------------------------------------------------------------------------Операции для внешнего поезда (поезд пока не существует) 856E: not car [email protected] defined then if [email protected] <> 1 then [email protected] = 1 0209: [email protected] = random_int_in_ranges 31 61 //15 21 // min и max время в секундах, по истечении которого может быть создан внешний поезд [email protected] *= 1000 [email protected] = 0 else 0A8D: [email protected] = read_memory 0xC38010 size 1 virtual_protect 0 // читаем адрес памяти, чтобы узнать, вкл или откл траффик поездов if and [email protected] == 0 // траффик включен, следовательно ж д миссии не запущены. Можем продолжать 001D: [email protected] > [email protected] // (int) then actor.StorePos($PLAYER_ACTOR,[email protected],[email protected],[email protected]) if 056E: car [email protected] defined then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if or [email protected] < 1470.0 // если внутренний поезд стоит на станции Йеллоубелл или только отправился с нее, внешний поезд не будет создан [email protected] < 2620.0 then if or [email protected] < 1500.0 [email protected] < 1360.0 856E: not car [email protected] defined // если игрок в однопутной зоне и существует внутренний поезд, то внешний поезд создан не будет then if [email protected] >= 0.0 // игрок в правой половине карты then if [email protected] >= 0.0 then [email protected] = 1 // номер квадранта else [email protected] = 2 end else if [email protected] >= 0.0 then [email protected] = 4 else [email protected] = 3 end end if [email protected] == 1 then jump @kvad_1t4 end if [email protected] == 2 then jump @kvad_2t4 end if [email protected] == 3 then jump @kvad_3t4 end if [email protected] == 4 then jump @kvad_4t4 end :kvad_4t4 //------------------------------------------------------------------------------Внешний поезд. Набор точек 4 [email protected] = 515.98 [email protected] = 1240.23 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 226.84 [email protected] = 1238.51 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -53.40 [email protected] = 1296.12 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -347.38 [email protected] = 1247.21 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -631.83 [email protected] = 1185.07 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -880.27 [email protected] = 1040.72 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1030.44 [email protected] = 931.37 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1240.99 [email protected] = 778.43 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1342.19 [email protected] = 704.87 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 if [email protected] == 1 then jump @_6 end :kvad_3t4 //----------------------------------------------------------------------------Внешний поезд. Набор точек 3 [email protected] = -1498.99 [email protected] = 590.90 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1601.06 [email protected] = 516.83 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1837.42 [email protected] = 347.58 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1948.42 [email protected] = 100.00 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1950.42 [email protected] = -190.28 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1982.39 [email protected] = -488.08 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1982.55 [email protected] = -768.10 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1971.89 [email protected] = -1059.67 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1846.91 [email protected] = -1309.37 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1629.08 [email protected] = -1486.73 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1347.52 [email protected] = -1513.87 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -1053.53 [email protected] = -1508.42 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -835.57 [email protected] = -1370.31 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -718.41 [email protected] = -1128.25 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 if [email protected] == 4 then jump @_6 end :kvad_2t4 //------------------------------------------------------------------------------Внешний поезд. Набор точек 2 [email protected] = -596.65 [email protected] = -1164.91 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -349.44 [email protected] = -1223.16 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = -137.48 [email protected] = -1027.47 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 151.78 [email protected] = -1026.41 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 438.87 [email protected] = -1107.08 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 690.56 [email protected] = -1266.07 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 910.87 [email protected] = -1464.63 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1097.41 [email protected] = -1669.80 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1293.72 [email protected] = -1894.03 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1573.67 [email protected] = -1957.68 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1857.49 [email protected] = -1957.93 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2152.76 [email protected] = -1957.85 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2205.95 [email protected] = -1686.16 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2288.74 [email protected] = -1407.02 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2288.95 [email protected] = -1110.09 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2281.21 [email protected] = -816.01 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2078.88 [email protected] = -607.04 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 if [email protected] == 3 then jump @_6 end :kvad_1t4 //-------------------------------------------------------------------------------Внешний поезд. Набор точек 1 [email protected] = 2062.91 [email protected] = -593.55 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2087.84 [email protected] = -365.31 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2367.59 [email protected] = -284.31 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2661.26 [email protected] = -298.92 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2832.24 [email protected] = -92.44 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2805.30 [email protected] = 182.18 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2769.17 [email protected] = 442.68 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2768.74 [email protected] = 701.56 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2768.72 [email protected] = 983.27 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2868.74 [email protected] = 1239.21 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2860.00 [email protected] = 1532.27 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2785.01 [email protected] = 1782.76 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2765.17 [email protected] = 2066.97 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2563.53 [email protected] = 2264.64 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2551.77 [email protected] = 2560.03 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2342.07 [email protected] = 2694.16 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 2092.40 [email protected] = 2694.22 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1797.40 [email protected] = 2682.39 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1510.13 [email protected] = 2636.25 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 1212.03 [email protected] = 2637.34 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 957.59 [email protected] = 2762.66 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 768.57 [email protected] = 2550.89 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 725.39 [email protected] = 2288.51 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 736.95 [email protected] = 2009.09 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 738.76 [email protected] = 1746.69 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 735.12 [email protected] = 1461.95 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 [email protected] = 616.45 [email protected] = 1297.93 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] [email protected] > 700.0 jf @create4 if [email protected] == 2 then jump @_6 end jump @kvad_4t4 :create4 //-------------------------------------------------------------------------------------создание внешнего поезда 0A8D: [email protected] = read_memory 0xC38010 size 1 virtual_protect 0 if [email protected] == 0 // траффик поездов включен (ж д миссии не запущены) then while true wait 0 0209: [email protected] = random_int_in_ranges 0 16 // выбираем тип поезда (1-15) if and [email protected] <> 8 [email protected] <> 9 [email protected] <> 10 [email protected] <> 11 [email protected] <> 12 // если тип поезда не трамвайный (8, 9, 14) [email protected] <> 13 // и не зарезервированный для миссий (10 - 13), то выбор сделан [email protected] <> 14 // 15-й тип оставил, там локомотив без вагонов then break // выход из цикла end end [email protected] = -382234 // начало блока адресов памяти, в которых записаны ИД модели вагонов всех поездов [email protected] *= 16 // номер типа * максимальное количество вагонов в типе 005A: [email protected] += [email protected] // (int) - находим начало выбранного типа поезда 0016: [email protected] /= 16 [email protected] = 6.643 // зависимость тормозного пути от кол-ва вагонов на скорости 60 км/ч определяется формулой // Тп = 6,643 + 6,357 * количество вагонов; на скорости 120 км/ч цифру 6,357 умножаем на 4 while &0([email protected],1i) <> 0 // пока ИД вагона ненулевой Model.Load(&0([email protected],1i)) // загружаем необходимые модели [email protected] += 25.428 // и одновременно считаем минимальный тормозной путь [email protected] += 1 end 0087: [email protected] = [email protected] // (float) [email protected] += 80.0 // при скорости 60 км/ч разница между мин. и макс. тормозными путями 20 м; при скорости 120 км/ч - 80 м [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 while &0([email protected],1i) <> 0 // последовательно проверяем, загружены ли модели repeat wait 0 until Model.Available(&0([email protected],1i)) [email protected] += 1 end [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 [email protected] += 14 // адрес модели 14 вагона выбранного типа if and // можно сделать поезд 19 вагонным, но только если выполнены условия &0([email protected],1i) <> 0 // в поезде будет существовать 14 вагон [email protected] < 7 // тип поезда 0-6 (остальные типы - это трамваи и поезда, используемые в миссиях) then [email protected] = &0([email protected],1i) // ИД 14 вагона [email protected] += 1 &0([email protected],1i) = [email protected] // ИД вагона 15 (0) заменена на 14 [email protected] += 1 [email protected] = &0([email protected],1i) // сохраняем в памяти ИД вагона 16 (первый вагон следующего за выбранным типа) &0([email protected],1i) = [email protected] // назначаем ИД 16 вагона такой же, как у 14 [email protected] += 1 [email protected] = &0([email protected],1i) // ИД 17 вагона &0([email protected],1i) = [email protected] [email protected] += 1 [email protected] = &0([email protected],1i) // ИД 18 вагона &0([email protected],1i) = [email protected] [email protected] += 1 [email protected] = &0([email protected],1i) // ИД 19 вагона (последнего) &0([email protected],1i) = 0 end if and [email protected] > 1610.0 // если выбрана точка на однопутке возле станции Yellowbell [email protected] < 2170.0 [email protected] > 2630.0 [email protected] < 2699.0 then // внеш.поезд должен создаваться только на 2-путке, иначе поедет по внутр.пути 06D8: [email protected] = create_train_at 2173.89 2694.16 9.82 type [email protected] direction 0 else if and [email protected] > 2540.0 // если выбрана точка на однопутке в туннеле возле депо [email protected] < 2785.0 [email protected] > 1910.0 [email protected] < 2470.0 then // внеш.поезд должен создаваться только на 2-путке, иначе поедет по внутр.пути 06D8: [email protected] = create_train_at 2785.01 1901.28 5.46 type [email protected] direction 0 else // выбрана какая-то другая точка 06D8: [email protected] = create_train_at [email protected] [email protected] 0.0 type [email protected] direction 0 end // высоту для всех остальных точек можно брать одинаковую - 0.0 end [email protected] = 2 [email protected] = 1 06DC: set_train [email protected] acc 33.33 // назначаемая поезду скорость - 06DD: set_train [email protected] speed 33.33 // 120 км/ч {if $ONMISSION == 0 // во время миссии маркер будет мешать then [email protected] = Marker.CreateAboveCar([email protected]) Marker.SetColor([email protected], 0x008080FF) // 1 018B: set_marker [email protected] radar_mode 2 end} [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 [email protected] += 14 if and // если были прицеплены дополнительные вагоны, то восстанавливаем значения ИД &0([email protected],1i) <> 0 [email protected] < 7 then [email protected] += 1 // 15 &0([email protected],1i) = 0 [email protected] += 1 // 16 &0([email protected],1i) = [email protected] [email protected] += 1 // 17 &0([email protected],1i) = [email protected] [email protected] += 1 // 18 &0([email protected],1i) = [email protected] [email protected] += 1 // 19 &0([email protected],1i) = [email protected] end [email protected] = -382234 [email protected] *= 16 005A: [email protected] += [email protected] // (int) 0016: [email protected] /= 16 while &0([email protected],1i) <> 0 // удаляем модели вагонов из памяти Model.Destroy(&0([email protected],1i)) [email protected] += 1 end end end end end end end :_6 // --------------------------------------------------------------------------------------------------Операции с мачтовыми светофорами // вся трасса, вдоль котой расставляются светофоры, делится на определённое число блок-участков. // Пары мачтовых светофоров расставляются вблизи определённых точек на границах блок-участков. В данном скрипте определено 13 точек. // Нормальная длина блок-участка около 1000 м, минимальная рекомендуемая 600 м (т к в любой момент времени существует только 1 пара светофоров) // Начинаем с определения ближайшей к игроку точки, рядом с которой будет установлена пара светофоров // Для этого вычисляем расстояние между игроком и каждой точкой, выбираем наименьшее значение 00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] [email protected] = 1431.0647 // X точки 1 [email protected] = 2634.4133 // Y точки 1 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] // вычисляем расстояние [email protected] = 1 // записываем порядковый номер точки [email protected] = 2550.8633 // берем координаты следующей точки [email protected] = 2498.4736 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] // определяем дистанцию if 0025: [email protected] > [email protected] // (float) // если расстояние игрока до 2 точки меньше, чем до первой then 0087: [email protected] = [email protected] // (float) // то сохраняем меньшее значение [email protected] = 2 // и номер точки end [email protected] = 2866.9167 [email protected] = 1287.7421 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 3 end [email protected] = 2791.6074 [email protected] = 218.3158 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 4 end [email protected] = 2284.8879 [email protected] = -331.9585 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 5 end [email protected] = 2287.0544 [email protected] = -1051.7172 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 6 end [email protected] = 1919.104 [email protected] = -1955.9293 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 7 end [email protected] = -21.6351 [email protected] = -1020.1892 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 8 end [email protected] = -1260.7156 [email protected] = -1515.5342 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 9 end [email protected] = -1946.1219 [email protected] = 134.2469 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 10 end [email protected] = -915.0107 [email protected] = 1012.6142 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 11 end [email protected] = 156.3303 [email protected] = 1265.4232 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 12 end [email protected] = 739.1387 [email protected] = 1994.1334 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if 0025: [email protected] > [email protected] // (float) then 0087: [email protected] = [email protected] // (float) [email protected] = 13 end // После выполнения данной операции, стал известен номер ближайшей к игроку точки // Теперь, в соответствии с номером точки, вычисляются координаты установки светофоров и углы их поворота // Также определяются цвета (модели светофоров) if [email protected] == 1 // Если номер ближайшей к игроку точки - 1, то then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if or [email protected] > 1483.521// train position - позиция поезда относительно светофора (условие назначения красного сигнала) // Предположим, поезд подъезжает к светофору по направлению запад-восток // Тогда, если X координата поезда больше X координаты светофора, значит, поезд уже проехал светофор // Условие выполнено и будет назначен красный сигнал [email protected] > 1430.0 // чтобы светофор был красным при появлении встречного внеш.поезда с однопутки then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if [email protected] < 30000 // если внутр.поезд не существует и с момента исчезновения последнего поезда прошло менее 30000 мс (30 сек) // то будет назначен желтый сигнал then if [email protected] < 1430.0 // точка, на которой встречный внеш.поезд уедет на 2-путку на станции Йеллоубелл then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18633 // set traffic light color to red - если появился встречный поезд, включаем красный светофор end else if [email protected] < 1430.0 // точка, на которой встречный внеш.поезд уедет на 2-путку на станции Йеллоубелл then [email protected] = 18632 // set traffic light color to green else [email protected] = 18633 // set traffic light color to red - если появился встречный поезд, включаем красный светофор end end end if // аналогичная операция для внешнего поезда и светофора 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 1380.6613// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end // Теперь назначаем координаты и углы поворота светофоров [email protected] = 1483.521 // x координата внутреннего светофора [email protected] = 2629.804 // y координата внутреннего светофора [email protected] = 9.8203 // z координата внутреннего светофора [email protected] = 90.0 // z угол внутреннего светофора. Следующие параметры - аналогичные, только для внешнего светофора. [email protected] = 1380.6613 [email protected] = 2638.6968 [email protected] = 9.8203 [email protected] = 270.0 jump @lights_1 // назначение координат и моделей выполнено, можно выйти из данной секции end if [email protected] == 2 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 5000.0 // такое число сугубо для технической надобности end if or [email protected] < 2489.8071// train position [email protected] < 2630.0 // чтобы светофор был красным при появлении внеш.поезда с однопутки then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 5000.0 // такое число сугубо для технической надобности end if [email protected] < 30000 then if [email protected] > 2630.0 // место, где внеш.поезд заедет на 2-путку then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18633 // set traffic light color to red - если появился встречный поезд, включаем красный светофор end else if [email protected] > 2630.0 // место, где внеш.поезд заедет на 2-путку then [email protected] = 18632 // set traffic light color to green else [email protected] = 18633 // set traffic light color to red - если появился встречный поезд, включаем красный светофор end end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 5000.0 // такое число сугубо для технической надобности [email protected] = 0.0 end if or [email protected] > 2507.032// train position [email protected] < 2250.0 // чтобы светофор был красным при появлении внутр. поезда и до прохождения им стрелки на разъезд перед туннелем then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 5000.0 // такое число сугубо для технической надобности [email protected] = 0.0 end if [email protected] < 30000 then if [email protected] > 2250.0 // место, где внутр.поезд заедет на 2-путку then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18633 // set traffic light color to red - если появился встречный поезд, включаем красный светофор end else if [email protected] > 2250.0 // место, где внутр.поезд заедет на 2-путку then [email protected] = 18632 // set traffic light color to green else [email protected] = 18633 // set traffic light color to red - если появился встречный поезд, включаем красный светофор end end end [email protected] = 2545.4644 [email protected] = 2489.8071 [email protected] = 9.8203 [email protected] = 0.0 [email protected] = 2555.9687 [email protected] = 2507.032 [email protected] = 9.8203 [email protected] = 180.0 jump @lights_1 end if [email protected] == 3 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 1226.0918// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if or [email protected] > 1341.5892// train position [email protected] > 1870.0 // чтобы светофор был красным до прохождения внутр.поездом стрелки then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if [email protected] < 30000 // если поезд не существует и с момента исчезновения последнего поезда прошло менее 30000 мс (30 сек) // то будет назначен желтый сигнал then if [email protected] < 1870.0 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18633 // set traffic light color to red - пока встречный внутр.поезд не заедет на 2-путку, end // светофор на станции Линден красный else if [email protected] < 1870.0 then [email protected] = 18632 // set traffic light color to green else [email protected] = 18633 // set traffic light color to red - пока встречный внутр.поезд не заедет на 2-путку, end // светофор на станции Линден красный end end [email protected] = 2861.7556 [email protected] = 1226.0918 [email protected] = 9.8203 [email protected] = 0.0 [email protected] = 2871.428 [email protected] = 1341.5892 [email protected] = 9.8203 [email protected] = 180.0 jump @lights_1 end if // остальные светофоры находятся на 2-путном участке, их режим работы остается как был [email protected] == 4 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 208.3398// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > 228.1062// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = 2790.0676 [email protected] = 208.3398 [email protected] = 10.4456 [email protected] = 17.1433 [email protected] = 2793.0969 [email protected] = 228.1062 [email protected] = 9.3835 [email protected] = 197.625 jump @lights_1 end if [email protected] == 5 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if and [email protected] < 2274.7961// train position [email protected] > -481.795 then [email protected] = 18633 // set traffic light color to red else if [email protected] < -481.795 then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if and [email protected] > -481.795// train position [email protected] > 2294.8137 then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = 2274.7961 [email protected] = -332.2822 [email protected] = 37.0372 [email protected] = 298.171 [email protected] = 2294.8137 [email protected] = -331.2238 [email protected] = 34.7746 [email protected] = 122.6793 jump @lights_1 end if [email protected] == 6 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < -1060.2272// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > -1042.8805// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = 2281.8567 [email protected] = -1060.2272 [email protected] = 25.8661 [email protected] = 0.0 [email protected] = 2292.123 [email protected] = -1042.8805 [email protected] = 25.8325 [email protected] = 180.0 jump @lights_1 end if [email protected] == 7 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 1910.3224// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > 1928.194// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = 1910.3224 [email protected] = -1950.7422 [email protected] = 12.5547 [email protected] = 270.0 [email protected] = 1928.194 [email protected] = -1961.0897 [email protected] = 12.5469 [email protected] = 90.0 jump @lights_1 end if [email protected] == 8 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < -30.3923// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > -12.0904// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = -30.3923 [email protected] = -1014.865 [email protected] = 19.3695 [email protected] = 270.0 [email protected] = -12.0904 [email protected] = -1025.2236 [email protected] = 19.7471 [email protected] = 90.0 jump @lights_1 end if [email protected] == 9 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < -1268.5348// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > -1252.0717// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = -1268.5348 [email protected] = -1509.6836 [email protected] = 25.4872 [email protected] = 265.262 [email protected] = -1252.0717 [email protected] = -1521.1899 [email protected] = 27.1844 [email protected] = 86.347 jump @lights_1 end if [email protected] == 10 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > 206.1199// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 61.969// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = -1936.4524 [email protected] = 206.1199 [email protected] = 24.5516 [email protected] = 180.0 [email protected] = -1951.3076 [email protected] = 61.969 [email protected] = 24.7109 [email protected] = 0.0 jump @lights_1 end if [email protected] == 11 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > -905.1539// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < -925.2382// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = -905.1539 [email protected] = 1014.1198 [email protected] = 33.5781 [email protected] = 125.4259 [email protected] = -925.2382 [email protected] = 1011.7167 [email protected] = 33.5781 [email protected] = 305.5475 jump @lights_1 end if [email protected] == 12 then if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > 163.6387// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 150.1235// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = 163.6387 [email protected] = 1257.507 [email protected] = 21.837 [email protected] = 69.524 [email protected] = 150.1235 [email protected] = 1273.7073 [email protected] = 21.6341 [email protected] = 248.1258 jump @lights_1 end if 056E: car [email protected] defined // внутр.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] > 2002.6312// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end if 056E: car [email protected] defined // внеш.поезд существует then car.StorePos([email protected],[email protected],[email protected],[email protected]) if [email protected] < 1985.515// train position then [email protected] = 18633 // set traffic light color to red else [email protected] = 18632 // set traffic light color to green end else if [email protected] < 30000 then [email protected] = 18631 // set traffic light color to yellow else [email protected] = 18632 // set traffic light color to green end end [email protected] = 744.1491 [email protected] = 2002.6312 [email protected] = 4.7541 [email protected] = 180.0 [email protected] = 733.924 [email protected] = 1985.515 [email protected] = 4.3359 [email protected] = 0.0 :lights_1 // ------------------------------------------------------------------------------------создание или замена мачтовых светофоров [email protected] = -382079 // place of traffic lights - в этой общедоступной ячейке памяти сохранен для сравнения номер точки мачтовых светофоров [email protected] = -382078 // colour of traffic light 1 - в этой общедоступной ячейке памяти сохранен для сравнения цвет внутр.мачт. светофора if and 003B: [email protected] == &0([email protected],1i) // (int) 003B: [email protected] == &0([email protected],1i) // (int) then else // если новый цвет или место установки внутр. светофора не соответствует старому, то model.Load([email protected]) repeat wait 0 until model.Available([email protected]) if 03CA: object [email protected] exists // если существует старый внутренний светофор, then 0108: destroy_object [email protected] // то сначала удаляем его end object.Create([email protected],[email protected],[email protected],[email protected],[email protected]) // создаем внутренний светофор 0177: set_object [email protected] Z_angle_to [email protected] model.Destroy([email protected]) { marker.CreateAboveObject([email protected] [email protected]) if [email protected] == 18631 then marker.SetColor([email protected] 0xFFFF00FF) else if [email protected] == 18632 then marker.SetColor([email protected] 0x00FF00FF) else marker.SetColor([email protected] 0xFF0000FF) end end 018B: set_marker [email protected] radar_mode 2 } 0085: &0([email protected],1i) = [email protected] // (int) // сохраняем цвет светофора в памяти для сравнения end [email protected] = -382077 // colour of traffic light 4 - цвет внешнего светофора if and 003B: [email protected] == &0([email protected],1i) // (int) - номер точки тот же 003B: [email protected] == &0([email protected],1i) // (int) then else // операции внешних светофоров аналогичны вышеприведенным model.Load([email protected]) repeat wait 0 until model.Available([email protected]) if 03CA: object [email protected] exists then 0108: destroy_object [email protected] end object.Create([email protected],[email protected],[email protected],[email protected],[email protected]) 0177: set_object [email protected] Z_angle_to [email protected] model.Destroy([email protected]) { marker.CreateAboveObject([email protected] [email protected]) if [email protected] == 18631 then marker.SetColor([email protected] 0xFFFF00FF) else if [email protected] == 18632 then marker.SetColor([email protected] 0x00FF00FF) else marker.SetColor([email protected] 0xFF0000FF) end end 018B: set_marker [email protected] radar_mode 2 } 0085: &0([email protected],1i) = [email protected] // (int) save new parameters in memory 0085: &0([email protected],1i) = [email protected] // (int) end // Конец мачтовых светофоров //-------------------------------------------------------------------------------------алгоритм торможения внутреннего поезда на станции 056E: car [email protected] defined // если поезд существует jf @_7 if and [email protected] == 2 // имеет подходящий статус [email protected] == 1 // и в кабине бот jf @_7 car.StorePos([email protected],[email protected],[email protected],[email protected]) // тогда определяем позицию поезда и последовательно вычисляем расстояния до точек торможения на станциях 0509: [email protected] = distance_between_XY 1474.9031 2634.6375 and_XY [email protected] [email protected] // 1474.9031 2634.6375 - точка на какой-то станции if and 0025: [email protected] > [email protected] // (float) если поезд достаточно близко к точке торможения 0025: [email protected] > [email protected] // (float) но не слишком близко (иначе не успеет затормозить на станции) [email protected] < 1474.9031 // смысл этого условия следующий // предположим, поезд приближается к станции по направлению юг-север. Тогда, если Y координата поезда меньше Y координаты точки остановки, // то это значит, что поезд подъезжает к станции, а не отъезжает от неё - можно включить торможение then 06DD: set_train [email protected] speed 0.0 // включаем торможение [email protected] = 3 // присваиваем новый статус jump @_7 // выходим из данной секции end 0509: [email protected] = distance_between_XY 2866.8667 1246.4919 and_XY [email protected] [email protected] // if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] > 1246.4919 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_7 end 0509: [email protected] = distance_between_XY 1696.873 -1955.7689 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] > 1696.873 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_7 end 0509: [email protected] = distance_between_XY 784.326 -1341.736 and_XY [email protected] [email protected] // рынок 821.194 -1364.7119 -0.4794 if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] > 784.326 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_7 end 0509: [email protected] = distance_between_XY -1943.7788 183.2991 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] < 183.2991 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 end :_7 //---------------------------------------------------------------------------------------------------алгоритм торможения внешнего поезда 056E: car [email protected] defined // команды те же, что и для внутреннего поезда jf @_8 if and [email protected] == 2 [email protected] == 1 jf @_8 car.StorePos([email protected],[email protected],[email protected],[email protected]) 0509: [email protected] = distance_between_XY 1392.7462 2634.2546 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] > 1392.7462 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_8 end 0509: [email protected] = distance_between_XY 2867.2666 1330.1616 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] < 1330.1616 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_8 end 0509: [email protected] = distance_between_XY 1778.1157 -1955.7063 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] < 1778.1157 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_8 end 0509: [email protected] = distance_between_XY 841.0762 -1393.855 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] < 841.0762 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 jump @_8 end 0509: [email protected] = distance_between_XY -1946.4993 81.0843 and_XY [email protected] [email protected] if and 0025: [email protected] > [email protected] // (float) 0025: [email protected] > [email protected] // (float) [email protected] > 81.0843 then 06DD: set_train [email protected] speed 0.0 [email protected] = 3 end :_8 if //-------------------------------------------------------------------------------------Назначение времени стоянки внутреннему поезду 056E: car [email protected] defined then if and [email protected] == 3 [email protected] == 1 01C1: car [email protected] stopped then [email protected] = 4 0209: [email protected] = random_int_in_ranges 15 21 // мин и макс время стоянки внутреннего поезда в секундах [email protected] *= 1000 [email protected] = 0 end end if //-------------------------------------------------------------------------------------Назначение времени стоянки внешнему поезду 056E: car [email protected] defined then if and [email protected] == 3 [email protected] == 1 01C1: car [email protected] stopped then [email protected] = 4 0209: [email protected] = random_int_in_ranges 15 21 // мин и макс время стоянки внешнего поезда в секундах [email protected] *= 1000 [email protected] = 0 end end if //---------------------------------------------------------------------------------------Отправление внутреннего поезда со станции 056E: car [email protected] defined then car.StorePos([email protected],[email protected],[email protected],[email protected]) if 056E: car [email protected] defined // если внешний поезд существует (актуально на станции Йеллоубелл) then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if [email protected] < 2620.0 // Йеллоубелл - самая северная станция, эта координата показатель, что внутр.поезд находится там then if and [email protected] == 4 [email protected] == 1 001D: [email protected] > [email protected] // (int) - время стоянки истекло then [email protected] = 2 06DD: set_train [email protected] speed 33.33 // отправление со всех остальных станций end else if and [email protected] == 4 [email protected] == 1 001D: [email protected] > [email protected] // (int) - время стоянки истекло [email protected] < 1425.0 // отправление с Йеллоубелл: если внеш.поезд существует и не покинул однопутку, внутр.поезд ожидает then // для красного светофора условия аналогичные, поезд поедет только на зеленый [email protected] = 2 06DD: set_train [email protected] speed 33.33 // отправление с Йеллоубелл end end end if //-------------------------------------------------------------------------------------------Отправление внешнего поезда со станции 056E: car [email protected] defined then car.StorePos([email protected],[email protected],[email protected],[email protected]) if 056E: car [email protected] defined then car.StorePos([email protected],[email protected],[email protected],[email protected]) else [email protected] = 0.0 [email protected] = 0.0 end if [email protected] < 2850.0 // Линден - самая восточная станция, эта координата показатель, что внеш.поезд находится там then if and [email protected] == 4 [email protected] == 1 001D: [email protected] > [email protected] // (int) - время стоянки истекло then [email protected] = 2 06DD: set_train [email protected] speed 33.33 // отправление со всех остальных станций end else if and [email protected] == 4 [email protected] == 1 001D: [email protected] > [email protected] // (int) - время стоянки истекло [email protected] < 1865.0 // отправление с Линден: если внутр.поезд существует и не покинул однопутку, внеш.поезд ожидает then // для красного светофора условия аналогичные, поезд поедет только на зеленый [email protected] = 2 06DD: set_train [email protected] speed 33.33 // отправление с Линден end end end if //---------------------------------------------------------------------------------------вход игрока в локомотив внутреннего поезда 056E: car [email protected] defined then if and not actor.InCar($PLAYER_ACTOR,[email protected]) 0203: actor $PLAYER_ACTOR near_car [email protected] radius 8.0 8.0 flag 0 on_foot 00E1: player 0 pressed_key 15 then 05CB: AS_actor $PLAYER_ACTOR enter_car [email protected] as_driver -1 ms end end if //-------------------------------------------------------------------------------------------вход игрока в локомотив внешнего поезда 056E: car [email protected] defined then if and not actor.InCar($PLAYER_ACTOR,[email protected]) 0203: actor $PLAYER_ACTOR near_car [email protected] radius 8.0 8.0 flag 0 on_foot 00E1: player 0 pressed_key 15 then 05CB: AS_actor $PLAYER_ACTOR enter_car [email protected] as_driver -1 ms end end if //------------------------------------------------------------------------------------ отключение автоведения для внутреннего поезда 056E: car [email protected] defined then if and [email protected] == 1 actor.InCar($PLAYER_ACTOR,[email protected]) 09AE: actor $PLAYER_ACTOR driving_train // проверка на случай, если игрок является пассажиром поезда then [email protected] = 0 06DD: set_train [email protected] speed 0.0 // чтобы поезд не уехал сам, когда игрок выйдет из кабины end end if //---------------------------------------------------------------------------------------- отключение автоведения для внешнего поезда 056E: car [email protected] defined then if and [email protected] == 1 actor.InCar($PLAYER_ACTOR,[email protected]) 09AE: actor $PLAYER_ACTOR driving_train // проверка на случай, если игрок является пассажиром поезда then [email protected] = 0 06DD: set_train [email protected] speed 0.0 // чтобы поезд не уехал сам, когда игрок выйдет из кабины end end if //--------------------------------------------------------------------------------------------------------удаление внутреннего поезда 056E: car [email protected] defined then actor.StorePos($PLAYER_ACTOR,[email protected],[email protected],[email protected]) car.StorePos([email protected],[email protected],[email protected],[email protected]) 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if [email protected] > 700.0 // если поезд удалился от игрока более, чем на 700 м then 07BD: destroy_train [email protected] // то удаляем поезд [email protected] = 0 [email protected] = 0 end end if //-----------------------------------------------------------------------------------------------------------удаление внешнего поезда 056E: car [email protected] defined then actor.StorePos($PLAYER_ACTOR,[email protected],[email protected],[email protected]) car.StorePos([email protected],[email protected],[email protected],[email protected]) 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] if and [email protected] > 900.0 // если игрок в районе однопутных участков [email protected] > 2000.0 then if or 0025: [email protected] > [email protected] // условия, при которых поезд можно считать удаляющимся от игрока и удалять, если расстояние станет больше 700 м [email protected] > 2430.0 then if [email protected] > 1400.0 // если поезд создался на большом расстоянии от игрока then // (подходящее место на двухпутке может быть намного дальше 700м), чтобы сразу же не исчез 07BD: destroy_train [email protected] [email protected] = 0 [email protected] = 0 end else if [email protected] > 700.0 // если поезд удалился от игрока более, чем на 700 м then 07BD: destroy_train [email protected] // то удаляем поезд [email protected] = 0 [email protected] = 0 end end else if [email protected] > 700.0 // если поезд удалился от игрока более, чем на 700 м then 07BD: destroy_train [email protected] // то удаляем поезд [email protected] = 0 [email protected] = 0 end end end if //------------------------------------------------------------------запись указателя на внутренний поезд в общедоступную ячейку памяти 056E: car [email protected] defined then [email protected] = -382076 0085: &0([email protected],1i) = [email protected] // (int) - записываем в память указатель на поезд для синхронизации с другими ж д скриптами end if //---------------------------------------------------------------------запись указателя на внешний поезд в общедоступную ячейку памяти 056E: car [email protected] defined then [email protected] = -382075 0085: &0([email protected],1i) = [email protected] // (int) - записываем в память указатель на поезд для синхронизации с другими ж д скриптами end end Настройки файлов tllgs.ide, gta.dat, tracks2.dat, tracks4.dat и модели светофоров можно использовать с оригинального скрипта.
  17. Я думаю, все кто захочет иметь в своей сборке GTA наиболее подходящие и качественные замены, скачают и установят. И мало кого будет волновать вражда авторов разных моделей между собой.
  18. Так на первые три вроде уже есть достойные замены: https://gta.com.ua/file_sa_details.phtml?id=9220 - Glendale + Glenshit (в списке для карпака кстати до сих пор нет, а зря) http://gta.com.ua/forum/index.php?showtopic=3241&p=2240371 - Greenwood http://gta.com.ua/forum/index.php?showtopic=3241&p=2241180 - Hermes Вон с Enforcer"ом да, печаль
  19. Если при виде издалека одна из половинок задней двери будет пропадать (как в случае с GMC Suburban, и флагом IS_VAN это не поправляется), то лучше сделать 2 варианта и пусть в одном из них дверь будет открываться не совсем правильно или будет открываться только 1 половинка, но не будет пропадать. А то идея с 7 компонентами получилась хорошая, но движок игры все портит. Journey вроде как 2-местная машина считается в игре, может лучше его на Moonbeam или Perennial?
  20. Кстати да, ставил Порше 911, который с крышей, на Comet, так хоть убирал флаг HAS_NO_ROOF, хоть ставил разные флаги в default.ide все равно Томми запрыгивает через крышу, а дверь открывает только при наличии экстры №1 (ничего общего с крышей не имеющей в той модели). Есть еще какой-то вариант повлиять на посадку в машину?
  21. А разве это не в .exe прописано, какие из моделей красятся в 2 (или даже 4) цвета в тюнинг-гаражах? Самому очень хочется такой скрипт, чтобы все машины окрашивались во все свои цвета в гаражах, но тот что имеется, позволяет перекрашивать машины где угодно прямо на улице и бесплатно, что не совсем труъ...
  22. Вроде на Rumpo можно поставить Ford E250, но тогда желательно звук движка и все остальные звуки ему прописать аналогичные Pony / E150, ну не может E250 80-х годов выпуска быть в 1992 году с таким "убитым" звуком мотора. У Транспортера пассажиры будут через стенку выходить в миссиях полицейского и пожарного, портит вид. На Walton скоро сделают Ford 50-х годов с IVF и прочими прелестями и уже handling не будет одинаковым :( Тогда бы еще и Chevrolet Apache с IVF...
  23. Может еще один вариант тюнинговой экстры (умеренной конечно, чтоб немного колхозно, не совсем дорогой хотрод), помимо 5-фарной люстры на крыше? Например с кенгурятником. Или что-нибудь в духе фильма "Гладиатор" 1986 года, вполне подошло бы в тему. И хороший towtruck с IVF и прочими плюшками тоже очень нужен!
  24. Машинка очень классная, а тюнинга и гидравлики не будет? Для замены Slamvan? Или планируется скорее на Walton или Sadler?
  25. В идеале где-нибудь в промежутке 1983-1993. Можно также включить в игру элементы из каких-нибудь известных фильмов тех лет (как вариант - даже с элементами ретрофутуризма типа "Вспомнить все" или "Бегущий человек"), как это было в VC и SA.
×
×
  • Создать...