GearCity

GearCity

View Stats:
 This topic has been pinned, so it's probably important
Eric.B  [developer] 10 Feb, 2017 @ 8:13am
Temporary Quick and Dirty Mod Tools Tutorial.
Hello everyone, this is just a quick, lightly detailed overview of the mod tools and how to use them. More detailed tutorials will come after I implement the official Gearcity wiki page. This is not really meant to be comprehensive or anything. Before v1.22 comes out the mod tools are a use and learn at your own risk type deal.


First an overview of the map/mod system.

The editable parts of the game are broken down into two systems.
-The "Map" files which consists of map specific artwork, city artwork, news artwork, AI artwork, and scripts that use city ID's. These include the City information files, AI files, and the Turn Events file.
-The "Mod" Flies consist of scripts not specifically tied to the map files. Although components.xml and turnevents files do share some linkage. The mod files can also override files, such as turnevents, on specific map.

Currently on the Map files are implemented.

Map Tools
You can find maps in the game in the "install location/media/Maps" folder. Each map has it's own folder, two xml files, one for use in game, the other for the editor, and a number of folders and scripts in specific locations.

You may want to back up the map folder before changing anything there. You can break the game. Deleting the map folder then verifying game cache would also fix any issues if you break something. :)

To open a map in the editor, click "Map Data Tools", "Open Map Data", then navigate to the folder with your map data and select the "MapFileForModTools.xml" (Please note, if you are currently working on a map and it is not completed, you should save it in a different location outside of the game. You can then load the xml files that file. This is to prevent the game from crashing on load.)

The Test Dot City map is probably the best to play around with.

You will notice on the left hand side various locations and folders. The exporter will look for specific files in these locations. So when you edit AI files, or City Data, please save those files in these folders.

If you're editing an existing map and do not want to overwrite it. Be sure to rename the map under "Map Name" before exporting.

All artwork must be saved in zip files and have unique names, and may not contain folders in the zip files.

To export the map, click export. Navigate to the /media/maps folder. A new folder will be saved with the name of the map and all files will be moved to that location.

City Tools
The city script files are located in the "install location/media/Maps/Map Name/scripts" folder. The tools are pretty self explanatory. Using a dot city map, such as Test Dot City map, you can add remove cities from the game using these files. Go ahead and open Test Dot City map's city xml file and add a city. Be sure to fill out all the information, then save it over the old xml file. You should see your new city in the game.
(Two points, First, the world coordinates will place the dot on the map, so be sure these are correct! Second point, removing cities will not automatically adjust turnevents or AI HQ locations city information at this time. So if you remove a city, you will have to adjust both of those files as well. I'll be adding a automated solution to this in the near future.)

You can also interpolate data between multiple points. For instance, in the "Classic Map" you'll see city files for 1980, 1950, 1930, and 1900. The mod tools will automatically adjust growth rates for you between the files if you load them. If you're making/editing something form scratch, it is best to start on the last year first and work your way backwards.


AI and Turn Events
Both of these files use other files. For instance the AI files use the city files for HQ locations of companies. The Turn Events link multiple files to world events as well. It can alter city's as well components.

In short, you'll find a couple of file loaders for both of these tools. Load the appropriate files, and modifying things such as HQ city locations for AI companies will become much more easy.

(Note, with the turn events files, unless you plan on re-translating the entire game to multiple languages, it is probably best to avoid the "Localization" checkboxes for news events. )

As I said, a nice quick overview. I'll have a better one with pictures in about a month or two. (Will make it while I work on the new map system.)
< >
Showing 1-15 of 39 comments
Eric.B  [developer] 10 Feb, 2017 @ 8:15am 
If you have any questions feel free to post them. This isn't really meant to be a fully detailed tutorial because it's a waste of time to write one at this second. (The wiki will have better formatting and I'll be writing a map from scratch in a couple of weeks, so I can take pictures/videos.) But I don't mind answering any questions if you have them.
Last edited by Eric.B; 10 Feb, 2017 @ 8:16am
shiggies713 15 Apr, 2017 @ 4:11am 
Ok I'm trying to make a simple mod, all it does is add logo's for additional player marqees.

What additional steps do I need to take aside from generating the xml file in the mod tools?

I did that, the only thing it "overrides" is the logo's, haven't even tried to test it yet, but I assume I need to do something else to make it initialize.
Eric.B  [developer] 15 Apr, 2017 @ 6:32am 
Originally posted by shiggies713:
Ok I'm trying to make a simple mod, all it does is add logo's for additional player marqees.

What additional steps do I need to take aside from generating the xml file in the mod tools?

I did that, the only thing it "overrides" is the logo's, haven't even tried to test it yet, but I assume I need to do something else to make it initialize.

You'd create the player logo .xml file as normal using the Player Logos tool. But you would put the artwork in it's own .zip file.

Next you'd use the Mod Data Tool, You'd name the mod, check "Miscellaneous Artwork" then the '...' button beside it. Select the zip file with the logos in it. Then you'd check 'Player Logos' click the '...' button and select the player logo.xml file you made.

Last step would be to hit 'Export Mod' in the upper right. Export it to your /media/Mods folder (Which from the looks of it, Steam didn't make the blank folder!!! ARGH!) So you will have to do that first, create a folder named 'Mods' in the /media/ folder. Then export your mod there.

Final step would be setting the game to use the mod, with the external video settings editor, you go to the 'Modifications' tab, select your mod from the list, and hit 'save'.
shiggies713 15 Apr, 2017 @ 6:37am 
Ok thanks, I'll try that out soon, hopefully have something by the end of the weekend.
shiggies713 15 Apr, 2017 @ 10:56am 
Ok I have it working, but the mod tool is generating some xml that is not working I think, or could possibly not work depending on your install directory.

This is what I had to change it to, to make it work;
<ModFile> <ModName>Moar Logos</ModName> <GCModVersion>12200</GCModVersion> <Author>Shiggs713</Author> <Comments></Comments> <NameList Override="0"/> <Newspaper Override="0"/> <Reviews Override="0"/> <Components Override="0"/> <ArtworkComponentsImages Override="0"/> <ArtworkVehicles Override="0"/> <ArtworkMisc Override="1" FileName="Moar Logos.zip">../GearCity/media/Mods/Moar Logos/Moar Logos.zip</ArtworkMisc> <MusicFile Override="0"/> <PlayerLogos Override="1" FileName="MoarLogos.xml">../GearCity/media/Mods/Moar Logos/MoarLogos.xml</PlayerLogos> <MusicFolder></MusicFolder> <ComponentsPop Override="0"/> <RacingSeries Override="0"/> <ContractInfo Override="0"/> <SupportedMaps> <Map>Base City Map</Map> <Map>Classic Map</Map> <Map>Europe Test</Map> <Map>Old School Territories</Map> <Map>Test DotCity Map</Map> </SupportedMaps> </ModFile>

I forget exactly what it generated, but it originally got an OGRE exception, whatever that is. It said something about not being able to read the zip file. So I deleted the zip file and the xml file that the mod tool generated. I used my original zip file that I had and just put it in the mod folder, same thing with the MoarLogos.xml file, then changed the names in the modinfofile and the directories and poof it works.

it originally had my full directory for the art, all the way up to S:/Program Files (steam is installed on my ssd), so I'm assuming anyone else that would have downloaded the mod it woud not have worked for. The actual xml file the directory looked ok, but i went ahead and added the /GearCity/ part to it just for continuity.
Last edited by shiggies713; 15 Apr, 2017 @ 11:00am
Eric.B  [developer] 15 Apr, 2017 @ 11:04am 
Did you use "export" or did you use "save" in the Mod Data Tool?
shiggies713 15 Apr, 2017 @ 11:05am 
i only exported, i didn't save, oh well, its working
Last edited by shiggies713; 15 Apr, 2017 @ 11:05am
Eric.B  [developer] 15 Apr, 2017 @ 11:17am 
Just curious what the paths it gave you were, as save will give you a full path (because it's used by the Mod Tools.) Where as export is supposed to give you relative path to the Mod folder.

Anyevent, I'll be using the mod tools shortly, so I guess I'll find out soon enough... just got the wiki set up.
Last edited by Eric.B; 15 Apr, 2017 @ 11:18am
shiggies713 15 Apr, 2017 @ 11:42am 
I also had a question about activating mods. Is it possible to have more than 1 active at a time?

I was going to build them modular style like I'm used to from civ5, 6 but if it is a hassle I guess its not a big deal to just turn it into a bigger mod.
Eric.B  [developer] 15 Apr, 2017 @ 11:56am 
Originally posted by shiggies713:
I was going to build them modular style like I'm used to from civ5, 6 but if it is a hassle I guess its not a big deal to just turn it into a bigger mod.
Originally, I had planned to do this, but sadly I didn't have the time to implement it.

However, the mod tools themselves are rather easy to mix and match mods and export them into a new mod.
shiggies713 15 Apr, 2017 @ 2:53pm 
one more question for now, is there any way to overwrite the localization files or what I simply want to do is just change the fonts for a mod.

I've already did it on my own, but not sure how I would get it to load up in a mod;
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=906274995
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=906271852

for now I just overwrote the base assets with that particular part of my mod, though I have also added a names list into my working version of the mod that is probably about 150 names at least. So the mod does 3 things now :)
Last edited by shiggies713; 15 Apr, 2017 @ 2:55pm
Eric.B  [developer] 15 Apr, 2017 @ 5:21pm 
Originally posted by shiggies713:
one more question for now, is there any way to overwrite the localization files or what I simply want to do is just change the fonts for a mod.
Currently there isn't a way to override language files. I was going to implement the feature, however I postponed it until after the core game is finished, as it can cause crashing issues if your language files are out of sync with what the game is expecting.

I may be able to include a font override however. I'll stick it in the git tracker for the mod tools.

(Alternatively, instead of editing the fonts in the language files, you can edit the english.fontdef file in the /meda/fonts folder.)
shiggies713 15 Apr, 2017 @ 5:30pm 
yea that is what I actually modded (the font define), not the language file, then later on found the tag for it in the localization.xml. I simply found a font that i liked, put it in my folder, and copied the name.tff and replaced the one it had, and it works. Don't know if I needed to include the font or not, but it was easy enough.
Last edited by shiggies713; 15 Apr, 2017 @ 5:31pm
shiggies713 15 Apr, 2017 @ 7:24pm 
also not sure if I'm doing something wrong or if its not totally implemented yet but adding music is giving me some unknown crash.

if anyone can see what I'm doing wrong I would appreciate it, here is my modinfo.xml
<?xml version="1.0" encoding="UTF-8"?> <ModFile> <ModName>Moar</ModName> <GCModVersion>12200</GCModVersion> <Author>Shiggs713</Author> <Comments></Comments> <NameList Override="1" FileName="NamesList.txt">../GearCity/media/Mods/Moar/NamesList.txt</NameList> <Newspaper Override="0"/> <Reviews Override="0"/> <Components Override="0"/> <ArtworkComponentsImages Override="0"/> <ArtworkVehicles Override="0"/> <ArtworkMisc Override="1" FileName="MoarLogos.zip">../GearCity/media/Mods/Moar/MoarLogos.zip</ArtworkMisc> <MusicFile Override="0" FileName="MoarMusic.xml">../GearCity/media/Mods/Moar/MoarMusic.xml</MusicFile> <PlayerLogos Override="1" FileName="MoarLogos.xml">../GearCity/media/Mods/Moar/MoarLogos.xml</PlayerLogos> <MusicFolder>../GearCity/media/Mods/Moar/Music</MusicFolder> <ComponentsPop Override="0"/> <RacingSeries Override="0"/> <ContractInfo Override="0"/> <SupportedMaps> <Map>Base City Map</Map> <Map>Classic Map</Map> <Map>Europe Test</Map> <Map>Old School Territories</Map> <Map>Test DotCity Map</Map> </SupportedMaps> </ModFile>

I have the override turned off for now because it was crashing. Then my MoarMusic.xml file
<?xml version="1.0" encoding="UTF-8"?> <MusicFiles> <Music Artist="Bach" Name="Allegro Assai" StartYear="1900" EndYear="1933" Use="0">BachAllegroAssai.ogg</Music> <Music Artist="Bach" Name="Allegro" StartYear="1900" EndYear="1933" Use="0">BachAllegro.ogg</Music> <Music Artist="Bach" Name="Allemande" StartYear="1900" EndYear="1933" Use="0">BachAllemande.ogg</Music> <Music Artist="Bach" Name="Bouree" StartYear="1900" EndYear="1933" Use="0">BachBouree.ogg</Music> <Music Artist="Bach" Name="Brandenburg2 3" StartYear="1900" EndYear="1933" Use="0">BachBrandenburg2 3.ogg</Music> <Music Artist="Bach" Name="Brandenburg3 1" StartYear="1900" EndYear="1933" Use="0">BachBrandenburg3 1.ogg</Music> <Music Artist="Bach" Name="Brandenburg4 1" StartYear="1900" EndYear="1933" Use="0">BachBrandenburg4 1.ogg</Music> <Music Artist="Bach" Name="Brandenburg6 1" StartYear="1900" EndYear="1933" Use="0">BachBrandenburg6 1.ogg</Music> <Music Artist="Bach" Name="Brandenburg6 3" StartYear="1900" EndYear="1933" Use="0">BachBrandenburg6 3.ogg</Music> <Music Artist="Bach" Name="Gigue" StartYear="1900" EndYear="1933" Use="0">BachGigue.ogg</Music> <Music Artist="Bach" Name="Largo" StartYear="1900" EndYear="1933" Use="0">BachLargo.ogg</Music> <Music Artist="Bach" Name="Menuet" StartYear="1900" EndYear="1933" Use="0">BachMenuet.ogg</Music> <Music Artist="Bach" Name="Sarabande" StartYear="1900" EndYear="1933" Use="0">BachSarabande.ogg</Music> <Music Artist="Beethoven" Name="Andante" StartYear="1900" EndYear="1933" Use="0">BeethovenAndante.ogg</Music> <Music Artist="Beethoven" Name="Romance1" StartYear="1900" EndYear="1933" Use="0">BeethovenRomance1.ogg</Music> <Music Artist="Mozart" Name="Adagio" StartYear="1900" EndYear="1933" Use="0">MozartAdagio.ogg</Music> <Music Artist="Mozart" Name="Andante" StartYear="1900" EndYear="1933" Use="0">MozartAndante.ogg</Music> <Music Artist="Mozart" Name="Romance" StartYear="1900" EndYear="1933" Use="0">MozartRomance.ogg</Music> <Music Artist="Brahms" Name="3 2" StartYear="1933" EndYear="1980" Use="0">Brahms3 2.ogg</Music> <Music Artist="Brahms" Name="3 3" StartYear="1933" EndYear="1980" Use="0">Brahms3 3.ogg</Music> <Music Artist="Beethoven" Name="5 2" StartYear="1933" EndYear="1980" Use="0">Beethoven5 2.ogg</Music> <Music Artist="Beethoven" Name="6 1" StartYear="1933" EndYear="1980" Use="0">Beethoven6 1.ogg</Music> <Music Artist="Beethoven" Name="6 2" StartYear="1933" EndYear="1980" Use="0">Beethoven6 2.ogg</Music> <Music Artist="Dvorak" Name="9 2" StartYear="1933" EndYear="1980" Use="0">Dvorak9 2.ogg</Music> <Music Artist="Saint Saens " Name="Allegretto" StartYear="1933" EndYear="1980" Use="0">SaintSaensAllegretto.ogg</Music> <Music Artist="Dvorak" Name="American1" StartYear="1933" EndYear="1980" Use="0">DvorakAmerican1.ogg</Music> <Music Artist="Brahms" Name="Hungarian1" StartYear="1933" EndYear="1980" Use="0">BrahmsHungarian1.ogg</Music> <Music Artist="Brahms" Name="Hungarian16" StartYear="1933" EndYear="1980" Use="0">BrahmsHungarian16.ogg</Music> <Music Artist="Brahms" Name="Hungarian3" StartYear="1933" EndYear="1980" Use="0">BrahmsHungarian3.ogg</Music> <Music Artist="Rimsky Korsakov" Name="Scheherazade 3" StartYear="1933" EndYear="1980" Use="0">RimskyKorsakovScheherazade3.ogg</Music> <Music Artist="Dvorak" Name="Slavonic10" StartYear="1933" EndYear="1980" Use="0">DvorakSlavonic10.ogg</Music> <Music Artist="Dvorak" Name="Slavonic12" StartYear="1933" EndYear="1980" Use="0">DvorakSlavonic12.ogg</Music> <Music Artist="Dvorak" Name="Slavonic3" StartYear="1933" EndYear="1980" Use="0">DvorakSlavonic3.ogg</Music> <Music Artist="Dvorak" Name="Slavonic7" StartYear="1933" EndYear="1980" Use="0">DvorakSlavonic7.ogg</Music> <Music Artist="unknown" Name="Chairman Dances" StartYear="1980" EndYear="3000" Use="0">ChairmanDances.ogg</Music> <Music Artist="unknown" Name="Common Tones" StartYear="1980" EndYear="3000" Use="0">CommonTones.ogg</Music> <Music Artist="unknown" Name="Grand Pianola 1" StartYear="1980" EndYear="3000" Use="0">GrandPianola1.ogg</Music> <Music Artist="unknown" Name="Grand Pianola 2" StartYear="1980" EndYear="3000" Use="0">GrandPianola2.ogg</Music> <Music Artist="unknown" Name="Harmonielehre" StartYear="1980" EndYear="3000" Use="0">Harmonielehre.ogg</Music> <Music Artist="unknown" Name="Loops and Verses" StartYear="1980" EndYear="3000" Use="0">LoopsAndVerses.ogg</Music> <Music Artist="unknown" Name="Meister Eckhardt" StartYear="1980" EndYear="3000" Use="0">MeisterEckhardt.ogg</Music> <Music Artist="unknown" Name="Shaking and Trembling" StartYear="1980" EndYear="3000" Use="0">ShakingAndTrembling.ogg</Music> </MusicFiles>

I checked it twice for any mispellings though there should not be any anyways, almost all of it was autogenerated except a couple I forgot, then did a simple copy/paste after the fact.

All the music files are in the Mods/Moar/Music/ folder in .ogg format, not sure what else to do. The mod works if I don't use the music aka put a 0 as the override value.

I tried with and without a song set to lobby and game over but no joy either way, and the songs play just fine from windows using my web browser.
Last edited by shiggies713; 15 Apr, 2017 @ 7:30pm
Eric.B  [developer] 15 Apr, 2017 @ 7:48pm 
Check the log file (/GearCity/logfile.log) for any errors or exceptions toward the end of the log.
Last edited by Eric.B; 15 Apr, 2017 @ 7:48pm
< >
Showing 1-15 of 39 comments
Per page: 1530 50