Brdige Configuration

Willkommen in der Transport Fever Community

Wir begrüßen euch in der Fan-Community zu den Spielen Transport Fever und Train Fever, den Wirtschaftssimulatoren von Urban Games. Die Community steht euch kostenlos zur Verfügung damit ihr euch über das Spiel austauschen und informieren könnt. Wir pflegen hier einen freundlichen und sachlichen Umgang untereinander und unser Team steht euch in allen Fragen gerne beiseite.

 

Die Registrierung und Nutzung ist selbstverständlich kostenlos.

 

Wir wünschen euch viel Spaß und hoffen auf rege Beteiligung.

Das Team der Transport-Fever Community


Sie betrachten gerade eine ältere Version des Eintrags. Klicken Sie hier, um zur aktuellen Version zu gelangen.

  • In Transport Fever 2, bridges are defined by lua configuration files as in the predecessors.
    [h1]

    1 Bridge configuration

    [/h1] The bridge configurations are located in the folder [tt]res/config/bridge[/tt]. They contain a [tt]data()[/tt] function that returns the following data: [table] [tr] [td][b]Name[/b][/td] [td][b]Data type[/b][/td] [td][b]Example value (iron.lua)[/b][/td] [td][b]Description[/b][/td] [/tr] [tr] [td]name[/td] [td]String[/td] [td]_("Iron bridge")[/td] [td]The name of the bridge, which is shown as a tooltip in the bridge selection menu[/td] [/tr] [tr] [td]yearFrom[/td] [td]Integer[/td] [td]1910[/td] [td]When will the bridge be available?[/td] [/tr] [tr] [td]yearTo[/td] [td]Integer[/td] [td]0[/td] [td]Until when is the bridge available?[/td] [/tr] [tr] [td]carriers[/td] [td]List from "RAIL", "ROAD"[/td] [td]{ "RAIL" , "ROAD"}[/td] [td]Is the bridge available as a road and/or railway bridge?[/td] [/tr] [tr] [td]speedLimit[/td] [td]Double[/td] [td]180.0 / 3.6[/td] [td]Permissible maximum speed in m/s[/td] [/tr] [tr] [td]pillarLen[/td] [td]Integer[/td] [td]3[/td] [td](?) Length of a pier in bridge direction[/td] [/tr] [tr] [td]pillarMinDist[/td] [td]Double[/td] [td]18.0[/td] [td]minimum distance between 2 pillars[/td] [/tr] [tr] [td]pillarMaxDist[/td] [td]Double[/td] [td]66.0[/td] [td]maximum distance between 2 pillars[/td] [/tr] [tr] [td]pillarTargetDist[/td] [td]Double[/td] [td]36.0[/td] [td]optimum distance between 2 pillars[/td] [/tr] [tr] [td]cost[/td] [td]Double[/td] [td]300.0[/td] [td]Cost factor[/td] [/tr] [tr] [td]materialsToReplace[/td] [td]List (see below)[/td] [td]...[/td] [td]Table for the replacement of textures for roads on bridges[/td] [/tr] [tr] [td]updateFn[/td] [td]Function (see below)[/td] [td]bridgeutil.makeDefaultUpdateFn(config)[/td] [td]Function used for the composition of the bridge models[/td] [/tr] [/table]

    1.1 materialsToReplace

    This table is used to exchange materials for roads when they are built on bridges. All materials that are also specified for roads are possible: [list][*]streetPaving, streetBorder, streetLane, streetStripe, streetStripeMedian [*]streetTram, streetTramTrack, streetBus [*]crossingLane, crossingBus, crossingTram, crossingTramTrack, crossingCrosswalk, crossingStopline [*]sidewalkPaving, sidewalkLane, sidewalkBorderInner, sidewalkBorderOuter, sidewalkCurb, sidewalkWall [/list]

    1.2 updateFn

    This function is used to construct the bridge model from individual parts. In [tt]scripts/bridgeutil.lua[/tt] a prefabricated function is offered, which is also used by the vanilla bridges. This function gets a config table as parameter. The contents of this table are described below: [h1]

    2 Pfeiler

    [/h1] The pillars consist of three layers, of which the middle layer can be repeated several times: xxx [b]pillarBase (purple)[/b] Dies ist eine Liste mit Modellen, die für den unteren Abschluss eines Pfeilers genutzt werden. Die Länge der Liste kann variieren, möglich sind: [table] [tr] [td]1 Model[/td] [td]xxx[/td] [td]This model is set in the middle as a pillar.[/td] [/tr] [tr] [td]2 Models[/td] [td]xxx[/td] [td]The first model is used for the edges of the pier (rotated once accordingly), the second model is placed next to each other for the middle of the pier and scaled slightly until it fills the required width.[/td] [/tr] [tr] [td]3 Models[/td] [td]xxx[/td] [td]The first model is used for one side of the pillar, the second model is placed next to each other for the middle of the pillar and scaled slightly until it fills the required width and the third model is used for the other side, but not rotated.[/td] [/tr] [/table] [b]pillarRepeat (green)[/b] This is a list of models used for the height variable part of the pillar. These models are strung together vertically several times and, if necessary, scaled slightly to reach the required height. The length of the list can vary, possible combinations are as described for [b]pillarBase [/b]. [b]pillarTop (yellow)[/b] This is a list of models used for the upper end of the pillar. The length of the list can vary, possible combinations are as described for [b]pillarBase [/b].

    2.1 configurePillar

    If you do not want to use the function described above to assemble the columns, but instead assemble another column based on the height of the column, for example, you can specify a separate function for this: [code=lua]configurePillar = function(modelData, params, i, height, width) [...] end,[/code]This has the following parameters: [table] [tr] [td][b]Name[/b][/td] [td][b]Data type[/b][/td] [td][b]Description[/b][/td] [/tr] [tr] [td]modelData[/td] [td]complex list[/td] [td]A list of bridge element models and their properties For further information see below[/td] [/tr] [tr] [td]params[/td] [td]complex list[/td] [td]A list with the parameters of the bridge section currently under construction (mostly up to 3 piers long). For further information see below[/td] [/tr] [tr] [td]i[/td] [td]Integer[/td] [td]The number of the pillar in the bridge section currently under construction[/td] [/tr] [tr] [td]height[/td] [td]Double[/td] [td]The height of the pillar to be built in meters[/td] [/tr] [tr] [td]width[/td] [td]Double[/td] [td]The width of the pillar to be built in meters[/td] [/tr] [/table] [b]modelData[/b] The default configurePillar function passes a list of all loaded bridge element models (not only those of this bridge!). The path to the mdl file is used as the key of the list entries. For each entry the BoundingBox is provided: [code=lua]["bridge/iron/pillar_top_side.mdl"] = { ["min"] = { [1] = -1, [2] = -4.6595997810364, [3] = -3.5, } , ["max"] = { [1] = 1, [2] = 0, [3] = -2.0499999523163, } , } ,[/code] [info=warning]Due to the game loading and extracting all these Bounding Box data, it is required that all bridge related mdl files are located under [tt]res/models/model/bridge/[/tt]![/info] [b]params[/b] At runtime, a table with various parameters is delivered with the method call. These are: [list][*][tt]pillarWidth[/tt]: The width of a pillar [*][tt]pillarHeights[/tt]: A list with the heights of the pillars [*][tt]pillarLength[/tt]: The length of a pillar [*][tt]state.models[/tt]: A list with all loaded bridge models (see above) [*][tt]railingWidth[/tt]: The width of the bridge [*][tt]railingIntervals[/tt]: A list of bridge sections. There is three pieces of information for each section: [list][*][tt]hasPillar[/tt]: A pair of two boolean values that probably tell whether a pillar is placed at the beginning and end of the section [*][tt]lanes[/tt]: ? [*][tt]length[/tt]: The length of the section [/list][/list] [h1]

    3 Bridge girder

    [/h1] The bridge girder also consists of several rows that are placed next to each other: xxx[/attach] [b]railingBegin[/b] This is a list of models that are used for the beginning of a bridge girder segment. A bridge segment starts at the beginning of a bridge and at each pier. There can be either 5 or 8 models in the list. Unfortunately for some elements of the list it is not yet clear what they mean. If only 5 elements are included, the elements 1-3 are used as a substitute for 6-8 in a rotated version: [table] [tr] [td]5 Models[/td] [td]xxx[/td] [td]The first model is used for the outer sides (rotated once accordingly), the fourth model is placed next to each other for the middle of the line and scaled slightly until it fills the required width.[/td] [/tr] [tr] [td]8 Models[/td] [td]xxx[/td] [td]The first model is used for one outside, the fourth model is placed next to each other for the middle of the line and scaled slightly until it fills the required width and the sixth model is used for the other outside but does not rotate.[/td] [/tr] [/table] [b]railingRepeat[/b] This is a list of models that are used for the center of a bridge girder segment. These models are lined up horizontally several times and, if necessary, scaled slightly to reach the required height. The length of the list can vary, possible combinations are as described for [b]railingBegin [/b]. [b]railingEnd[/b] This is a list of models that are used for the end of a bridge girder segment. The length of the list can vary, possible combinations are as described for [b]railingBegin [/b].

Teilen