Buy menu groups for vehicles

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.

  • With Transport Fever 2 a new feature has been added to the Buy menu: It is now possible to group the entries. This is especially useful for shape variants, repaints and multiple units with different length configurations. The following article is a detailed introduction to the necessary adjustments of the models.
    Groups for the buy menu are passively defined in Transport Fever 2, i.e. a group is not explicitly defined with the contents contained in a separate file. Instead, the vehicles are optionally specified to be included in a group (and in which group). Only then will a purchase menu entry be displayed as a group. [h1]Code adaptation in *.mdl files[/h1] The group is entered in the [tt]transportVehicle[/tt] code block. The keyword to be used is [tt]groupFileName[/tt]. The path to any mdl, which is to serve as a group entry in the purchase list, must be specified relative to the [tt]models[/tt] folder. An example looks like this: [code=lua,'*.mdl']transportVehicle = { carrier = "RAIL", compartmentsList = { -- ... }, loadSpeed = 1, multipleUnitOnly = false, reversible = false, groupFileName = "vehicle/train/menu_1020.mdl", },[/code] In the game such a grouping is indicated by the reference to n variants in the upper right corner of the group entry. In the right column you will then find another list with the variants contained in these groups in the lower area. The technical data shows the values of the currently selected variant in the group. [attach=138122][/attach] [h1]Code adaptation in *.lua files of multiple units[/h1] The group is entered in the [tt]return[/tt] code block. The keyword to use is also [tt]groupFileName[/tt]. Behind it is the path: [list][*]relative to the [tt]models[/tt] folder if a model is to serve as a group. [*]relative to the [tt]config/multiple_unit[/tt] folder if another train is to serve as a group. [/list]An example looks like this: [code=lua,'*.lua']function data() return { vehicles = { -- ... }, groupFileName = "vehicle/train/menu_cityjet.mdl", name = _("oebb_4744_name"), desc = _("oebb_4746_desc") } end[/code] In the case of multiple-unit trains, the representation looks exactly the same as for individual vehicles. Here, too, such a grouping is indicated by the reference to n variants in the upper right corner of the group entry. In the right column you will then find another list with the variants contained in these groups in the lower area. The technical data shows the values of the currently selected variant in the group. [attach=138123][/attach] [h1]Individual group pictures and names[/h1] Especially for vehicles with many colour variations one would like to show in the group entry what one can expect in the group. Therefore it is necessary to create an individual menu model as a placeholder, which is never displayed in the game itself as a variant to buy. This model gets the name of the desired group and the preview image is saved as ui image in the [tt]ui\models_small[/tt] folder. In the code it is important that the [tt]multipleUnitOnly[/tt] entry is set to [tt]true[/tt]. As long as no multiple unit contains the model, this means that the entry itself is never offered for sale, but only appears if a subordinate train or model is available. It is important that the [tt]groupFileName[/tt] is not set for this model: [code=lua,'menu_*.mdl']transportVehicle = { carrier = "RAIL", compartmentsList = { -- ... }, loadSpeed = 1, multipleUnitOnly = true, reversible = false, -- groupFileName nicht gesetzt! },[/code] The examples described in the previous sections each use an individualised menu item according to this scheme. [h1]Different availability, other modes of transport and engine types[/h1] For vehicles with a long development time, it is not necessary for the group model to cover the availability range of all variants. If only one variant is available at a time, it is displayed individually in the purchase list. As soon as two or more variants are available, the group entry with the variant list is displayed. Grouping is not only possible for rail vehicles. It can also be used for other vehicle types (aircraft, ships, road (rail) vehicles). For rail vehicles, there is also the special case that different variants of a group have defined diesel and other electrical equipment as drive types, for example. If in the purchase menu the tab is set to "ALL", all are displayed under the group. If diesel vehicles have been explicitly selected, only the corresponding subset of the vehicles is displayed.

Teilen