Cities: Skylines

Cities: Skylines

Ikke nok vurderinger
How to make floating props for C:S
Af Lee Towers
Currently there is only a handful of props in the workshop that actually float on water. With this guide I will explain how to make your own items float on water. It's mostly useful for small boats and other floating objects like buoys, the effect will be way too strong for bigger assets to be realistic.
   
Pris
Føj til foretrukne
Gjort til foretrukken
Fjern som foretrukken
Introduction
This guide will teach you how to import your model into the game, how to edit it in the asset manager and finally how to export it to the workshop. It will focus on making the asset floating. I assume that you already know how to export your model from your 3D modelling software to a format that the game can use. I also assume you know basic stuff about uploading things to the workshop from the asset editor, like adding thumbnails and stuff.

What you'll need:

- A model that's ready to import into the game (.fbx plus texture files)
- ModTools by BloodyPenguin
- Optional, but recommended: Asset UI Category Changer by Snow_Cat
- If you want to make a building wrapper the easy way (no workshop uploading functionality that I could find, though), you will need either BloodyPenguin's boat pack (AD required, it uses default AD props) or GCVos's Small Boat (no AD required, the prop is included). Don't worry, this will all be explained later.
Creating a prop
1. Start the game, go to tools > tools > asset manager > new

2. In the asset manager, click "Prop" and hit "Continue"

3. Select your .fbx file from the list and hit "Continue". Make sure that the "bottom-center pivot" button is unchecked.

4. You should be seeing your prop now. In the properties menu, change the preferred UI category (if you're using that mod) and uncheck both the "Create ruining" and "Use color variations" buttons.


5. If it's not open already, hit F7 to bring up the debug console. Paste the following code into the console and hit enter.

var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; if(asset == null) { Debug.Log("Error: Not a prop!"); return; } asset.m_requireHeightMap = true; var shader = Shader.Find("Custom/Props/Prop/Floating"); if(asset.m_material != null) asset.m_material.shader = shader; if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader; Debug.Log("Success!");

Your model will disappear, but don't worry! What you just did by running that script is change the shader of the model to one that will make the item float in the end. Since floating can only happen on water, and there is no water in the asset editor, the model will disappear. The next time you'll see your model appear again is all the way at the end of the process, when you place it in game and is ready to publish.



6. Save your model. I recommend naming the file something like "floating_object_prop" so that you can easily recognise your file later (you'll be making at least one other file later, if not two).

Congratulations! You have now made a prop that you can not place on water, and will not be visible on land. To fix this, follow the next section of this guide!
Creating a building "wrapper"
Since there is no default template that we can use to place props on water, we will need to make a replacement building (called a "wrapper") that contains only the prop. We can then change the parameters of the building so that it can be placed on water.

1. If you haven't restarted the game or your asset manager after completing the last section, do so now. Open the asset manager (new asset) and choose "park". Hit continue. This will create an empty park.

2. Make the plot size 1x1. It can be bigger if you wish, but for a simple prop like a buoy 1x1 is enough. You can choose to make it circular in the options.

3. Find your prop and place it in the middle of your plot. It will still be invisible!

4. If you want, you can change the UI Category here as well (use the top one). LandscapingWaterStructures is the one I used (that's the one with the canals).

5. Change all the fire, entertainment, tourist values etc. to 0.

5. Make sure the "Availability" is at least set to "Game"! I screwed that up myself while making this guide... ^^

6. Now it's time to make the park ploppable on water. Press ctrl+e to bring up the Scene Explorer. Navigate to "Tool controller > ToolController > PrefabInfo" and find an entry called "BuildingInfo+PlacementMode m_placementMode". The default value will be "Roadside". Click on this and change it to "OnWater" (more screenshots on how to find this options are in this guide by TPB)


7. Save your asset. Again, give it a handy name, like "floating_object_wrapper".

Now, exit the asset editor and go to the next section of this guide.
Uploading to the workshop - part I
In this section we will be uploading both the prop and the building wrapper to the workshop. However, this will not be the final workshop submission. The problem is that the building you've created is referring to your local version of the prop instead of the (public) workshop version.

1. In the main menu, go to the content manager and find both your prop and wrapper. Upload both of them to the workshop. You can change the visibility to "hidden" in the workshop, if you want to.

2. Close the game and subscribe to your own workshop submissions. To avoid any confusion in versions later, you can disable your local versions in the content manager before you do this (or just look at the "last created" time stamp and use the most recent one...)

3. Open your game and open the asset manager again. Load the workshop version of the wrapper.

4. Delete the (insvisible) local instance of your prop in the wrapper and replace it with the (also invisible) workshop version. Note that in the screenshot below two different versions of the prop are visible, so make sure you have the right one!


5. Save your asset. Give it a final file name, like "floating_object".

6. Since everything is still invisible in the asset editor, I recommend going in-game to a) test your asset, and b) take screenshots to edit and include with your final workshop submission. I assume you will already know how to do this (since this is basic asset publishing stuff), so I won't go into further detail here.
Uploading to the workshop - part II
Assuming your final wrapper contains the workshop version of your prop and your preferred thumbnails, it is time to upload!

1. Go to the content manager in the main menu and find your final asset.

2. Click the tiny folder icon in the bottom right of the preview image. A temporary folder will open from which everything will be uploaded to the workshop.

3. In your normal file explorer, find the workshop folder that contains your uploaded prop. This will usually be in
C:\Program Files (x86)\Steam\SteamApps\workshop\content\255710
. The name of the right folder matches the content ID of the workshop submission (found at the end of the steam url).

4. Copy the .crp file from the workshop folder to the subfolder "Contents" inside the temporary folder.

5. Publish! You can edit the workshop title, description and pictures (excluding preview image) later via Steam.

Acknowledgements
That's it, you're done! Assuming a) you've followed the guide correctly and b) I've made the guide correctly...

I want to thank BloodyPenguin for paving the road to this guide, by both updating ModTools and explaining a few things in the comments of his boat pack to... another person. So thanks to that person as well, for asking how it's done, couldn't have done it without that ;)

Also, thanks to Boformer for script to change the shader.

Link to the buoy pack that I've made during the making of this guide: http://steamproxy.net/sharedfiles/filedetails/?id=788185296

If I've made a mistake in this guide, or if it can be improved in any way, let me know! :)
6 kommentarer
Lee Towers  [ophavsmand] 11. juni 2019 kl. 1:35 
It's been a while since I've used this so I'm not sure, but illumination maps work differently for vehicles and props. So maybe you need to remake your illumination map if you exported it from a vehicle asset. I don't remember if they work at all for floating props, though, might indeed be a limitation...
Ernstbert_Fool 10. juni 2019 kl. 14:48 
Hello and thanks for the tutorial and the explanation to the floating building shader. It brought my ship on the water. But I have a question. My Illumination Map does not work. Is that a limitation of the floating building shader or am I just too stupid? Best regards!
hadece 6. juli 2017 kl. 9:40 
Great! Fantastic! Perfect!
Thank you so much for your quick and informative answer, I will immediately try this out!
Lee Towers  [ophavsmand] 6. juli 2017 kl. 9:30 
I don't have the time to edit the guide currently, but I can provide you with the script to use the floating building shader:

var shader = Shader.Find("Custom/Buildings/Building/Floating");
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo;
if(asset.m_material != null) asset.m_material.shader = shader;
if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader;

Run this in the asset editor (in the same manner as the script used in this guide) after importing your model as a building. Beware though - props used on this building won't "float with" the model, they'll sink to the bottom or do other weird stuff. So you can't use props on floating objects.

Hope this clarifies things!
Lee Towers  [ophavsmand] 6. juli 2017 kl. 9:30 
This guide isn't entirely outdated. If you want to make floating props, this is still the way to go.

The recent update added another shader, virtually the same as the one used for props, but now also applicable to buildings. This means that you can skip a lot of steps to create any floating object: simply import your model to the asset editor and apply the floating shader with modtools. No props required.

Now, why would you use this new shader for all objects? Well, props still have the ability to be used in other assets. Say that someone wants to make a marina asset - if all floating boats on the workshop used the new shader, they'd all be buildings: so you wouldn't be able to use them in a marina asset. If they're made by following this guide - prop versions would be available for use in the asset editor.

So basically - if you think people will want to use your asset as a prop in other assets, use this guide, otherwise use the new building shader.
hadece 6. juli 2017 kl. 6:54 
First of: excellent guide!

Is it still up to date? You mentioned the "floating shader" in your newsest buoy item. Can you add this process to the guide?

If this is still the nessessary process: How can you eleminate that "wet effect" and embed the prop?

(There are some floating objects in the workshop that dont have neither wet effect nor a prop required, so it should be possible.)