Hallo,
hier zeige ich Euch, wie Ihr ein Assets so modifiziert, dass es Besucher in Empfang nehmen kann und somit eine
nette Nebenfunktion erhält und nicht nur als Dekoration dient.
Anhand des Schönbau - Schloss Fasanerie Eichenzell möchte ich Euch dies erklären.
- Ladet euch das Asset herunter und entpackt das .zip / .rar
- öffnet jetzt den Ordner und geht in den Unterordner /res/construction/asset/.... hier liegt dann die Schloss_fasanerie.con
(je nach Modstrucktur befindet sich am Ziel eine .con-Datei, diese wird benötigt) - diese .con-Datei öffnet Ihr mit einen Editor (Empfehlung: Notepad++)
Beispielinhalt der Datei:PHP
Alles anzeigenlocal zPos = 0 function data() return { type = "ASSET_DEFAULT", description = { name = _("Schloss_Fasanerie"), description = _("Schloss"), }, availability = {}, buildMode = "MULTI", -- SINGLE = einzeln, MULTI = mehrfach, BRUSH = sprühen categories = { "buildings" }, skipCollision = false, autoRemovable = false, params = {}, updateFn = function(params) local result = { } result.models = { { id = "schloss_fasanerie/schloss_fasanerie.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, zPos, 1 } } } result.terrainAlignmentLists = { { type = "EQUAL", faces = { } } } return result end } end
- fügt nun folgende Zeilen der Datei so hinzu das die einzelnen Abschnitte erhalten bleiben
- dann nurnoch speichern und den Modordner wie gewohnt in den mods-Ordner verschieben und aktivieren
Beispiel:PHP
Alles anzeigenfunction data() return { type = "ASSET_DEFAULT", description = { name = _("Schloss Fasanerie"), description = _(""), }, availability = { yearFrom = 1850 }, buildMode = "MULTI", categories = { "buildings" }, skipCollision = false, autoRemovable = false, params = { { key = "kc", name = _("Gebäudetyp"), values = { _("Wohnhaus"),_("Geschaeft"),_("Industrie"), } }, }, updateFn = function(params) local result = { } result.models = { } if params.kc == 0 then result.models[#result.models+1] = { id = "schloss_fasanerie/schloss_fasanerie.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 } } result.personCapacity = { type = "RESIDENTIAL", capacity = 350 } end if params.kc == 1 then result.models[#result.models+1] = { id = "schloss_fasanerie/schloss_fasanerie.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 } } result.personCapacity = { type = "RESIDENTIAL", capacity = 3500 } end if params.kc == 2 then result.models[#result.models+1] = { id = "schloss_fasanerie/schloss_fasanerie.mdl", transf = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 } } result.personCapacity = { type = "RESIDENTIAL", capacity = 50 } end result.terrainAlignmentLists = { { type = "EQUAL", faces = { } } } return result end } end
capacity = gibt die Menge an was das gebäude empfangen kann je höher dieser Wert ist je mehr Besucher wollen dahin.
COMMERCIAL = Geschäft
RESIDENTIAL = Wohnhaus
INDUSTRIAL = Industrie