Cities: Skylines

Cities: Skylines

46 ratings
Making custom sitting assets
By hadece
For asset makers: Make Cims sit anywhere on your custom props.
   
Award
Favorite
Favorited
Unfavorite
Introduction
In this guide I will explain how to create any desired number of individually placed sitting areas for your custom chairs, benches, stools or whatever you can imagine.

The prop works only if you put them into an asset (building, park) afterwards. It does not work if placed ingame with More Beautification MOD. You can, however make a 1x1 park asset with only your prop to work around.

What you need:
Asset preparation (blender)
Save your prop centered
(skip if you know how)
  • set your asset in object mode to x0 y0 z0
  • Press Crtl+A and apply location
  • deselect all and select the object you want to export.
  • export your asset as .fbx with selected objects and apply transformation checked.

Write down the position (xyz) of the front edge of your sitting area




Import the prop
Import your prop as usual. In the import data selection make sure that the scaling is set to 1 (blender). Please note that the sitting feature will not be visible in the asset editor. You will be able to check your prop later ingame.
Create the sitting area
Take a look at the Script[gist.github.com]: You can set the amount of sitting areas (row 8), their individual direction (13) and position (14).

// m_specialPlaces (SittingDown) // Sets the amount, direction and position of sitting places for benches. var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; var specialPlaces = 1; // amount of sitting positions PropInfo.SpecialPlace[] temp = new PropInfo.SpecialPlace[specialPlaces]; // sitting direction and position temp[0].m_direction = new Vector3(0, 0, 1); temp[0].m_position = new Vector3(-0.5f, 0, -0.5f); temp[0].m_specialFlags.value__ = 65536; // if you want want another one //temp[1].m_direction = new Vector3(0, 0, -1); //temp[1].m_position = new Vector3(0.5f, 0, 0.5f); //temp[1].m_specialFlags.value__ = 65536; // and another one... //temp[2].m_direction = new Vector3(0, 0, -1); //temp[2].m_position = new Vector3(0.5f, 0, 0.5f); //temp[2].m_specialFlags.value__ = 65536; asset.m_specialPlaces = temp;
Code by Ronyx69


Direction
temp[0].m_direction = new Vector3(0, 0, 1);
sets in which direction your citizen will look when they sit down. You can enter whole positive or negative numbers in all three values

The direction is based on the global axis and not on your asset. That means: if your asset is positioned diagonally in blender, that you have to position the sitting area diagonally as well.

Viewed from above:
First value only sets the direction to the right (1, 2, ...) or left (-1, -2, ...)
EXAMPLE: temp[0].m_direction = new Vector3(1, 0, 0);
Second value: 1 and -1 sets the direction diagonally. Values above/below 1/-1 result in multiple positions. Not sure about the function of this value, maybe a randomizer
Third value only sets down (1, 2, ...) or up (-1, -2, ...)
EXAMPLE: temp[0].m_direction = new Vector3(0, 0, 1);

Combinations of first and third value sets the direction diagonally as well.


Position
temp[0].m_position = new Vector3(-0.5f, 0, -0.5f);
sets where the seating area is. The numbers in the brackets are values for the x z y (!) axis.

  • x 0 is the center. Insert your seat's center (x value) here
  • z 0 is the standard sitting height for adults (=their feet touch the ground). It's around 50cm above ground. A negative value will let the feet sink into the ground.
  • y 0 puts their feet somewhere near the center. Best is to add 0.30 to 0.50 to your seat's front edge y value (see example left)


(For left or right heading chairs, switch the steps for x and y.)

After you edited the script (word, text editor, whatever) copy the code.
In the asset editor, hit F7 to open ModTools. Paste the code and hit run or enter.

And thats it! You can save your asset now and test ingame after using the prop in an asset of your choice. Restart the asset editor if it doesnt show up in the prop list.
By the way: You can run the script again as much as you like on your prop. It will overwrite any values you entered before.

>The chair used in this guide is available here<[www.patreon.com]

If you find this guide helpful, leave me a thumbsup or some comment! If you have questions, feel free to ask. Special Thanks to Ronyx69 for publishing the script!


9 Comments
hadece  [author] 15 Jan, 2021 @ 5:27am 
Hi Nanderty,
sadly, I don't know what causes this bug either.
Nanderty 15 Jan, 2021 @ 4:57am 
Thank you for this guide. I used it to learn more about how chairs and sitting spots in this game work. I am trying to make a chair I found in the workshop functional by putting it in a park. I used the floating shader to make the park raisable. people sit on the chair, but if I raise the park, only the chair-prop moves up, whilst the people still sit down on the ground. Do you know how to fix that?
Dayradon 4 Dec, 2018 @ 6:55pm 
Can i use this method for injecting other unity script into an asset/prop etc. like translate/tween, void update. etc.
Rex_Luminor 16 Aug, 2018 @ 8:51am 
Great guide! Thanks a lot :highlvl:
hemeac 3 Jun, 2018 @ 3:47pm 
@hadece, Thanks for the guide
notDONEyet 16 May, 2018 @ 4:36am 
Great!!
hadece  [author] 29 Jan, 2018 @ 12:23pm 
Since the direction is global, you can give each chair another direction. the left chair to the right and vice versa. Check the graphic for coordinates.

If your chairs sit on the y axis, you can use the position chapter as I described, otherwise you will have to switch the instructions for y and x :)
Shannanigan 29 Jan, 2018 @ 10:11am 
This is great! You wouldn't happen to know how to do this with a table & chairs?
Where the sitting position needs to be facing inward towards the center?

I'm wondering how that effects the coordinates....
LZB 22 Nov, 2017 @ 7:06am 
good!