-
Announcement
-
Simtropolis Returns! 05/26/2026
See here for details about our site recovery efforts.
-
Search the Community
Showing results for tags 'variations'.
Found 3 results
-
Hi all I have a problem with my "color variations" which color the textures below 0 in height. It does not come from my "color texture" which is ok. If anyone has the solution I am willing;)
- 5 Replies
-
- underground
- color
-
(and 2 more)
Tagged with:
-
javascript to make pavement tiles in Photoshop
AmiPolizeiFunk posted a topic in Cities: Skylines Modding - Open Discussion
I hacked the photoshop pattern "Brick Fill" script from photoshop CS6 to tile the pavement with color, brightness, and rotation variations. I'm a noob w javascript so any help or suggestions would be appreciated. I wanted to randomize the flip (mirror) sometimes too, but couldn't figure out how to do it. I was looking for a function like "RenderAPI.flip" or "RenderAPI.mirror" but those don't exist. I don't even know where to look for a list of these functions... maybe this whole method is totally out-of-date. I know you can do similar stuff in blender by routing texture variations into nodes, but I still haven't taken the time to learn the blender node system. Anyway, Mr.Maison asked me on twitter to share the script, so here it is: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Here are a few parameters that you can change to modify the behavior of the patterm // Feel free to modify the values, don't change the variable names // Variation of color of the pattern. // For example, value of 0.2 means that each of the red, green, and blue color components // will be multiplied by a DIFFERENT random value from interval 0.8 and 1. // Set to 0 if you do not want to modify the pattern color. var colorRandomness = 0.01 // use a value between 0 and 1. The default is 0.2. // Variation of pattern brightness. // For example, value of 0.6 means that each of the red, green, and blue color components // will be multiplied by THE SAME random value from interval 0.4 and 1. // Set to 0 if you do not want to modify the pattern brightness. var brightnessRandomness = 0.1 // use a value between 0 and 1. The default is 0.4. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // You can modify the code below but keep in mind that as with any scripting // you can break things. Keep a backup copy. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // We could use Math.random but then we do not have control over the seed // Object rand rand.seed = 1 function rand() { rand.seed = (rand.seed*9301+49297) % 233280; return rand.seed/(233280.0); } function getRandomInt(max) { return Math.floor(Math.random() * Math.floor(max)); } /////////////////////////////////////////////////////////////////////////// // get the size of the output area var outputSize = RenderAPI.getParameter(kpsSize) // get the location of the top left corner of the bounding rectangle around the selected area var outputOrigin = RenderAPI.getParameter(kpsOrigin) // Get pattern and its size var pattern = RenderAPI.getParameter(kpsPattern) var patternSize = pattern.getParameter(kpsSize) RenderAPI.translateRel (patternSize.x/2, patternSize.y/2) RenderAPI.translateRel ( -(outputOrigin.x % patternSize.x), -(outputOrigin.y % patternSize.y)) var row = Math.floor( outputOrigin.y / patternSize.y ) var column = Math.floor( outputOrigin.x / patternSize.x ) pattern.setParameter (kpsColorBlendMode, kpsBlendMultiply) //pattern.setParameter (kpsColorBlendMode, kpsBlendLinearLight) for (var y = 0; y < outputSize.y + patternSize.y; y+= patternSize.y, row++) { RenderAPI.pushMatrix() var x = 0 for (var c = column; x < outputSize.x + patternSize.x; x+= patternSize.x, c ++) { if (getRandomInt(4)==1){ RenderAPI.pushMatrix() // Set the seed based on the current row and column - this assures that the color will be modified // in the same way for the pattern in the neighboring selected area rand.seed = row * 1234567 + c * 7654321 // setting seed for each pattern is not that good, but calling an extra rand helps rand() var rc = colorRandomness // color randomness var br = 1 - brightnessRandomness + rand()*brightnessRandomness // brightness RenderAPI.Color (kFillColor, br *(1 - rc + rand()*rc), br*(1 - rc + rand()*rc), br*(1 - rc + rand()*rc)) //RenderAPI.scale(rand()*0.1 + 1) RenderAPI.rotate(getRandomInt(4)*90) // my own little mod to rotate the pattern either 0, 90, 180, or 270 deg pattern.render(RenderAPI) RenderAPI.popMatrix() } RenderAPI.translate(patternSize.x, 0) } RenderAPI.popMatrix() RenderAPI.translate(0, patternSize.y) } To use this script in Photoshop, save it as "Pavement fill.jsx" and put it in your ...Photoshop->presets->Deco directory. Restart Photoshop. Do a Pattern fill an tick the "Scripted Patterns" box at the bottom. Select "Pavement fill" from the dropdown and use a square pattern. This particular version of the script scatters the selected pattern across the whole image, with a 1 in 4 chance to place a tile. The idea is that after you do a background fill of one tile, you use this script to make multiple passes, one time for each of 4 different tiles. It's probably a terrible way to do an already solved task, but in the end I was happy to get the result that I wanted. Have you guys solved this problem in other ways? -
Hello guys, it's me Trylk255. My project is somehow a little bit difficult at the momment. I have two possibilities, wich might be combined. First, I would like to know who's interested in the following ideas to improve the visual of MegaTowers : 1. Modify the colors on the sides (Ex : commercial has blue lines, residentials has green lines, offices has yellow lines) And/Or 2. Modify the shape to add a circle with "R" (green colored) for Residential floors, "C" (blue colored) for Commercial floors, "O" or "I" (yellow (not shiny yellow) for Office floors or Industrial floors
-
- residential floors
- commercial floors
- (and 3 more)

