• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Hello everyone! We are again happy to announce some new modding features coming up alongside with Park Life expansion, all of which will be part of the free update.

Asset editor
Sub-meshes
Certain built-in buildings and vehicles have already made use of something called sub-meshes to change their look during the game. Sub-meshes are additional 3D-models with some simple conditions on when to switch them on and off. To give a few examples, you might have seen your friendly neighborhood Landfill Site switching between multiple trash pile models as the building fills up, and many service vehicles using a mirrored model in left-hand traffic. We have now exposed the sub-mesh system in asset editor.

The editor panel now contains a new collapsible menu for sub-meshes when editing buildings and vehicles. Simply click the “Add New” button, select your custom model from the importer menu, tweak its position and rotation, set up any conditions on when to show or hide the sub-mesh in the “Required Conditions” and “Forbidden Conditions” drop-down menus, and you’re ready to go. You can switch the sub-mesh on and off in editor with “Toggle Preview”-button to get some idea on how your asset acts when you finally let it loose in your city.

To give you some idea about how the conditions work let’s take a look at how the Landfill Site is set up. First we’ll import the asset with “Load existing props & decorations” switched on so as not to discard the sub-meshes. Now for clarity let’s switch off all sub-mesh previews.

previewoff.png


The main mesh of the Landfill Site only consists of the surrounding fences. There are in total three sub-meshes with trash piles of varying heights, making use of the “First Half Filled” and “Second Half Filled” conditions only available to certain building types such as Landfill Site and Cemetery. The first sub-mesh has both of these conditions set as “forbidden conditions”, meaning that if any of these conditions is met, the sub-mesh will be toggled off. The second sub-mesh has “First Half Filled” set as required, and “Second Half Filled” as a forbidden condition, and the third one requires both conditions to be met. In the end exactly one of these sub-meshes will always be rendered.

preview and dropdown.png


There are multitude of conditions available, some of them only for some building types such as “Abandoned” condition for zoned buildings. Some general conditions such as “Active” are available for all building types, which you can for example set as forbidden to only have the sub-mesh rendered when the building is turned off. Vehicles have their own set of conditions, and also let you specify conditions on when to hide the main mesh.

Scripting API
We have also added two new scripting interfaces to ICities.dll. These are mainly targeted to more experienced modders, but Cinematic Camera API might be interesting to those wanting to experiment with scripting. The API reference and documentation will become available later in community wiki once Parklife is released.

Asset Data API
The new Asset Data API will enable more advanced asset creators and modders to save custom data straight into their custom asset packages and receive a callback with that data when the asset is loaded. This feature has been requested to ease up custom setup of more complex assets, and should mitigate some needs for external xml-dumps and detour/harmony -hooks on asset loading.

The custom data is saved as byte-arrays into a dictionary using string keys to organize the data. When saving an asset, the game will call OnAssetSaved method in your IAssetDataExtension implementation. The parameters contain the name of the saved asset, the actual asset prefab as a boxed object (which you can cast to game’s internal type in case you need to handle some additional magic), and the data-dictionary as an out-parameter. Similarly OnAssetLoaded will be called for all custom assets when they are loaded. Note that these are called only for the main asset, so for example road elevations or prop variations that get packed in the same package don’t receive additional calls.

Cinematic Camera API
The Cinematic Camera API provides a reliable and convenient way to script beautiful camera sequences of your city, maybe for a showcase video or just to marvel at your creation. A new button has been added next to the existing Free Camera button to activate any custom cinematic camera scripts, along with a built-in cinematic camera to randomly showcase citizens, traffic or buildings in your city.

The API offers some low level controls such as rotating and moving the camera, fading to/from black and changing the camera aperture to control the depth of field, as well as helpers to find citizens, buildings, vehicles etc. with certain parameters in your city. The camera system utilizes Unity coroutine -style scripting which is especially suitable for this kind of frame-to-frame work and lets you easily break your camera script into multiple sequences, start those sequences from others and halt some sequences while waiting for others to finish.

When a player selects the cinematic camera from the in-game menu and activates it, the game will start the OnStart coroutine in your ICameraExtension implementation. The ICamera handle passed to OnStart will contains all the camera control methods, and ICameraExtensionBase also wraps these methods in the base class for some added convenience. When the script has finished controlling the camera for a frame, just use a yield instruction to wait for next frame and the script will keep then take on from where you left.

Cinematic cameras are created much like any other mods, but implementing the ICameraExtension or ICameraExtensionBase will cause the mod to be listed under Cinematic camera scripts tab in content manager and Steam workshop. Due to being scripted assemblies, same security precautions apply to cinematic camera scripts as with any other mods, and enabling any camera scripts will disable achievements.

Menu Filtering

We have a real treat for all players, regardless whether you buy or don't Parklife we have included the Menu Filtering feature for everyone to enjoy. As some may have noticed that with all the additional content from the previously published expansions, some of the in-game and editor menus have become somewhat crowded. Instead of just leaving it be, we made Menu Filtering so the browsing of the menus isn't as slow as it used to be. Menu Filtering is a new feature that will help players to filter down the objects in the menus and make menu browsing easier.

So, lets go over the basic functionality real quick:

  • Each of the in-game and editor menus that has filters available will have the filters as small buttons next to the menu.
    • If a menu has multiple tabs, the filters are determined per tab.
  • By clicking (primary mouse button) the filter button the player activates the filter and the menu will show only items that fulfill the conditions specified by the filter.
  • When multiple filters are chosen, all of the filters' conditions must be met, thus narrowing down the range of available menu objects.
  • The filters can be deactivated by clicking them again.
There are plenty of different kind of filters, some menus can have more and some can have less filters to choose from. Couple of the menu filters that players will find are "Small Buildings", "Large Buildings" and "Net Structures". Net Structure filter shows you all roads, paths, water pipers and power lines.

The Asset Editor is a special case, there will be a search box instead of filter buttons and will function similarly to Content Managers search feature, I welcome this change with big open arms, finding those assets just got so much easier.

MenuFiltering_Diary.PNG

Let's take a look at all the Small Buildings in City Park menu.

Cheers,
Cities: Skylines developers
 
Two dev diaries in a week? You do spoil us.

So can I finally fix the issue with the XD60 biofuel bus that renders it unable to spawn as a Left lane driving vehicle with this?
 
Can we have option to hide or turn off that new filter menu? Especially if this is a free feature and it's making me really uncomfortable while watching this buttons covering buildings is the menu.
 
I can now start my Cities with costom made Buildings, that will grow as continuos as my city does
Or one could mod a growing Train-Hub dependent on the traveller's count...
Thanks for the heads up
 
Didn't read any of the mod stuff, but SO hyped for filters. Would be cool if we could costomize our filters too.
 
The custom saving for modders sounds like great news, it's gonna remove some maintenance burden from their shoulders at every update. Which means quicker mod updates for players.

Sub-buildings means workshop assets are gonna look way more dynamic, can't wait to see what people come up with.

For the search box, it would be nice if it was globally available in-game with a hotkey (like the current Find It! mod's ctrl+F). I can't count the number of times I've watched YouTubers get lost in the menus looking for an asset they had just downloaded, or for a monument's or unique building's dependency.

Actually here's an idea for you: deep linking. Click a hyperlink in a monument's description and it takes you straight to the building you're supposed to build first. But click the same skylines://asset/my_asset link in a web page, and it focuses the game and navigates to the proper asset in the panel.
 
These are great news :)

Well - I got a question: Is submesh usage only available for buildings after the update or will the vehicle asset editor benefit from this feature too? (as we've got submeshs on helicopters and blimps for their rotors ;) )?

We vehicle modders could do fancy stuff using these like trucks with and without loads, new fancy helicopters, propeller driven planes, hovercraft type vessels (also prop driven), container ships which get unloaded visually...