Gershwin

Пользователь
  • Публикации

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

  • Посещение

Репутация

27 Хороший

О Gershwin

  • Звание
    Продвинутый пользователь
  1. Швейцария, МРОТ 5500 франков. Россия, Питер, МРОТ 16000 рублей. Но тут всё пропорционально: проехать на электричке в Питере стоит 100 рублей, а в Швейцарии 120 франков (может на чуть большее расстояние, не замерял). Так же и с играми.
  2. Вставил terminals: (примечания после "//--" добавил уже здесь) for tracks = 1, numTracks do local platformModel local terminals = { } local terminalsLeft = { } local terminalsRight = { } local xOffset local yOffset local trackAddLength = 2.0 local trackLength = stationLength + 2.0 * trackAddLength edges[#edges + 1] = { { trackOffset, .0 - trackLength / 2 , .0 }, { .0, trackLength / 2, .0 } } edges[#edges + 1] = { { trackOffset, .0 , .0 }, { .0, trackLength / 2, .0 } } edges[#edges + 1] = { { trackOffset, .0 , .0 }, { .0, trackLength / 2, .0 } } edges[#edges + 1] = { { trackOffset, .0 + trackLength / 2 , .0 }, { .0, trackLength / 2, .0 } } snapNodes[#snapNodes+1] = (tracks - 1) * 4 snapNodes[#snapNodes+1] = (tracks - 1) * 4 + 3 for segments = 1, numSegments do xOffset = trackOffset yOffset = segments * segmentLength - segmentLength / 2 - stationLength / 2 if (tracks == 1) then -- first track -> first single platform xOffset = xOffset - platformDistance / 2 result.models[#result.models + 1] = { id = config.platformConfig.firstPlatformParts[segments].part, transf = transf.rotZYXTransl(transf.degToRad(config.platformConfig.firstPlatformParts[segments].orientation, 0.0, 0.0), vec3.new(xOffset, yOffset, 0)) } terminals[#terminals + 1] = { #result.models - 1, 0 } elseif (tracks == numTracks) then -- last track -> last single platform xOffset = xOffset + platformDistance / 2 result.models[#result.models + 1] = { id = config.platformConfig.lastPlatformParts[segments].part, transf = transf.rotZYXTransl(transf.degToRad(config.platformConfig.lastPlatformParts[segments].orientation, 0.0, 0.0), vec3.new(xOffset, yOffset, 0)) } terminals[#terminals + 1] = { #result.models - 1, 0 } else result.models[#result.models + 1] = { id = config.platformConfig.middlePlatformParts[segments].part, transf = transf.rotZYXTransl(transf.degToRad(config.platformConfig.middlePlatformParts[segments].orientation, 0.0, 0.0), vec3.new(xOffset, yOffset, 0)) } terminals[#terminals + 1] = { #result.models - 1, 0 } //--Он же ведь здесь должен стоять? end end if (tracks == 1) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } elseif (tracks == numTracks) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = #edges - 2 } else terminals[#terminals + 1] = { #result.models - 1, 0 } //--Во второй раз даже сюда впихнул, не помогло. result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = #edges - 2 } end trackOffset = trackOffset + trackDistance end terminals, как я понимаю, это и есть платформа?
  3. По идее я так и думал. А что за параметр vehicleNodeOverride? И почему тогда именно при добавлении платформы к пути происходит вылет?
  4. Эмм... Нет. Всё равно краш ту десктоп. Я так думаю что у игры возникает конфликт, так как на одном и том-же месте должен появиться и путь, и платформа. Может так быть?
  5. Ошибочка вышла. Узнал что эта часть отвечает за наличие самой платформы. Значит без наличия платформы невозможна погрузка/разгрузка? Может быть можно как-то сымитировать ее наличие?
  6. local constructionutil = require "constructionutil" local paramsutil = require "paramsutil" local railstationconfigutil = require "railstationconfigutil" local vec3 = require "vec3" local transf = require "transf" -- ############################## -- ##### PLATFORMS / TRACKS ##### -- ############################## local function makePlatformsAndTracks(config, result) result.models = { } result.terminalGroups = { } local snapNodes = { } -- inputs local numTracks = config.numTracks -- number of tracks local trackDistance = config.trackDistance -- distance between tracks local platformDistance = config.platformDistance -- distance between pattforms local segmentLength = config.segmentLength -- length of one platform segment local numSegments = #config.platformConfig.firstPlatformParts -- number of segments local stationLength = numSegments * segmentLength -- total length of the station -- total width of the station local stationWidth = numTracks * trackDistance + platformDistance / 2 if (numTracks > 1) then stationWidth = stationWidth + platformDistance / 2 end config.stationWidth = stationWidth -- set the width in config for later use local edges = { } local trackOffset = 0 for tracks = 1, numTracks do local platformModel local terminals = { } local terminalsLeft = { } local terminalsRight = { } local xOffset local yOffset local trackAddLength = 2.0 local trackLength = stationLength + 2.0 * trackAddLength edges[#edges + 1] = { { trackOffset, .0 - trackLength / 2 , .0 }, { .0, trackLength / 2, .0 } } edges[#edges + 1] = { { trackOffset, .0 , .0 }, { .0, trackLength / 2, .0 } } edges[#edges + 1] = { { trackOffset, .0 , .0 }, { .0, trackLength / 2, .0 } } edges[#edges + 1] = { { trackOffset, .0 + trackLength / 2 , .0 }, { .0, trackLength / 2, .0 } } snapNodes[#snapNodes+1] = (tracks - 1) * 4 snapNodes[#snapNodes+1] = (tracks - 1) * 4 + 3 for segments = 1, numSegments do xOffset = trackOffset yOffset = segments * segmentLength - segmentLength / 2 - stationLength / 2 if (tracks == 1) then -- first track -> first single platform xOffset = xOffset - platformDistance / 2 result.models[#result.models + 1] = { id = config.platformConfig.firstPlatformParts[segments].part, transf = transf.rotZYXTransl(transf.degToRad(config.platformConfig.firstPlatformParts[segments].orientation, 0.0, 0.0), vec3.new(xOffset, yOffset, 0)) } terminals[#terminals + 1] = { #result.models - 1, 0 } elseif (tracks == numTracks) then -- last track -> last single platform xOffset = xOffset + platformDistance / 2 result.models[#result.models + 1] = { id = config.platformConfig.lastPlatformParts[segments].part, transf = transf.rotZYXTransl(transf.degToRad(config.platformConfig.lastPlatformParts[segments].orientation, 0.0, 0.0), vec3.new(xOffset, yOffset, 0)) } terminals[#terminals + 1] = { #result.models - 1, 0 } else result.models[#result.models + 1] = { id = config.platformConfig.middlePlatformParts[segments].part, transf = transf.rotZYXTransl(transf.degToRad(config.platformConfig.middlePlatformParts[segments].orientation, 0.0, 0.0), vec3.new(xOffset, yOffset, 0)) } end end if (tracks == 1) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } elseif (tracks == numTracks) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = #edges - 2 } end trackOffset = trackOffset + trackDistance end result.edgeLists = { { type = "TRACK", params = { type = config.trackType, catenary = config.catenary }, edges = edges, snapNodes = snapNodes }, } end -- ################# -- ##### FACES ##### -- ################# local function makeFaces(config, result) local stationWidth = config.stationWidth local halfStationLength = #config.platformConfig.firstPlatformParts * config.segmentLength / 2 local xOffset = -config.platformDistance / 2 local groundFace = { { xOffset - 1, -halfStationLength - 1, .0}, { 2 * xOffset + stationWidth + 3, -halfStationLength - 1, .0}, { 2 * xOffset + stationWidth + 3, halfStationLength + 1, .0}, { xOffset - 1, halfStationLength + 1, .0} } result.terrainAlignmentLists = { {type = "EQUAL", faces = { groundFace }, } } local groundFaces = { } groundFaces[#groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_gravel_small_01" } } } groundFaces[#groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } } result.groundFaces = groundFaces end -- #################### -- ##### BUILDING ##### -- #################### local function makeStationBuilding(config, result) result.models[#result.models + 1] = { id = config.stationBuilding, transf = transf.rotZYXTransl(transf.degToRad(270.0, .0, .0), vec3.new(-10.0, .0, .0)) } end -- ################## -- ##### STREET ##### -- ################## local function makeStreet(config, result) local numTracks = config.numTracks local segmentLength = config.segmentLength local stationEnd = config.stationWidth - config.platformDistance / 2 - 5 local stationLength = #config.platformConfig.firstPlatformParts * segmentLength local buildingWidth = config.buildingWidth local roadEdges = { } local snapNodes = { } roadEdges[#roadEdges + 1] = { { -40.0, 0.0, 0.0 }, { 20.0, 0.0, 0.0 } } roadEdges[#roadEdges + 1] = { { -20.0, 0.0, 0.0 }, { 20.0, 0.0, 0.0 } } snapNodes[#snapNodes+1] = 0 if (config.streetSecondConnection == 1) then if (numTracks == 1) then local cargoOffset = 2.5 roadEdges[#roadEdges + 1] = { { stationEnd + 8.5 - cargoOffset, 0.0, 0.0 }, { 20.0, 0.0, 0.0 } } roadEdges[#roadEdges + 1] = { { stationEnd + 28.5 - cargoOffset, 0.0, 0.0 }, { 20.0, 0.0, 0.0 } } snapNodes[#snapNodes+1] = 3 result.models[#result.models + 1] = { id = config.stairs, transf = transf.rotZYXTransl(transf.degToRad(0.0, 0.0, 0.0), vec3.new(stationEnd + 5.0 - cargoOffset, 0.0, 0.0)) } result.models[#result.models + 1] = { id = config.stairsPlatform, transf = transf.rotZYXTransl(transf.degToRad(0.0, 0.0, 0.0), vec3.new(stationEnd + config.platformDistance / 2 - cargoOffset, 0.0, 0.0)) } terrainFaces = { { { stationEnd + 8.5 - cargoOffset, -segmentLength / 2 - 3, .0}, { stationEnd, -segmentLength / 2 - 3, .0}, { stationEnd, segmentLength / 2 + 3, .0}, { stationEnd + 8.5 - cargoOffset, segmentLength / 2 + 3, .0}, }, } result.terrainAlignmentLists[#result.terrainAlignmentLists] = { type = "EQUAL", faces = terrainFaces, } else stationEnd = stationEnd - config.platformDistance / 2 roadEdges[#roadEdges + 1] = { { stationEnd + 8.5, 0.0, 0.0 }, { 20.0, 0.0, 0.0 } } roadEdges[#roadEdges + 1] = { { stationEnd + 28.5, 0.0, 0.0 }, { 20.0, 0.0, 0.0 } } snapNodes[#snapNodes+1] = 3 result.models[#result.models + 1] = { id = config.stairs, transf = transf.rotZYXTransl(transf.degToRad(0.0, 0.0, 0.0), vec3.new(stationEnd + 5.0, 0.0, 0.0)) } end end result.edgeLists[#result.edgeLists + 1] = { type = "STREET", params = { type = config.streetType .. ".lua" }, edges = roadEdges, snapNodes = snapNodes } local groundFace local xx = -19.9 result.terrainAlignmentLists[1].faces[#result.terrainAlignmentLists[1].faces + 1] = { { xx, -buildingWidth / 2, .0 }, { .0, -buildingWidth / 2.0, .0 }, { .0, buildingWidth / 2.0, .0 }, { xx, buildingWidth / 2.0 , .0 } } result.terrainAlignmentLists[1].faces[#result.terrainAlignmentLists[1].faces + 1] = { { -20.0, -7.0, .0 }, { xx, -7.0, .0 }, { xx, 7.0, .0 }, { -20.0, 7.0, .0 } } groundFace = { { .0, -buildingWidth / 2}, { .0, buildingWidth/2}, { xx, buildingWidth / 2 }, { xx, 6 }, { -20, 6 }, { -20, -6 }, { xx, -6 }, {xx, -buildingWidth / 2 } } result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_concrete_01" } } } result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } } if (config.streetSecondConnection == 1) then result.terrainAlignmentLists[1].faces[#result.terrainAlignmentLists[1].faces + 1] = { { stationEnd, 6.0, 0.0 }, { stationEnd, -6.0, 0.0 }, { stationEnd + 15.0, -6.0, 0.0 }, { stationEnd + 15.0, 6.0, 0.0 } } groundFace = { { stationEnd, 6.0 }, { stationEnd, -6.0 }, { stationEnd + 15.0, -6.0 }, { stationEnd + 15.0, 6.0 } } result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "FILL", key = "industry_concrete_01" } } } result.groundFaces[#result.groundFaces + 1] = { face = groundFace, modes = { { type = "STROKE_OUTER", key = "building_paving" } } } end end local function makeTrainStationNew(config) local result = {} makePlatformsAndTracks(config, result) makeFaces(config, result) makeStationBuilding(config, result) makeStreet(config, result) result.cost = 60000 + config.numTracks * (24000 / 4) result.maintenanceCost = result.cost / 6 return result end function data() local stationConfig = { type = "cargo", name = "1850", stationType = "through", segmentLength = 20, platformDistance = 14, streetType = "station_old_small", stairs = "station/train/cargo/1850/platform_stairs.mdl", stairsPlatform = "station/train/cargo/1850/platform_single_stairs_second.mdl", tracksConfig = { { num = 1, buildingSizeIndex = 1, buildingWidth = 22.0 }, { num = 2, buildingSizeIndex = 2, buildingWidth = 32.0 }, { num = 3, buildingSizeIndex = 3, buildingWidth = 42.0 }, { num = 4, buildingSizeIndex = 3, buildingWidth = 42.0 }, { num = 5, buildingSizeIndex = 4, buildingWidth = 42.0 }, { num = 6, buildingSizeIndex = 4, buildingWidth = 42.0 }, { num = 7, buildingSizeIndex = 5, buildingWidth = 62.0 }, { num = 8, buildingSizeIndex = 5, buildingWidth = 62.0 }, }, trackTypes = { "standard.lua", "high_speed.lua" } } local stationBuilding = railstationconfigutil.makeStationBuilding(stationConfig) local platformConfig = railstationconfigutil.makePlatformConfig(stationConfig) -- replace the double/middle models... for k,v in pairs(platformConfig) do for i,part in ipairs(v.middlePlatformParts) do part.part = "station/train/cargo/tom_empty_double_stairs.mdl" end end return { type = "RAIL_STATION_CARGO", description = { name = _("name"), description = _("desc") }, availability = { --yearTo = 2050, yearFrom = 1850 }, order = 1000, soundConfig = { soundSet = { name = "station_cargo_old" } }, params = paramsutil.makeTrainStationParams(stationConfig, platformConfig), updateFn = function(params) return makeTrainStationNew(railstationconfigutil.makeTrainStationConfig(params, stationConfig, stationBuilding, platformConfig)) end } end Да не жалко!) З.Ы. А как сделать спойлер?
  7. Доброго времени суток! Пытаюсь тут переделать станцию из воркшопа: http://steamcommunity.com/sharedfiles/filedetails/?id=797527610 дабы у нее работали внутренние пути на погрузку/разгрузку. Уже говорил об этом в группе ВК. Сам мод состоит из двух файлов, .mdl из папки models и .con из папки construction. Я так понял, основная часть сборки станции происходит в файле .con, а за наличие погрузки/разгрузки отвечает следующая часть кода: if (tracks == 1) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } elseif (tracks == numTracks) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = #edges - 2 } end При попытке сделать код следующего вида: if (tracks == 1) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } elseif (tracks == numTracks) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = #edges - 2 } elseif (tracks ~= numTracks and (tracks ~= 1 )) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } end или просто: if (tracks == 1) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } elseif (tracks == numTracks) then result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = #edges - 2 } else result.terminalGroups[#result.terminalGroups + 1] = { terminals = terminals, vehicleNodeOverride = 2 } end -вылет при установке станции на карту. При условии что в ней больше двух путей, ес-сно. Пытался, кстати, ковырять значения vehicleNodeOverride, но так и не понял что это. Какие могут быть варианты решения? Очень надеюсь на вашу помощь.
  8. Мне кажется, что на нескольких мододелов нашего сайта просто накинулась ностальгия...
  9. Поставить CiM1 чтоль... Вспомнить былое.)
  10. Пока, кстати, очень помогает запуск в режиме dx9 (-force-d3d9, или как-то так). Вылетов нет уже ооочень давно.