Jump to content

Recommended Posts

Posted (edited)

Czołem!

Przede wszystkim chciałem podziękować @patwrobel za jego wspaniałe scenariusze i ogrom pracy, które w nie wkłada 🥰
Niemniej dla osób, które mają różne natręctwa jak ja, publikuję co ogarnąłem w celu zmodyfikowania pewnych aspektów scenariuszy (tutaj pokazuję jak to zrobić na bazie Misji nr 6).
WAŻNE! Przy aktualizacji zmian wykonanych przez @patwrobel wszystkie pliki zostaną przywrócone do pierwotnej formy, także polecam po edycji plików stworzyć wersje zapasowe.

Rodzaj pociągów
Jeśli irytuje was obecność w waszym składzie starych wagonów albo nie lubicie patrzeć na składy AI z kolorowymi wagonami pasażerskimi, to w pliku mission.lua za wybór wagonów odpowiada ciąg ISS_Trains.PassengerCars.XXX, gdzie XXX może przyjmować formy:
- IC - nowe wagony białe,
- TLK.NEW - stare wagony białe,
- TLK.OLD - stare wagony kolorowe,

Umiejscowienie wagonu barowego w pociągu gracza
Jeśli drażni was, jeśli wagon barowy w waszym składzie nie jest pomiędzy klasami to w pliku mission.lua należy edytować funkcję Player__GetWagonNames na następującą:

Cytat

function Player__GetWagonNames(aWagonCollection, aNumberOfClass2, aNumberOfClass1, aRestaurants)
    local nameClass2 = GetRandomItem(aWagonCollection.CLASS_2);
    local nameClass1 = GetRandomItem(aWagonCollection.CLASS_1);
    
    local wagons = {};
    for i = 1, aNumberOfClass2 do
        table.insert(wagons, nameClass2);
    end

    local insertOnFront = (math.random(2) == 1);
    for i = 1, aNumberOfClass1 do
        if (insertOnFront) then
            table.insert(wagons, 1, nameClass1);
        else
            table.insert(wagons, nameClass1);
        end
    end

    if (aRestaurants) then
        if (insertOnFront) then
            table.insert(wagons, aNumberOfClass1 + 1, GetRandomItem(ISS_PassengerCars.IC_WARS));
        else
            table.insert(wagons, aNumberOfClass2 + 1, GetRandomItem(ISS_PassengerCars.IC_WARS));
        end
    end

    return wagons;
end

 

Liczba wagonów 1 klasy oraz umiejscowienie wagonu barowego w pociągach AI
Jeśli natomiast jeśli chcecie zmienić umiejscowienie wagonu barowego w pociągach AI, to trzeba zmodyfikować plik iss_train, który znajduje się w lokalizacji: ...\SteamLibrary\steamapps\workshop\content\1422130\3651816992\Engine. Przy okazji zauważyłem, że liczba wagonów 1 klasy jest stała i wynosi 2, niezależnie od długości składu, więc pozwoliłem sobie wprowadzić pewne modyfikacje też w tym zakresie. Wszystko zmienia się poprzez modyfikację funkcji GetPassengerVehicles w następujący sposób:

Cytat

function GetPassengerVehicles(aLocomotives, aWagons, aNumberOfWagons, aAllIdentical, aRestaurants)
    local vehicles_1class = nil;
    local numberOfWagons_2class = aNumberOfWagons;
    local vehicles_2class = aWagons;
    local numberOfWagons_1class = 0;

    if (aNumberOfWagons < 5) then
        numberOfWagons_1class = 1    
    elseif (aNumberOfWagons < 8 then
        numberOfWagons_1class = math.random(2)
    elseif (aNumberOfWagons < 10) then
        numberOfWagons_1class = math.random(2, 3) 
    else
        numberOfWagons_1class = math.random(3, 4)
    end

    if (aWagons ~= nil and aWagons.CLASS_1 ~= nil and aWagons.CLASS_2 ~= nil) then
        vehicles_1class = CreateRandomVehicles(aWagons.CLASS_1, numberOfWagons_1class, aAllIdentical);
        numberOfWagons_2class = aNumberOfWagons - numberOfWagons_1class;
        vehicles_2class = aWagons.CLASS_2;
    end
    
    local vehicles = CreateRandomVehicles(vehicles_2class, numberOfWagons_2class, aAllIdentical);
    local insertOnFront = (math.random(2) == 1);
    if (vehicles_1class ~= nil) then
        if (insertOnFront) then
            for i = 1, numberOfWagons_1class do
                table.insert(vehicles, i, vehicles_1class[i]);
            end

        else
            for i = 1, numberOfWagons_1class do
                table.insert(vehicles, vehicles_1class[i]);
            end
        end
    end
    
    if (aRestaurants ~= nil) then
        if (insertOnFront) then
            table.insert(vehicles, numberOfWagons_1class + 1, CreateNewSpawnVehicleDescriptor(GetRandomItem(aRestaurants), false));
        else
            table.insert(vehicles, numberOfWagons_2class + 1, CreateNewSpawnVehicleDescriptor(GetRandomItem(aRestaurants), false));
        end
    end

    if (aLocomotives ~= nil) then
        table.insert(vehicles, 1, CreateNewSpawnVehicleDescriptor(GetRandomItem(aLocomotives), false));
    end

    return vehicles;
end

 

 

Edited by Masterczulki
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy