1. Dashboard
  2. Forum
  3. Filebase
  4. Lexikon
  5. Artikel
  6. Spieletest
  7. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  8. Zur Transport Fever Community
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Forum
  • Filebase-Eintrag
  • Lexikon
  • Artikel (Bewertungssystem)
  • Erweiterte Suche
  1. WiSim Welt
  2. Forum
  3. Spiele
  4. Cities in Motion
  5. Discussions about Cities in Motion
  6. General

Addons.script

  • steveb
  • 14. Februar 2011 um 05:32
  • steveb
    Anfänger
    Beiträge
    22
    Filebase Einträge
    2
    • 14. Februar 2011 um 05:32
    • #1

    Okay! First of all i would like to say hello to all here!

    This section of the forum is empty but considering this is a german site is to be expected so let me be the first to post... if i may

    I was browsing through the files found in the gs archives and found an interesting file addons.script in metro.gs

    From the looks of it, the game is able to load extra stuff from 3?? other directories addons/, metro/addons/, userdata/addons/ as seen in the script itself. it can even load new logos, maps, text strings, scenarios, campaigns, etc. now we only need to test this
    Note: the userdata folder = Cities in Motion folder in "My Documents"

    Code
    $window = MAIN.$window;
    $viewport = MAIN.$viewport;
    $desktop = MAIN.$desktop;
    $settings = MAIN.$settings;
    $strings = MAIN.$strings;
    
    
    MAIN.$addons = this;
    
    
    $maps = [];
    $locations = [];
    $environments = [];
    $campaigns = [];
    $scenarios = [];
    $gameScripts = [];
    $editorScripts = [];
    $companyLogos = [];
    $newsScripts = [];
    
    
    function init() {
      if (MAIN.$build.$demo || MAIN.$build.$beta) return;
      foreach (list_dirs("addons")) {
    	initAddon("addons/"+current);
      }
      foreach (list_dirs("metro/addons")) {
    	initAddon("metro/addons/"+current);
      }
      foreach (list_dirs("userdata/addons")) {
    	initAddon("userdata/addons/"+current);
      }
    }
    
    
    function initAddon($path) {
      echo "Loading addon \""+$path+"\"...";
      $strings2 = null;
      if (file_exists($path+"/strings/"+MAIN.$language+".strings")) {
    	$strings2 = load "/"+$path+"/strings/"+MAIN.$language+".strings";
      } else if (file_exists($path+"/strings/en_US.strings")) {
    	$strings2 = load "/"+$path+"/strings/en_US.strings";
      }
      if ($strings2) {
    	$strings.mergeVariables($strings2);
    	delete $strings2;
      }
      foreach (list_files($path+"/maps", ".grid")) {
    	$maps[] = $path+"/maps/"+current;
      }
      foreach (list_files($path+"/campaigns", ".campaign")) {
    	$campaigns[] = $path+"/campaigns/"+current;
      }
      foreach (list_files($path+"/scenarios", ".scenario")) {
    	$scenarios[] = $path+"/scenarios/"+current;
      }
      foreach (list_files($path+"/company-logos", ".dds")) {
    	$companyLogos[] = $path+"/logos/"+current;
      }
      foreach (list_dirs($path+"/locations")) {
    	$locations[] = $path+"/locations/"+current;
      }
      if (file_exists($path+"/scripts/environment.script")) {
    	$environments[] = $path+"/scripts/environment.script";
      }
      if (file_exists($path+"/scripts/game.script")) {
    	$gameScripts[] = $path+"/scripts/game.script";
      }
      if (file_exists($path+"/scripts/editor.script")) {
    	$editorScripts[] = $path+"/scripts/editor.script";
      }
      if (file_exists($path+"/scripts/newsticker.script")) {
    	$newsScripts[] = $path+"/scripts/newsticker.script";
      }
      if (file_exists($path+"/scripts/init.script")) {
    	load "/"+$path+"/scripts/init.script";
      }
      echo "[done]";
    }
    
    
    init();
    Alles anzeigen

    Einmal editiert, zuletzt von steveb (14. Februar 2011 um 05:37)

    • Zitieren
  • Tamael
    Anfänger
    Beiträge
    14
    • 14. Februar 2011 um 19:19
    • #2

    Hallo!

    Yes thats very intressting. I think you're right with the three folder locations. A folder structure have to be like this:

    • addons
      • campaigns
      • company-logos
      • locations
      • maps
      • scenarios
      • scripts

        • editor.script
        • environment.script
        • game.script
        • init.script
        • newsticker.script
      • strings

        • de_DE.strings
        • en_US.strings

    But what we have to write in the .script files ?

    • Zitieren
  • volcano
    Profi
    Beiträge
    773
    Filebase Einträge
    40
    • 14. Februar 2011 um 19:58
    • #3

    I found this script already, too, and I also wonder how this will work. I think the DLCs by Colossal Ordner will show us how.

    Aktuelle Ideen und Projekte oder: Was hoffentlich irgendwann mal fertig wird (Update Dezember 2010: Oder auch eher nicht)
    Mehr Konkurrenten | RCT2-Objekte in Locomotion | Gebäude aus Industrien klauen und als Stadtgebäude nutzen | LocoGUI-Klon für Gebäude | Regions-DAT-Tool | MusicChanger 2.0 | Weltraumflüge mit Loco-Maps darstellen (siehe Das Marsprojekt :) )

    The Visual Dictionary

    • Zitieren
  • steveb
    Anfänger
    Beiträge
    22
    Filebase Einträge
    2
    • 15. Februar 2011 um 14:50
    • #4

    this will work also with the full version. it is depended on the build type as seen above. well we can load extra logos for example without the need to fiddle with game archives themselves

    • Zitieren
  • liechti
    Gast
    • 15. Februar 2011 um 16:13
    • #5

    This is a really good information :) Next question: Does it also load .GS files from this paths? Or do the .GS files have to contain this paths? So it would be possible to release full mods with 1 or 2 .GS files or also like "real_logos_germany.gs"

    By the way: I have uploaed Version 1.5 of the GS file viewer which now can exclude files or files in the archive can be renamed.

    • Zitieren
  • steveb
    Anfänger
    Beiträge
    22
    Filebase Einträge
    2
    • 15. Februar 2011 um 18:40
    • #6

    that i have not tested yet. i guess we will have to try. i will give it a try with the new version of your tool

    • Zitieren

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!

Benutzerkonto erstellen Anmelden

Twitch

  1. Datenschutzerklärung
  2. Impressum
Community-Software: WoltLab Suite™