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